ADD: 24 Hours Clock + .gitignore on the 2s2h.h (#229)

* ADD: 24 Hours Clock

* TWEAK: gitignore
This commit is contained in:
PurpleHato
2024-05-22 09:05:01 -05:00
committed by Garrett Cox
parent f2a61a22b5
commit aac00dd71a
17 changed files with 82 additions and 6 deletions
+1
View File
@@ -305,6 +305,7 @@ void DrawEnhancementsMenu() {
});
UIWidgets::CVarCheckbox("Skip Entrance Cutscenes", "gEnhancements.TimeSavers.SkipEntranceCutscenes");
UIWidgets::CVarCheckbox("Hide Title Cards", "gEnhancements.TimeSavers.HideTitleCards");
UIWidgets::CVarCheckbox("24 Hours Clock", "gEnhancements.General.24HoursClock");
if (mHudEditorWindow) {
UIWidgets::WindowButton("Hud Editor", "gWindows.HudEditor", mHudEditorWindow, {
+2 -1
View File
@@ -5,5 +5,6 @@
*.vtx.inc
*.dlist.inc
# Unignore our custom assets
# Unignore our custom assets and header file
!custom/**/*
!2s2h_assets.h
+57
View File
@@ -0,0 +1,57 @@
#pragma once
#include "align_asset_macro.h"
// This file is manually made
// When new assets are added to the soh.otr file
// We need to add the aligned version of the resource names here and use in code
// On Mac, not using aligned resource names was causing crashes in release builds
// textures
#define dgDPad "__OTR__textures/parameter_static/gDPad"
static const ALIGN_ASSET(2) char gDPadTex[] = dgDPad;
#define dgArrowUp "__OTR__textures/parameter_static/gArrowUp"
static const ALIGN_ASSET(2) char gArrowUpTex[] = dgArrowUp;
#define dgArrowDown "__OTR__textures/parameter_static/gArrowDown"
static const ALIGN_ASSET(2) char gArrowDownTex[] = dgArrowDown;
#define dgTriforcePiece "__OTR__textures/parameter_static/gTriforcePiece"
static const ALIGN_ASSET(2) char gTriforcePieceTex[] = dgTriforcePiece;
#define dgThreeDayClockHour13Tex "__OTR__textures/parameter_static/gThreeDayClockHour13Tex"
static const ALIGN_ASSET(2) char gThreeDayClockHour13Tex[] = dgThreeDayClockHour13Tex;
#define dgThreeDayClockHour14Tex "__OTR__textures/parameter_static/gThreeDayClockHour14Tex"
static const ALIGN_ASSET(2) char gThreeDayClockHour14Tex[] = dgThreeDayClockHour14Tex;
#define dgThreeDayClockHour15Tex "__OTR__textures/parameter_static/gThreeDayClockHour15Tex"
static const ALIGN_ASSET(2) char gThreeDayClockHour15Tex[] = dgThreeDayClockHour15Tex;
#define dgThreeDayClockHour16Tex "__OTR__textures/parameter_static/gThreeDayClockHour16Tex"
static const ALIGN_ASSET(2) char gThreeDayClockHour16Tex[] = dgThreeDayClockHour16Tex;
#define dgThreeDayClockHour17Tex "__OTR__textures/parameter_static/gThreeDayClockHour17Tex"
static const ALIGN_ASSET(2) char gThreeDayClockHour17Tex[] = dgThreeDayClockHour17Tex;
#define dgThreeDayClockHour18Tex "__OTR__textures/parameter_static/gThreeDayClockHour18Tex"
static const ALIGN_ASSET(2) char gThreeDayClockHour18Tex[] = dgThreeDayClockHour18Tex;
#define dgThreeDayClockHour19Tex "__OTR__textures/parameter_static/gThreeDayClockHour19Tex"
static const ALIGN_ASSET(2) char gThreeDayClockHour19Tex[] = dgThreeDayClockHour19Tex;
#define dgThreeDayClockHour20Tex "__OTR__textures/parameter_static/gThreeDayClockHour20Tex"
static const ALIGN_ASSET(2) char gThreeDayClockHour20Tex[] = dgThreeDayClockHour20Tex;
#define dgThreeDayClockHour21Tex "__OTR__textures/parameter_static/gThreeDayClockHour21Tex"
static const ALIGN_ASSET(2) char gThreeDayClockHour21Tex[] = dgThreeDayClockHour21Tex;
#define dgThreeDayClockHour22Tex "__OTR__textures/parameter_static/gThreeDayClockHour22Tex"
static const ALIGN_ASSET(2) char gThreeDayClockHour22Tex[] = dgThreeDayClockHour22Tex;
#define dgThreeDayClockHour23Tex "__OTR__textures/parameter_static/gThreeDayClockHour23Tex"
static const ALIGN_ASSET(2) char gThreeDayClockHour23Tex[] = dgThreeDayClockHour23Tex;
#define dgThreeDayClockHour24Tex "__OTR__textures/parameter_static/gThreeDayClockHour24Tex"
static const ALIGN_ASSET(2) char gThreeDayClockHour24Tex[] = dgThreeDayClockHour24Tex;
@@ -33,12 +33,12 @@ static const ALIGN_ASSET(2) char gQuestIconDungeonMapTex[] = dgQuestIconDungeonM
#define dgQuestIconGoldSkulltula2Tex "__OTR__icon_item_24_static_yar/gQuestIconGoldSkulltula2Tex"
static const ALIGN_ASSET(2) char gQuestIconGoldSkulltula2Tex[] = dgQuestIconGoldSkulltula2Tex;
#define dgQuestIconSmallMagicJarTex "__OTR__icon_item_24_static_yar/gQuestIconSmallMagicJarTex"
static const ALIGN_ASSET(2) char gQuestIconSmallMagicJarTex[] = dgQuestIconSmallMagicJarTex;
#define dgQuestIconSmallKeyTex "__OTR__icon_item_24_static_yar/gQuestIconSmallKeyTex"
static const ALIGN_ASSET(2) char gQuestIconSmallKeyTex[] = dgQuestIconSmallKeyTex;
#define dgQuestIconSmallMagicJarTex "__OTR__icon_item_24_static_yar/gQuestIconSmallMagicJarTex"
static const ALIGN_ASSET(2) char gQuestIconSmallMagicJarTex[] = dgQuestIconSmallMagicJarTex;
#define dgQuestIconBigMagicJarTex "__OTR__icon_item_24_static_yar/gQuestIconBigMagicJarTex"
static const ALIGN_ASSET(2) char gQuestIconBigMagicJarTex[] = dgQuestIconBigMagicJarTex;
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

+19 -2
View File
@@ -16,6 +16,7 @@
#include "BenPort.h"
#include <string.h>
#include "BenGui/HudEditor.h"
#include "2s2h_assets.h"
#include "Enhancements/GameInteractor/GameInteractor.h"
// #region 2S2H [Port] Asset tables we can pull from instead of from ROM
@@ -4850,6 +4851,17 @@ void Interface_DrawClock(PlayState* play) {
gThreeDayClockHour4Tex, gThreeDayClockHour5Tex, gThreeDayClockHour6Tex, gThreeDayClockHour7Tex,
gThreeDayClockHour8Tex, gThreeDayClockHour9Tex, gThreeDayClockHour10Tex, gThreeDayClockHour11Tex,
gEmptyTexture, gEmptyTexture, // 2S2H [Port] To account for the vanilla bug detailed later on in this function
};
// 2S2H Region [Enhancements] 24 Hours Clock
static TexturePtr sThreeDayClockHourTwentyHourHoursTextures[] = {
gThreeDayClockHour24Tex, gThreeDayClockHour1Tex, gThreeDayClockHour2Tex, gThreeDayClockHour3Tex,
gThreeDayClockHour4Tex, gThreeDayClockHour5Tex, gThreeDayClockHour6Tex, gThreeDayClockHour7Tex,
gThreeDayClockHour8Tex, gThreeDayClockHour9Tex, gThreeDayClockHour10Tex, gThreeDayClockHour11Tex,
gThreeDayClockHour12Tex, gThreeDayClockHour13Tex, gThreeDayClockHour14Tex, gThreeDayClockHour15Tex,
gThreeDayClockHour16Tex, gThreeDayClockHour17Tex, gThreeDayClockHour18Tex, gThreeDayClockHour19Tex,
gThreeDayClockHour20Tex, gThreeDayClockHour21Tex, gThreeDayClockHour22Tex, gThreeDayClockHour23Tex,
gEmptyTexture, gEmptyTexture, // 2S2H [Port] To account for the vanilla bug detailed later on in this function
// #endregison
};
static s16 sClockInvDiamondPrimRed = 0;
static s16 sClockInvDiamondPrimGreen = 155;
@@ -5212,7 +5224,9 @@ void Interface_DrawClock(PlayState* play) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, sThreeDayClockAlpha);
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[24], 8, 0);
OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0);
OVERLAY_DISP = CVarGetInteger("gEnhancements.General.24HoursClock", 0) ?
Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTwentyHourHoursTextures[sp1C6], 4, 16, 11, 0) :
Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0);
// Colours the Three-Day Clocks's Hour Digit Above the Sun
gDPPipeSync(OVERLAY_DISP++);
@@ -5236,7 +5250,10 @@ void Interface_DrawClock(PlayState* play) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, sThreeDayClockAlpha);
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[32], 8, 0);
OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0);
OVERLAY_DISP = CVarGetInteger("gEnhancements.General.24HoursClock", 0) ?
Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTwentyHourHoursTextures[sp1C6], 4, 16, 11, 0) :
Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0);
// Colours the Three-Day Clocks's Hour Digit Above the Moon
gDPPipeSync(OVERLAY_DISP++);