summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorbriaguya <70942617+briaguya-ai@users.noreply.github.com>2023-06-09 17:22:25 -0400
committerGitHub <noreply@github.com>2023-06-09 17:22:25 -0400
commitd69c07cd751cd3dc25ab55fc08c2ce875ccd6d20 (patch)
treeb5faca3292c0d5117c6a6b5928b2daedf519a991 /soh/src/code
parente46c60a7a1396374e23f7a1f7122ddf9efcadff7 (diff)
numbers aren't magic (#2976)
* numbers aren't magic * chest style matches contents renamed everything except the cvar itself at this point (waiting for versioned configs for that) * tracker as part of names * finish the tracker rename --------- Co-authored-by: briaguya <briaguya@alice>
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_face_reaction.c3
-rw-r--r--soh/src/code/z_message_PAL.c7
-rw-r--r--soh/src/code/z_parameter.c10
-rw-r--r--soh/src/code/z_play.c7
4 files changed, 16 insertions, 11 deletions
diff --git a/soh/src/code/z_face_reaction.c b/soh/src/code/z_face_reaction.c
index c262cd3a2..899c6afc6 100644
--- a/soh/src/code/z_face_reaction.c
+++ b/soh/src/code/z_face_reaction.c
@@ -1,4 +1,5 @@
#include "global.h"
+#include "soh/Enhancements/enhancementTypes.h"
u16 sReactionTextIds[][PLAYER_MASK_MAX] = {
{ 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 },
@@ -66,7 +67,7 @@ u16 sReactionTextIds[][PLAYER_MASK_MAX] = {
u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet) {
u8 currentMask = Player_GetMask(play);
- if (CVarGetInteger("gMMBunnyHood", 0) && currentMask == PLAYER_MASK_BUNNY) {
+ if (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && currentMask == PLAYER_MASK_BUNNY) {
return 0;
} else {
return sReactionTextIds[reactionSet][currentMask];
diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c
index 881637d8d..a13c36f4c 100644
--- a/soh/src/code/z_message_PAL.c
+++ b/soh/src/code/z_message_PAL.c
@@ -7,6 +7,7 @@
#include "textures/parameter_static/parameter_static.h"
#include "textures/message_static/message_static.h"
#include "textures/message_texture_static/message_texture_static.h"
+#include "soh/Enhancements/cosmetics/cosmeticsTypes.h"
s16 sTextFade = false; // original name: key_off_flag ?
@@ -97,7 +98,7 @@ void Message_ResetOcarinaNoteState(void) {
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", 0)) {
+ } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) {
sOcarinaNoteABtnPrim = (Color_RGB8){ 80, 255, 150 };
}
if (CVarGetInteger("gCosmetics.Hud_CButtons.Changed", 0)) {
@@ -465,7 +466,7 @@ void Message_DrawTextboxIcon(PlayState* play, Gfx** p, s16 x, s16 y) {
sIconPrimColors[0].b = (color.b / 255) * 95;
sIconPrimColors[1] = color;
sIconEnvColors[1] = color;
- } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) {
+ } else if (CVarGetInteger("gCosmetics.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 };
@@ -2017,7 +2018,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
sOcarinaNoteAPrimColors[0].b = (color.b / 255) * 95;
sOcarinaNoteAPrimColors[1] = color;
sOcarinaNoteAEnvColors[1] = color;
- } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) {
+ } else if (CVarGetInteger("gCosmetics.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 };
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c
index 83066aff4..a05cd2de2 100644
--- a/soh/src/code/z_parameter.c
+++ b/soh/src/code/z_parameter.c
@@ -10,6 +10,8 @@
#include "soh/Enhancements/gameplaystats.h"
#include "soh/Enhancements/boss-rush/BossRushTypes.h"
#include "soh/Enhancements/custom-message/CustomMessageInterfaceAddon.h"
+#include "soh/Enhancements/cosmetics/cosmeticsTypes.h"
+#include "soh/Enhancements/enhancementTypes.h"
#ifdef _MSC_VER
#include <stdlib.h>
@@ -1127,7 +1129,7 @@ void func_80083108(PlayState* play) {
if (interfaceCtx->restrictions.tradeItems != 0) {
for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
- if ((CVarGetInteger("gMMBunnyHood", 0) != 0)
+ if ((CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA)
&& (gSaveContext.equips.buttonItems[i] >= ITEM_MASK_KEATON)
&& (gSaveContext.equips.buttonItems[i] <= ITEM_MASK_TRUTH)) {
gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] = BTN_ENABLED;
@@ -3704,7 +3706,7 @@ void Interface_DrawItemButtons(PlayState* play) {
Color_RGB8 bButtonColor = { 0, 150, 0 };
if (CVarGetInteger("gCosmetics.Hud_BButton.Changed", 0)) {
bButtonColor = CVarGetColor24("gCosmetics.Hud_BButton.Value", bButtonColor);
- } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) {
+ } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) {
bButtonColor = (Color_RGB8){ 255, 30, 30 };
}
@@ -3732,7 +3734,7 @@ void Interface_DrawItemButtons(PlayState* play) {
Color_RGB8 startButtonColor = { 200, 0, 0 };
if (CVarGetInteger("gCosmetics.Hud_StartButton.Changed", 0)) {
startButtonColor = CVarGetColor24("gCosmetics.Hud_StartButton.Value", startButtonColor);
- } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) {
+ } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) {
startButtonColor = (Color_RGB8){ 120, 120, 120 };
}
@@ -4828,7 +4830,7 @@ void Interface_Draw(PlayState* play) {
Color_RGB8 aButtonColor = { 90, 90, 255 };
if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) {
aButtonColor = CVarGetColor24("gCosmetics.Hud_AButton.Value", aButtonColor);
- } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) {
+ } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) {
aButtonColor = (Color_RGB8){ 0, 200, 50 };
}
diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c
index b76555b06..59257ad9f 100644
--- a/soh/src/code/z_play.c
+++ b/soh/src/code/z_play.c
@@ -9,6 +9,7 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
#include <overlays/actors/ovl_En_Niw/z_en_niw.h>
+#include "soh/Enhancements/enhancementTypes.h"
#include <libultraship/libultraship.h>
@@ -644,7 +645,7 @@ void Play_Init(GameState* thisx) {
Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL);
// In order to keep bunny hood equipped on first load, we need to pre-set the age reqs for the item and slot
- if (CVarGetInteger("gMMBunnyHood", 0) || CVarGetInteger("gTimelessEquipment", 0)) {
+ if (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA || CVarGetInteger("gTimelessEquipment", 0)) {
gItemAgeReqs[ITEM_MASK_BUNNY] = 9;
if(INV_CONTENT(ITEM_TRADE_CHILD) == ITEM_MASK_BUNNY)
gSlotAgeReqs[SLOT_TRADE_CHILD] = 9;
@@ -1177,7 +1178,7 @@ void Play_Update(PlayState* play) {
gSaveContext.sohStats.sceneTimer++;
gSaveContext.sohStats.roomTimer++;
- if (CVarGetInteger("gMMBunnyHood", 0) && Player_GetMask(play) == PLAYER_MASK_BUNNY) {
+ if (CVarGetInteger("gMMBunnyHood", BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA && Player_GetMask(play) == PLAYER_MASK_BUNNY) {
gSaveContext.sohStats.count[COUNT_TIME_BUNNY_HOOD]++;
}
}
@@ -2287,7 +2288,7 @@ void Play_PerformSave(PlayState* play) {
} else {
Save_SaveFile();
}
- if (CVarGetInteger("gAutosave", 0)) {
+ if (CVarGetInteger("gAutosave", AUTOSAVE_OFF) != AUTOSAVE_OFF) {
Overlay_DisplayText(3.0f, "Game Saved");
}
}