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
This commit is contained in:
Thomas Achatz 2022-04-21 17:33:05 -05:00 committed by GitHub
parent 0ec9fc2ecf
commit f66178772d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 2 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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();
}

View File

@ -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);