summaryrefslogtreecommitdiff
path: root/soh/src/code/z_message_PAL.c
diff options
context:
space:
mode:
authorMalkierian <malkierian@gmail.com>2024-05-05 22:05:10 -0700
committerMalkierian <malkierian@gmail.com>2024-05-05 22:05:10 -0700
commite2b0ea5692df6bbc29c962170c8e9d3696e57ed7 (patch)
treec370838b2c09b8282d4103e5c6c526b5c39d6651 /soh/src/code/z_message_PAL.c
parent4bd0f2d2c1b176217909f10fdadb9c13121bdb06 (diff)
parent6443a986d9751b87a0b4e82c15f82a9971f88201 (diff)
Merge branch 'develop' of github.com:Malkierian/Shipwright into dev-to-rando-5-5
Diffstat (limited to 'soh/src/code/z_message_PAL.c')
-rw-r--r--soh/src/code/z_message_PAL.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c
index 015d7c4b0..4847bb47e 100644
--- a/soh/src/code/z_message_PAL.c
+++ b/soh/src/code/z_message_PAL.c
@@ -99,30 +99,30 @@ void Message_ResetOcarinaNoteState(void) {
sOcarinaNoteABtnEnv = (Color_RGB8){ 10, 10, 10 };
sOcarinaNoteCBtnPrim = (Color_RGB8){ 255, 255, 50 };
sOcarinaNoteCBtnEnv = (Color_RGB8){ 10, 10, 10 };
- if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) {
- sOcarinaNoteABtnPrim = CVarGetColor24("gCosmetics.Hud_AButton.Value", sOcarinaNoteABtnPrim);
- } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) {
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.AButton.Changed"), 0)) {
+ sOcarinaNoteABtnPrim = CVarGetColor24(CVAR_COSMETIC("HUD.AButton.Value"), sOcarinaNoteABtnPrim);
+ } else if (CVarGetInteger(CVAR_COSMETIC("DefaultColorScheme"), COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) {
sOcarinaNoteABtnPrim = (Color_RGB8){ 80, 255, 150 };
}
- if (CVarGetInteger("gCosmetics.Hud_CButtons.Changed", 0)) {
- sOcarinaNoteCBtnPrim = CVarGetColor24("gCosmetics.Hud_CButtons.Value", sOcarinaNoteCBtnPrim);
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.CButtons.Changed"), 0)) {
+ sOcarinaNoteCBtnPrim = CVarGetColor24(CVAR_COSMETIC("HUD.CButtons.Value"), sOcarinaNoteCBtnPrim);
}
sOcarinaNoteCUpBtnPrim = sOcarinaNoteCBtnPrim;
sOcarinaNoteCDownBtnPrim = sOcarinaNoteCBtnPrim;
sOcarinaNoteCLeftBtnPrim = sOcarinaNoteCBtnPrim;
sOcarinaNoteCRightBtnPrim = sOcarinaNoteCBtnPrim;
- if (CVarGetInteger("gCosmetics.Hud_CUpButton.Changed", 0)) {
- sOcarinaNoteCUpBtnPrim = CVarGetColor24("gCosmetics.Hud_CUpButton.Value", sOcarinaNoteCUpBtnPrim);
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.CUpButton.Changed"), 0)) {
+ sOcarinaNoteCUpBtnPrim = CVarGetColor24(CVAR_COSMETIC("HUD.CUpButton.Value"), sOcarinaNoteCUpBtnPrim);
}
- if (CVarGetInteger("gCosmetics.Hud_CDownButton.Changed", 0)) {
- sOcarinaNoteCDownBtnPrim = CVarGetColor24("gCosmetics.Hud_CDownButton.Value", sOcarinaNoteCDownBtnPrim);
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.CDownButton.Changed"), 0)) {
+ sOcarinaNoteCDownBtnPrim = CVarGetColor24(CVAR_COSMETIC("HUD.CDownButton.Value"), sOcarinaNoteCDownBtnPrim);
}
- if (CVarGetInteger("gCosmetics.Hud_CLeftButton.Changed", 0)) {
- sOcarinaNoteCLeftBtnPrim = CVarGetColor24("gCosmetics.Hud_CLeftButton.Value", sOcarinaNoteCLeftBtnPrim);
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.CLeftButton.Changed"), 0)) {
+ sOcarinaNoteCLeftBtnPrim = CVarGetColor24(CVAR_COSMETIC("HUD.CLeftButton.Value"), sOcarinaNoteCLeftBtnPrim);
}
- if (CVarGetInteger("gCosmetics.Hud_CRightButton.Changed", 0)) {
- sOcarinaNoteCRightBtnPrim = CVarGetColor24("gCosmetics.Hud_CRightButton.Value", sOcarinaNoteCRightBtnPrim);
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.CRightButton.Changed"), 0)) {
+ sOcarinaNoteCRightBtnPrim = CVarGetColor24(CVAR_COSMETIC("HUD.CRightButton.Value"), sOcarinaNoteCRightBtnPrim);
}
}
@@ -150,7 +150,7 @@ void Message_UpdateOcarinaGame(PlayState* play) {
u8 Message_ShouldAdvance(PlayState* play) {
Input* input = &play->state.input[0];
- bool isB_Held = CVarGetInteger("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B)
+ bool isB_Held = CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B)
: CHECK_BTN_ALL(input->press.button, BTN_B);
if (CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
@@ -162,7 +162,7 @@ u8 Message_ShouldAdvance(PlayState* play) {
u8 Message_ShouldAdvanceSilent(PlayState* play) {
Input* input = &play->state.input[0];
- bool isB_Held = CVarGetInteger("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B)
+ bool isB_Held = CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B)
: CHECK_BTN_ALL(input->press.button, BTN_B);
return CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP);
@@ -187,7 +187,7 @@ void Message_HandleChoiceSelection(PlayState* play, u8 numChoices) {
static s16 sAnalogStickHeld = false;
MessageContext* msgCtx = &play->msgCtx;
Input* input = &play->state.input[0];
- bool dpad = CVarGetInteger("gDpadText", 0);
+ bool dpad = CVarGetInteger(CVAR_SETTING("DpadInText"), 0);
if ((input->rel.stick_y >= 30 && !sAnalogStickHeld) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) {
sAnalogStickHeld = true;
@@ -291,7 +291,7 @@ void Message_FindMessage(PlayState* play, u16 textId) {
const char* seg;
u16 bufferId = textId;
// Use the better owl message if better owl is enabled
- if (CVarGetInteger("gBetterOwl", 0) != 0 && (bufferId == 0x2066 || bufferId == 0x607B ||
+ if (CVarGetInteger(CVAR_ENHANCEMENT("BetterOwl"), 0) != 0 && (bufferId == 0x2066 || bufferId == 0x607B ||
bufferId == 0x10C2 || bufferId == 0x10C6 || bufferId == 0x206A))
{
bufferId = 0x71B3;
@@ -463,14 +463,14 @@ void Message_DrawTextboxIcon(PlayState* play, Gfx** p, s16 x, s16 y) {
{ 0, 0, 0 },
{ 0, 130, 255 },
};
- if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) {
- Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_AButton.Value", (Color_RGB8){ 50, 130, 255 });
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.AButton.Changed"), 0)) {
+ Color_RGB8 color = CVarGetColor24(CVAR_COSMETIC("HUD.AButton.Value"), (Color_RGB8){ 50, 130, 255 });
sIconPrimColors[0].r = color.r - 50;
sIconPrimColors[0].g = color.g - 50;
sIconPrimColors[0].b = color.b - 50;
sIconPrimColors[1] = color;
sIconEnvColors[1] = color;
- } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) {
+ } else if (CVarGetInteger(CVAR_COSMETIC("DefaultColorScheme"), COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) {
sIconPrimColors[0] = (Color_RGB8){ 0, 200, 80 };
sIconPrimColors[1] = (Color_RGB8){ 50, 255, 130 };
sIconEnvColors[1] = (Color_RGB8){ 50, 255, 130 };
@@ -873,7 +873,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
Message_SetTextColor(msgCtx, msgCtx->msgBufDecoded[++i] & 0xF);
break;
case ' ':
- msgCtx->textPosX += CVarGetInteger("gTextSpacing", 6);
+ msgCtx->textPosX += CVarGetInteger(CVAR_ENHANCEMENT("TextSpacing"), 6);
break;
case MESSAGE_BOX_BREAK:
if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) {
@@ -1032,7 +1032,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
msgCtx->textDelay = msgCtx->msgBufDecoded[++i];
break;
case MESSAGE_UNSKIPPABLE:
- msgCtx->textUnskippable = CVarGetInteger("gSkipText", 0) != 1;
+ msgCtx->textUnskippable = CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 1;
break;
case MESSAGE_TWO_CHOICE:
msgCtx->textboxEndType = TEXTBOX_ENDTYPE_2_CHOICE;
@@ -1116,7 +1116,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
}
}
if (msgCtx->textDelayTimer == 0) {
- msgCtx->textDrawPos = i + CVarGetInteger("gTextSpeed", 2);
+ msgCtx->textDrawPos = i + CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 2);
msgCtx->textDelayTimer = msgCtx->textDelay;
} else {
msgCtx->textDelayTimer--;
@@ -1189,7 +1189,7 @@ void Message_Decode(PlayState* play) {
phi_s1 = temp_s2 = msgCtx->msgBufDecoded[decodedBufPos] = font->msgBuf[msgCtx->msgBufPos];
// Don't require input for credits textboxes in randomizer
- if (CVarGetInteger("gNoInputForCredits", 0) && (
+ if (CVarGetInteger(CVAR_ENHANCEMENT("NoInputForCredits"), 0) && (
msgCtx->textId == 0x706F ||
msgCtx->textId == 0x7091 ||
msgCtx->textId == 0x7092 ||
@@ -1654,12 +1654,12 @@ void Message_OpenText(PlayState* play, u16 textId) {
//DmaMgr_SendRequest1(font->msgBuf, (uintptr_t)(_staff_message_data_staticSegmentRomStart + 4 + font->msgOffset),
//font->msgLength, __FILE__, __LINE__);
- } else if (CVarGetInteger("gAskToEquip", 0) &&
- (((LINK_IS_ADULT || CVarGetInteger("gTimelessEquipment", 0)) &&
+ } else if (CVarGetInteger(CVAR_ENHANCEMENT("AskToEquip"), 0) &&
+ (((LINK_IS_ADULT || CVarGetInteger(CVAR_CHEAT("TimelessEquipment"), 0)) &&
// 0C = Biggoron, 4B = Giant's, 4E = Mirror Shield, 50-51 = Tunics
(textId == 0x0C || textId == 0x4B || textId == 0x4E ||
textId == 0x50 || textId == 0x51)) ||
- ((!LINK_IS_ADULT || CVarGetInteger("gTimelessEquipment", 0)) &&
+ ((!LINK_IS_ADULT || CVarGetInteger(CVAR_CHEAT("TimelessEquipment"), 0)) &&
// 4C = Deku Shield, A4 = Kokiri Sword
(textId == 0x4C || textId == 0xA4)) ||
// 4D == Hylian Shield
@@ -2018,14 +2018,14 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
{ 10, 10, 10 },
{ 50, 50, 255 },
};
- if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) {
- Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_AButton.Value", (Color_RGB8){ 100, 200, 255 });
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.AButton.Changed"), 0)) {
+ Color_RGB8 color = CVarGetColor24(CVAR_COSMETIC("HUD.AButton.Value"), (Color_RGB8){ 100, 200, 255 });
sOcarinaNoteAPrimColors[0].r = (color.r / 255.0f) * 95;
sOcarinaNoteAPrimColors[0].g = (color.g / 255.0f) * 95;
sOcarinaNoteAPrimColors[0].b = (color.b / 255.0f) * 95;
sOcarinaNoteAPrimColors[1] = color;
sOcarinaNoteAEnvColors[1] = color;
- } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) {
+ } else if (CVarGetInteger(CVAR_COSMETIC("DefaultColorScheme"), COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) {
sOcarinaNoteAPrimColors[0] = (Color_RGB8){ 80, 255, 150 };
sOcarinaNoteAPrimColors[1] = (Color_RGB8){ 100, 255, 200 };
sOcarinaNoteAEnvColors[1] = (Color_RGB8){ 50, 255, 50 };
@@ -2039,8 +2039,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
{ 10, 10, 10 },
{ 110, 110, 50 },
};
- if (CVarGetInteger("gCosmetics.Hud_CButtons.Changed", 0)) {
- Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CButtons.Value", (Color_RGB8){ 100, 200, 255 });
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.CButtons.Changed"), 0)) {
+ Color_RGB8 color = CVarGetColor24(CVAR_COSMETIC("HUD.CButtons.Value"), (Color_RGB8){ 100, 200, 255 });
sOcarinaNoteCPrimColors[0] = color;
sOcarinaNoteCPrimColors[1] = color;
sOcarinaNoteCEnvColors[1].r = (color.r / 255.0f) * 95;
@@ -2056,8 +2056,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
{ 10, 10, 10 },
{ 110, 110, 50 },
};
- if (CVarGetInteger("gCosmetics.Hud_CUpButton.Changed", 0)) {
- Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CUpButton.Value", (Color_RGB8){ 100, 200, 255 });
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.CUpButton.Changed"), 0)) {
+ Color_RGB8 color = CVarGetColor24(CVAR_COSMETIC("HUD.CUpButton.Value"), (Color_RGB8){ 100, 200, 255 });
sOcarinaNoteCUpPrimColors[0] = color;
sOcarinaNoteCUpPrimColors[1] = color;
sOcarinaNoteCUpEnvColors[1].r = (color.r / 255.0f) * 95;
@@ -2073,8 +2073,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
{ 10, 10, 10 },
{ 110, 110, 50 },
};
- if (CVarGetInteger("gCosmetics.Hud_CDownButton.Changed", 0)) {
- Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CDownButton.Value", (Color_RGB8){ 100, 200, 255 });
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.CDownButton.Changed"), 0)) {
+ Color_RGB8 color = CVarGetColor24(CVAR_COSMETIC("HUD.CDownButton.Value"), (Color_RGB8){ 100, 200, 255 });
sOcarinaNoteCDownPrimColors[0] = color;
sOcarinaNoteCDownPrimColors[1] = color;
sOcarinaNoteCDownEnvColors[1].r = (color.r / 255.0f) * 95;
@@ -2090,8 +2090,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
{ 10, 10, 10 },
{ 110, 110, 50 },
};
- if (CVarGetInteger("gCosmetics.Hud_CLeftButton.Changed", 0)) {
- Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CLeftButton.Value", (Color_RGB8){ 100, 200, 255 });
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.CLeftButton.Changed"), 0)) {
+ Color_RGB8 color = CVarGetColor24(CVAR_COSMETIC("HUD.CLeftButton.Value"), (Color_RGB8){ 100, 200, 255 });
sOcarinaNoteCLeftPrimColors[0] = color;
sOcarinaNoteCLeftPrimColors[1] = color;
sOcarinaNoteCLeftEnvColors[1].r = (color.r / 255.0f) * 95;
@@ -2107,8 +2107,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
{ 10, 10, 10 },
{ 110, 110, 50 },
};
- if (CVarGetInteger("gCosmetics.Hud_CRightButton.Changed", 0)) {
- Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CRightButton.Value", (Color_RGB8){ 100, 200, 255 });
+ if (CVarGetInteger(CVAR_COSMETIC("HUD.CRightButton.Changed"), 0)) {
+ Color_RGB8 color = CVarGetColor24(CVAR_COSMETIC("HUD.CRightButton.Value"), (Color_RGB8){ 100, 200, 255 });
sOcarinaNoteCRightPrimColors[0] = color;
sOcarinaNoteCRightPrimColors[1] = color;
sOcarinaNoteCRightEnvColors[1].r = (color.r / 255.0f) * 95;
@@ -2155,7 +2155,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE,
0);
- bool isB_Held = CVarGetInteger("gSkipText", 0) != 0 ? CHECK_BTN_ALL(play->state.input[0].cur.button, BTN_B)
+ bool isB_Held = CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0 ? CHECK_BTN_ALL(play->state.input[0].cur.button, BTN_B)
: CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B);
switch (msgCtx->msgMode) {
@@ -2436,7 +2436,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
}
break;
case MSGMODE_SETUP_DISPLAY_SONG_PLAYED:
- if (CVarGetInteger("gFastOcarinaPlayback", 0) == 0 ||
+ if (CVarGetInteger(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 0) == 0 ||
play->msgCtx.lastPlayedSong == OCARINA_SONG_TIME ||
play->msgCtx.lastPlayedSong == OCARINA_SONG_STORMS ||
play->msgCtx.lastPlayedSong == OCARINA_SONG_SUNS) {
@@ -2491,7 +2491,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
Message_Decode(play);
msgCtx->msgMode = MSGMODE_DISPLAY_SONG_PLAYED_TEXT;
- if (CVarGetInteger("gFastOcarinaPlayback", 0) == 0 || play->msgCtx.lastPlayedSong == OCARINA_SONG_TIME
+ if (CVarGetInteger(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 0) == 0 || play->msgCtx.lastPlayedSong == OCARINA_SONG_TIME
|| play->msgCtx.lastPlayedSong == OCARINA_SONG_STORMS ||
play->msgCtx.lastPlayedSong == OCARINA_SONG_SUNS) {
msgCtx->stateTimer = 20;
@@ -3022,7 +3022,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
* the last value being saved in a static variable.
*/
void Message_DrawDebugVariableChanged(s16* var, GraphicsContext* gfxCtx) {
- if (!CVarGetInteger("gDebugEnabled", 0)) { return; }
+ if (!CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0)) { return; }
static s16 sVarLastValue = 0;
static s16 sFillTimer = 0;
@@ -3163,7 +3163,7 @@ void Message_Update(PlayState* play) {
GameInteractor_ExecuteOnDialogMessage();
- bool isB_Held = CVarGetInteger("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) && !sTextboxSkipped
+ bool isB_Held = CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) && !sTextboxSkipped
: CHECK_BTN_ALL(input->press.button, BTN_B);
switch (msgCtx->msgMode) {
@@ -3382,7 +3382,7 @@ void Message_Update(PlayState* play) {
}
if ((s32)(gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000) {
gSaveContext.inventory.questItems ^= 0x40000000;
- if (!CVarGetInteger("gHurtContainer", 0)) {
+ if (!CVarGetInteger(CVAR_ENHANCEMENT("HurtContainer"), 0)) {
gSaveContext.healthCapacity += 0x10;
gSaveContext.health += 0x10;
} else {