summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Achatz <30968528+shadeRed@users.noreply.github.com>2022-04-21 17:33:05 -0500
committerGitHub <noreply@github.com>2022-04-21 18:33:05 -0400
commitf66178772dae4a296ae38fae54fdff97cd9c5869 (patch)
tree38694c8d8e926adcb19bbbe00736bc95cc627644
parent0ec9fc2ecf46a1337ebac519b0a33f07d502d7c5 (diff)
Dynamic Wallet Rupee Icon Color (#123)
* dynamic rupee rgb * dynamic_wallet_icon cvar * update blue rgb * update blue rgb to match rando * refactor * Update z_parameter.c * update rupeeWalletColors dimensions
-rw-r--r--libultraship/libultraship/GameSettings.cpp4
-rw-r--r--libultraship/libultraship/GameSettings.h1
-rw-r--r--libultraship/libultraship/SohImGuiImpl.cpp5
-rw-r--r--soh/src/code/z_parameter.c20
4 files changed, 28 insertions, 2 deletions
diff --git a/libultraship/libultraship/GameSettings.cpp b/libultraship/libultraship/GameSettings.cpp
index 1b8d473b2..1d510c7cd 100644
--- a/libultraship/libultraship/GameSettings.cpp
+++ b/libultraship/libultraship/GameSettings.cpp
@@ -58,6 +58,9 @@ namespace Game {
Settings.enhancements.animated_pause_menu = stob(Conf[EnhancementSection]["animated_pause_menu"]);
CVar_SetS32("gPauseLiveLink", Settings.enhancements.animated_pause_menu);
+ Settings.enhancements.dynamic_wallet_icon = stob(Conf[EnhancementSection]["dynamic_wallet_icon"]);
+ CVar_SetS32(const_cast<char*>("gDynamicWalletIcon"), Settings.enhancements.dynamic_wallet_icon);
+
Settings.enhancements.minimal_ui = stob(Conf[EnhancementSection]["minimal_ui"]);
CVar_SetS32("gMinimalUI", Settings.enhancements.minimal_ui);
@@ -154,6 +157,7 @@ namespace Game {
Conf[EnhancementSection]["fast_text"] = std::to_string(Settings.enhancements.fast_text);
Conf[EnhancementSection]["disable_lod"] = std::to_string(Settings.enhancements.disable_lod);
Conf[EnhancementSection]["animated_pause_menu"] = std::to_string(Settings.enhancements.animated_pause_menu);
+ Conf[EnhancementSection]["dynamic_wallet_icon"] = std::to_string(Settings.enhancements.dynamic_wallet_icon);
Conf[EnhancementSection]["minimal_ui"] = std::to_string(Settings.enhancements.minimal_ui);
Conf[EnhancementSection]["mm_bunny_hood"] = std::to_string(Settings.enhancements.mm_bunny_hood);
diff --git a/libultraship/libultraship/GameSettings.h b/libultraship/libultraship/GameSettings.h
index fe6087494..18f978386 100644
--- a/libultraship/libultraship/GameSettings.h
+++ b/libultraship/libultraship/GameSettings.h
@@ -23,6 +23,7 @@ struct SoHConfigType {
bool fast_text = false;
bool disable_lod = false;
bool animated_pause_menu = false;
+ bool dynamic_wallet_icon = false;
bool minimal_ui = false;
bool mm_bunny_hood = false;
} enhancements;
diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp
index 860720433..93343b8dd 100644
--- a/libultraship/libultraship/SohImGuiImpl.cpp
+++ b/libultraship/libultraship/SohImGuiImpl.cpp
@@ -425,6 +425,11 @@ namespace SohImGui {
needs_save = true;
}
+ if (ImGui::Checkbox("Dynamic Wallet Icon", &Game::Settings.enhancements.dynamic_wallet_icon)) {
+ CVar_SetS32(const_cast<char*>("gDynamicWalletIcon"), Game::Settings.enhancements.dynamic_wallet_icon);
+ needs_save = true;
+ }
+
ImGui::EndMenu();
}
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c
index dc96ba133..edc4348b9 100644
--- a/soh/src/code/z_parameter.c
+++ b/soh/src/code/z_parameter.c
@@ -3129,6 +3129,14 @@ void Interface_Draw(GlobalContext* globalCtx) {
};
static s16 rupeeDigitsFirst[] = { 1, 0, 0 };
static s16 rupeeDigitsCount[] = { 2, 3, 3 };
+
+ // courtesy of https://github.com/TestRunnerSRL/OoT-Randomizer/blob/Dev/ASM/c/hud_colors.c
+ static s16 rupeeWalletColors[3][3] = {
+ { 0xC8, 0xFF, 0x64 }, // Base Wallet (Green)
+ { 0x82, 0x82, 0xFF }, // Adult's Wallet (Blue)
+ { 0xFF, 0x64, 0x64 }, // Giant's Wallet (Red)
+ };
+
static s16 spoilingItemEntrances[] = { 0x01AD, 0x0153, 0x0153 };
static f32 D_80125B54[] = { -40.0f, -35.0f }; // unused
static s16 D_80125B5C[] = { 91, 91 }; // unused
@@ -3171,7 +3179,15 @@ void Interface_Draw(GlobalContext* globalCtx) {
if (fullUi) {
// Rupee Icon
- gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 100, interfaceCtx->magicAlpha);
+ s16* rColor;
+
+ if (CVar_GetS32("gDynamicWalletIcon", 0)) {
+ rColor = &rupeeWalletColors[CUR_UPG_VALUE(UPG_WALLET)];
+ } else {
+ rColor = &rupeeWalletColors[0];
+ }
+
+ gDPSetPrimColor(OVERLAY_DISP++, 0, 0, rColor[0], rColor[1], rColor[2], interfaceCtx->magicAlpha);
gDPSetEnvColor(OVERLAY_DISP++, 0, 80, 0, 255);
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, OTRGetRectDimensionFromLeftEdge(26),
206, 16, 16, 1 << 10, 1 << 10);
@@ -3269,7 +3285,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
Gfx_TextureI8(OVERLAY_DISP, ((u8*)digitTextures[interfaceCtx->counterDigits[svar2]]), 8, 16,
OTRGetRectDimensionFromLeftEdge(svar3), 206, 8, 16, 1 << 10, 1 << 10);
}
- }
+ }
else {
// Make sure item counts have black backgrounds
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, interfaceCtx->magicAlpha);