diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 3a7cea97e..c017c1fb7 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -2433,24 +2433,23 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) { { 255, 255, 150 }, { 255, 255, 50 }, }; - if (CVar_GetS32("gCustomColors", 0) != 0) { //This will make custom color based on users selected colors. - sMagicBorderColors[0][0] = CVar_GetInt("gCCMagicBorderPrimR", 255); - sMagicBorderColors[0][1] = CVar_GetInt("gCCMagicBorderPrimG", 255); - sMagicBorderColors[0][2] = CVar_GetInt("gCCMagicBorderPrimB", 255); + if (CVar_GetS32("gHudColors", 1) == 2) { //This will make custom color based on users selected colors. + sMagicBorderColors[0][0] = CVar_GetS32("gCCMagicBorderPrimR", 255); + sMagicBorderColors[0][1] = CVar_GetS32("gCCMagicBorderPrimG", 255); + sMagicBorderColors[0][2] = CVar_GetS32("gCCMagicBorderPrimB", 255); - sMagicBorderColors[1][0] = CVar_GetInt("gCCMagicBorderPrimR", 255)/2; - sMagicBorderColors[1][1] = CVar_GetInt("gCCMagicBorderPrimG", 255)/2; - sMagicBorderColors[1][2] = CVar_GetInt("gCCMagicBorderPrimB", 255)/2; + sMagicBorderColors[1][0] = CVar_GetS32("gCCMagicBorderPrimR", 255)/2; + sMagicBorderColors[1][1] = CVar_GetS32("gCCMagicBorderPrimG", 255)/2; + sMagicBorderColors[1][2] = CVar_GetS32("gCCMagicBorderPrimB", 255)/2; - sMagicBorderColors[2][0] = CVar_GetInt("gCCMagicBorderPrimR", 255)/3; - sMagicBorderColors[2][1] = CVar_GetInt("gCCMagicBorderPrimG", 255)/3; - sMagicBorderColors[2][2] = CVar_GetInt("gCCMagicBorderPrimB", 255)/3; + sMagicBorderColors[2][0] = CVar_GetS32("gCCMagicBorderPrimR", 255)/3; + sMagicBorderColors[2][1] = CVar_GetS32("gCCMagicBorderPrimG", 255)/3; + sMagicBorderColors[2][2] = CVar_GetS32("gCCMagicBorderPrimB", 255)/3; - sMagicBorderColors[3][0] = CVar_GetInt("gCCMagicBorderPrimR", 255)/2; - sMagicBorderColors[3][1] = CVar_GetInt("gCCMagicBorderPrimG", 255)/2; - sMagicBorderColors[3][2] = CVar_GetInt("gCCMagicBorderPrimB", 255)/2; + sMagicBorderColors[3][0] = CVar_GetS32("gCCMagicBorderPrimR", 255)/2; + sMagicBorderColors[3][1] = CVar_GetS32("gCCMagicBorderPrimG", 255)/2; + sMagicBorderColors[3][2] = CVar_GetS32("gCCMagicBorderPrimB", 255)/2; } - static s16 sMagicBorderIndexes[] = { 0, 1, 1, 0 }; static s16 sMagicBorderRatio = 2; static s16 sMagicBorderStep = 1; @@ -2649,7 +2648,7 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) { func_80094520(globalCtx->state.gfxCtx); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sMagicBorderR, sMagicBorderG, sMagicBorderB, interfaceCtx->magicAlpha); - if (CVar_GetS32("gCustomColors", 0) != 0) {//Original game add color there so to prevent miss match we make it all white :) + if (CVar_GetS32("gHudColors", 1) == 2) {//Original game add color there so to prevent miss match we make it all white :) gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); } else { gDPSetEnvColor(OVERLAY_DISP++, 100, 50, 50, 255); @@ -2680,8 +2679,8 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) { if (gSaveContext.unk_13F0 == 4) { // Yellow part of the bar indicating the amount of magic to be subtracted - if (CVar_GetS32("gCustomColors", 0) != 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetInt("gCCMagicUsePrimR", 250), CVar_GetInt("gCCMagicUsePrimG", 250), CVar_GetInt("gCCMagicUsePrimB", 0), interfaceCtx->magicAlpha); + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCMagicUsePrimR", 250), CVar_GetS32("gCCMagicUsePrimG", 250), CVar_GetS32("gCCMagicUsePrimB", 0), interfaceCtx->magicAlpha); } else { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 250, 250, 0, interfaceCtx->magicAlpha); } @@ -2697,8 +2696,8 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) { // Fill the rest of the bar with the normal magic color gDPPipeSync(OVERLAY_DISP++); gDPPipeSync(OVERLAY_DISP++); - if (CVar_GetS32("gCustomColors", 0) != 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetInt("gCCMagicPrimR", 0), CVar_GetInt("gCCMagicPrimG", 200), CVar_GetInt("gCCMagicPrimB", 0), interfaceCtx->magicAlpha); + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCMagicPrimR", 0), CVar_GetS32("gCCMagicPrimG", 200), CVar_GetS32("gCCMagicPrimB", 0), interfaceCtx->magicAlpha); } else { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1), R_MAGIC_FILL_COLOR(2), interfaceCtx->magicAlpha); } @@ -2708,8 +2707,8 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) { 0, 0, 1 << 10, 1 << 10); } else { // Fill the whole bar with the normal magic color - if (CVar_GetS32("gCustomColors", 0) != 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetInt("gCCMagicPrimR", 0), CVar_GetInt("gCCMagicPrimG", 200), CVar_GetInt("gCCMagicPrimB", 0), interfaceCtx->magicAlpha); + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCMagicPrimR", 0), CVar_GetS32("gCCMagicPrimG", 200), CVar_GetS32("gCCMagicPrimB", 0), interfaceCtx->magicAlpha); } else { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1), R_MAGIC_FILL_COLOR(2), interfaceCtx->magicAlpha); } @@ -2792,12 +2791,12 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { // Also loads the Item Button Texture reused by other buttons afterwards gDPPipeSync(OVERLAY_DISP++); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - if (CVar_GetS32("gN64Colors", 0) != 0) { + if (CVar_GetS32("gHudColors", 1) == 0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 150, 0, interfaceCtx->bAlpha); - } else if (CVar_GetS32("gGameCubeColors", 0) != 0) { + } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_B_BTN_COLOR(0), R_B_BTN_COLOR(1), R_B_BTN_COLOR(2), interfaceCtx->bAlpha); - } else if (CVar_GetS32("gCustomColors", 0) != 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetInt("gCCBBtnPrimR", 90), CVar_GetInt("gCCBBtnPrimG", 90), CVar_GetInt("gCCBBtnPrimB", 255), interfaceCtx->bAlpha); + } else if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCBBtnPrimR", 90), CVar_GetS32("gCCBBtnPrimG", 90), CVar_GetS32("gCCBBtnPrimB", 255), interfaceCtx->bAlpha); } gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); @@ -2807,12 +2806,12 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { // C-Left Button Color & Texture gDPPipeSync(OVERLAY_DISP++); - if (CVar_GetS32("gN64Colors", 0) != 0) { + if (CVar_GetS32("gHudColors", 1) == 0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha); - } else if (CVar_GetS32("gGameCubeColors", 0) != 0) { + } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha); - } else if (CVar_GetS32("gCustomColors", 0) != 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetInt("gCCCBtnPrimR", 255), CVar_GetInt("gCCCBtnPrimG", 160), CVar_GetInt("gCCCBtnPrimB", 0), interfaceCtx->cLeftAlpha); + } else if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 160), CVar_GetS32("gCCCBtnPrimB", 0), interfaceCtx->cLeftAlpha); } gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(1)) << 2, R_ITEM_BTN_Y(1) << 2, (OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(1)) + R_ITEM_BTN_WIDTH(1)) << 2, @@ -2820,12 +2819,12 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(1) << 1, R_ITEM_BTN_DD(1) << 1); // C-Down Button Color & Texture - if (CVar_GetS32("gN64Colors", 0) != 0) { + if (CVar_GetS32("gHudColors", 1) == 0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cDownAlpha); - } else if (CVar_GetS32("gGameCubeColors", 0) != 0) { + } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cDownAlpha); - } else if (CVar_GetS32("gCustomColors", 0) != 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetInt("gCCCBtnPrimR", 255), CVar_GetInt("gCCCBtnPrimG", 160), CVar_GetInt("gCCCBtnPrimB", 0), interfaceCtx->cDownAlpha); + } else if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 160), CVar_GetS32("gCCCBtnPrimB", 0), interfaceCtx->cDownAlpha); } gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(2)) << 2, R_ITEM_BTN_Y(2) << 2, (OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(2)) + R_ITEM_BTN_WIDTH(2)) << 2, @@ -2833,12 +2832,12 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(2) << 1, R_ITEM_BTN_DD(2) << 1); // C-Right Button Color & Texture - if (CVar_GetS32("gN64Colors", 0) != 0) { + if (CVar_GetS32("gHudColors", 1) == 2) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cRightAlpha); - } else if (CVar_GetS32("gGameCubeColors", 0) != 0) { + } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cRightAlpha); - } else if (CVar_GetS32("gCustomColors", 0) != 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetInt("gCCCBtnPrimR", 255), CVar_GetInt("gCCCBtnPrimG", 160), CVar_GetInt("gCCCBtnPrimB", 0), interfaceCtx->cRightAlpha); + } else if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 160), CVar_GetS32("gCCCBtnPrimB", 0), interfaceCtx->cRightAlpha); } gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(3)) << 2, R_ITEM_BTN_Y(3) << 2, (OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(3)) + R_ITEM_BTN_WIDTH(3)) << 2, @@ -2849,12 +2848,12 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0)) { // Start Button Texture, Color & Label gDPPipeSync(OVERLAY_DISP++); - if (CVar_GetS32("gN64Colors", 0) != 0) { + if (CVar_GetS32("gHudColors", 1) == 0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 0, 0, interfaceCtx->startAlpha); - } else if (CVar_GetS32("gGameCubeColors", 0) != 0) { + } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 120, 120, interfaceCtx->startAlpha); - } else if (CVar_GetS32("gCustomColors", 0) != 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetInt("gCCStartBtnPrimR", 120), CVar_GetInt("gCCStartBtnPrimG", 120), CVar_GetInt("gCCStartBtnPrimB", 120), interfaceCtx->startAlpha); + } else if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCStartBtnPrimR", 120), CVar_GetS32("gCCStartBtnPrimG", 120), CVar_GetS32("gCCStartBtnPrimB", 120), interfaceCtx->startAlpha); } gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(startButtonLeftPos[gSaveContext.language]) << 2, 68, (OTRGetRectDimensionFromRightEdge(startButtonLeftPos[gSaveContext.language]) + 22) << 2, 156, @@ -2897,12 +2896,12 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { const s16 rCUpBtnX = OTRGetRectDimensionFromRightEdge(R_C_UP_BTN_X); const s16 rCUPIconX = OTRGetRectDimensionFromRightEdge(R_C_UP_ICON_X); - if (CVar_GetS32("gN64Colors", 0) != 0) { + if (CVar_GetS32("gHudColors", 1) == 0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), temp); - } else if (CVar_GetS32("gGameCubeColors", 0) != 0) { + } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), temp); - } else if (CVar_GetS32("gCustomColors", 0) != 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetInt("gCCCBtnPrimR", 255), CVar_GetInt("gCCCBtnPrimG", 160), CVar_GetInt("gCCCBtnPrimB", 0), temp); + } else if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 160), CVar_GetS32("gCCCBtnPrimB", 0), temp); } gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gSPWideTextureRectangle(OVERLAY_DISP++, rCUpBtnX << 2, R_C_UP_BTN_Y << 2, (rCUpBtnX + 16) << 2, @@ -3253,8 +3252,8 @@ void Interface_Draw(GlobalContext* globalCtx) { rColor = &rupeeWalletColors[0]; } - if (CVar_GetS32("gCustomColors", 0) != 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetInt("gCCRupeePrimR", rColor[0]), CVar_GetInt("gCCRupeePrimG", rColor[1]), CVar_GetInt("gCCRupeePrimB", rColor[2]), interfaceCtx->magicAlpha); + if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCRupeePrimR", rColor[0]), CVar_GetS32("gCCRupeePrimG", rColor[1]), CVar_GetS32("gCCRupeePrimB", rColor[2]), interfaceCtx->magicAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); //We reset this here so it match user color :) } else { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, rColor[0], rColor[1], rColor[2], interfaceCtx->magicAlpha); @@ -3469,12 +3468,12 @@ void Interface_Draw(GlobalContext* globalCtx) { //func_8008A8B8(globalCtx, R_A_BTN_Y, R_A_BTN_Y + 45, rABtnX, rABtnX + 45); gSPClearGeometryMode(OVERLAY_DISP++, G_CULL_BOTH); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - if (CVar_GetS32("gN64Colors", 0) != 0) { + if (CVar_GetS32("gHudColors", 1) == 0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 90, 90, 255, interfaceCtx->aAlpha); - } else if (CVar_GetS32("gGameCubeColors", 0) != 0) { + } else if (CVar_GetS32("gHudColors", 1) == 1) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_A_BTN_COLOR(0), R_A_BTN_COLOR(1), R_A_BTN_COLOR(2), interfaceCtx->aAlpha); - } else if (CVar_GetS32("gCustomColors", 0) != 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetInt("gCCABtnPrimR", 90), CVar_GetInt("gCCABtnPrimG", 90), CVar_GetInt("gCCABtnPrimB", 255), interfaceCtx->aAlpha); + } else if (CVar_GetS32("gHudColors", 1) == 2) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCABtnPrimR", 90), CVar_GetS32("gCCABtnPrimG", 90), CVar_GetS32("gCCABtnPrimB", 255), interfaceCtx->aAlpha); } if (fullUi) {