diff options
| author | Pepe20129 <72659707+Pepe20129@users.noreply.github.com> | 2024-11-26 23:48:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-26 15:48:58 -0700 |
| commit | 7ccb3ac7c3be86c03202d8da9d28bcf4830f8473 (patch) | |
| tree | ad23a2c65a0d350696b172d2e71320464a09840a /soh/src/code | |
| parent | d0f7d30c163ca56229c0c469b5a7fa005d97e0e6 (diff) | |
Cosmetics Changes (#4275)
* Clean CosmeticsEditor.h
* Add CosmeticsEditor_GetDefaultValue
* Add message text cosmetics
* Format cleanup
* Remove dependency on 3drando random functions
* Fix rainbow for every cosmetic
* Add "Rainbow All" & "Un-Rainbow All"
* Add HookshotChain cosmetic
* Add Nayru's cosmetics
* Add Farore's cosmetics
* Add Din's cosmetics
* Add Title card cosmetics
* Update CosmeticsEditor.cpp
* Add Copyright text cosmetic
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_actor.c | 35 | ||||
| -rw-r--r-- | soh/src/code/z_message_PAL.c | 78 | ||||
| -rw-r--r-- | soh/src/code/z_parameter.c | 7 |
3 files changed, 106 insertions, 14 deletions
diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index a9f5aeab0..8ceca43f2 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -1081,14 +1081,11 @@ void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void* } void TitleCard_Update(PlayState* play, TitleCardContext* titleCtx) { - const Color_RGB8 TitleCard_Colors_ori = {255,255,255}; - Color_RGB8 TitleCard_Colors = {255,255,255}; - if (titleCtx->isBossCard && CVarGetInteger(CVAR_COSMETIC("HUD.TitleCard.Boss.Changed"), 1) == 2) { - TitleCard_Colors = CVarGetColor24(CVAR_COSMETIC("HUD.TitleCard.Boss.Value"), TitleCard_Colors_ori); - } else if (!titleCtx->isBossCard && CVarGetInteger(CVAR_COSMETIC("HUD.TitleCard.Map.Changed"), 1) == 2) { - TitleCard_Colors = CVarGetColor24(CVAR_COSMETIC("HUD.TitleCard.Map.Value"), TitleCard_Colors_ori); - } else { - TitleCard_Colors = TitleCard_Colors_ori; + Color_RGB8 TitleCard_Colors = { 255, 255, 255 }; + if (titleCtx->isBossCard && CVarGetInteger(CVAR_COSMETIC("HUD.TitleCard.Boss.Changed"), 0) == 1) { + TitleCard_Colors = CVarGetColor24(CVAR_COSMETIC("HUD.TitleCard.Boss.Value"), TitleCard_Colors); + } else if (!titleCtx->isBossCard && CVarGetInteger(CVAR_COSMETIC("HUD.TitleCard.Map.Changed"), 0) == 1) { + TitleCard_Colors = CVarGetColor24(CVAR_COSMETIC("HUD.TitleCard.Map.Value"), TitleCard_Colors); } if (DECR(titleCtx->delayTimer) == 0) { @@ -2345,8 +2342,14 @@ void Actor_DrawFaroresWindPointer(PlayState* play) { } else if (D_8015BC18 > 0.0f) { static Vec3f effectVel = { 0.0f, -0.05f, 0.0f }; static Vec3f effectAccel = { 0.0f, -0.025f, 0.0f }; - static Color_RGBA8 effectPrimCol = { 255, 255, 255, 0 }; - static Color_RGBA8 effectEnvCol = { 100, 200, 0, 0 }; + Color_RGBA8 effectPrimCol = { 255, 255, 255, 0 }; + Color_RGBA8 effectEnvCol = { 100, 200, 0, 0 }; + if (CVarGetInteger(CVAR_COSMETIC("Magic.FaroresSecondary.Changed"), 0)) { + effectEnvCol = CVarGetColor(CVAR_COSMETIC("Magic.FaroresSecondary.Value"), effectEnvCol); + } + if (CVarGetInteger(CVAR_COSMETIC("Magic.FaroresPrimary.Changed"), 0)) { + effectPrimCol = CVarGetColor(CVAR_COSMETIC("Magic.FaroresPrimary.Value"), effectPrimCol); + } Vec3f* curPos = &gSaveContext.respawn[RESPAWN_MODE_TOP].pos; Vec3f* nextPos = &gSaveContext.respawn[RESPAWN_MODE_DOWN].pos; f32 prevNum = D_8015BC18; @@ -2441,8 +2444,16 @@ void Actor_DrawFaroresWindPointer(PlayState* play) { Matrix_Push(); gDPPipeSync(POLY_XLU_DISP++); - gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, 255, 255, 200, alpha); - gDPSetEnvColor(POLY_XLU_DISP++, 100, 200, 0, 255); + Color_RGB8 Spell_env = { 100, 200, 0 }; + Color_RGB8 Spell_col = { 255, 255, 200 }; + if (CVarGetInteger(CVAR_COSMETIC("Magic.FaroresSecondary.Changed"), 0)) { + Spell_env = CVarGetColor24(CVAR_COSMETIC("Magic.FaroresSecondary.Value"), Spell_env); + } + if (CVarGetInteger(CVAR_COSMETIC("Magic.FaroresPrimary.Changed"), 0)) { + Spell_col = CVarGetColor24(CVAR_COSMETIC("Magic.FaroresPrimary.Value"), Spell_col); + } + gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, Spell_col.r, Spell_col.g, Spell_col.b, alpha); + gDPSetEnvColor(POLY_XLU_DISP++, Spell_env.r, Spell_env.g, Spell_env.b, 255); Matrix_RotateZ(((play->gameplayFrames * 1500) & 0xFFFF) * M_PI / 32768.0f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 08be75112..e6b944a73 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/CosmeticsEditor.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" @@ -367,6 +368,80 @@ void Message_FindCreditsMessage(PlayState* play, u16 textId) { } } +#pragma region [SoH] Cosmetics + +#define MESSAGE_COSMETICS_HANDLE_COLOR(id) \ + if (CVarGetInteger(CVAR_COSMETIC("Message." id ".Changed"), 0)) { \ + Color_RGBA8 color = CVarGetColor(CVAR_COSMETIC("Message." id ".Value"), CosmeticsEditor_GetDefaultValue("Message." id)); \ + msgCtx->textColorR = color.r; \ + msgCtx->textColorG = color.g; \ + msgCtx->textColorB = color.b; \ + } + +void Cosmetics_MaybeSetTextColor(MessageContext* msgCtx, u16 colorParameter) { + switch (colorParameter) { + case MSGCOL_RED: + if (msgCtx->textBoxType == TEXTBOX_TYPE_WOODEN) { + MESSAGE_COSMETICS_HANDLE_COLOR("Red.Wooden") + } else { + MESSAGE_COSMETICS_HANDLE_COLOR("Red.Normal") + } + break; + case MSGCOL_ADJUSTABLE: + if (msgCtx->textBoxType == TEXTBOX_TYPE_WOODEN) { + MESSAGE_COSMETICS_HANDLE_COLOR("Adjustable.Wooden") + } else { + MESSAGE_COSMETICS_HANDLE_COLOR("Adjustable.Normal") + } + break; + case MSGCOL_BLUE: + if (msgCtx->textBoxType == TEXTBOX_TYPE_WOODEN) { + MESSAGE_COSMETICS_HANDLE_COLOR("Blue.Wooden") + } else { + MESSAGE_COSMETICS_HANDLE_COLOR("Blue.Normal") + } + break; + case MSGCOL_LIGHTBLUE: + if (msgCtx->textBoxType == TEXTBOX_TYPE_WOODEN) { + MESSAGE_COSMETICS_HANDLE_COLOR("LightBlue.Wooden") + } else if (msgCtx->textBoxType == TEXTBOX_TYPE_NONE_NO_SHADOW) { + MESSAGE_COSMETICS_HANDLE_COLOR("LightBlue.NoneNoShadow") + } else { + MESSAGE_COSMETICS_HANDLE_COLOR("LightBlue.Normal") + } + break; + case MSGCOL_PURPLE: + if (msgCtx->textBoxType == TEXTBOX_TYPE_WOODEN) { + MESSAGE_COSMETICS_HANDLE_COLOR("Purple.Wooden") + } else { + MESSAGE_COSMETICS_HANDLE_COLOR("Purple.Normal") + } + break; + case MSGCOL_YELLOW: + if (msgCtx->textBoxType == TEXTBOX_TYPE_WOODEN) { + MESSAGE_COSMETICS_HANDLE_COLOR("Yellow.Wooden") + } else { + MESSAGE_COSMETICS_HANDLE_COLOR("Yellow.Normal") + } + break; + case MSGCOL_BLACK: + MESSAGE_COSMETICS_HANDLE_COLOR("Black") + break; + case MSGCOL_DEFAULT: + default: + if (msgCtx->textBoxType == TEXTBOX_TYPE_NONE_NO_SHADOW) { + MESSAGE_COSMETICS_HANDLE_COLOR("Default.NoneNoShadow") + } else { + MESSAGE_COSMETICS_HANDLE_COLOR("Default.Normal") + } + break; + } +} + +#undef MESSAGE_COSMETICS_HANDLE_COLOR + +#pragma endregion + void Message_SetTextColor(MessageContext* msgCtx, u16 colorParameter) { switch (colorParameter) { case MSGCOL_RED: @@ -451,6 +526,7 @@ void Message_SetTextColor(MessageContext* msgCtx, u16 colorParameter) { } break; } + Cosmetics_MaybeSetTextColor(msgCtx, colorParameter); } void Message_DrawTextboxIcon(PlayState* play, Gfx** p, s16 x, s16 y) { @@ -853,6 +929,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { msgCtx->textColorR = msgCtx->textColorG = msgCtx->textColorB = 255; } + Cosmetics_MaybeSetTextColor(msgCtx, MSGCOL_DEFAULT); + msgCtx->unk_E3D0 = 0; charTexIdx = 0; diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 2c180c584..0792e71cf 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -3388,6 +3388,9 @@ void Interface_UpdateMagicBar(PlayState* play) { default: gSaveContext.magicState = MAGIC_STATE_IDLE; + if (CVarGetInteger(CVAR_COSMETIC("Consumable.MagicBorder.Changed"), 0)) { + sMagicBorder = CVarGetColor24(CVAR_COSMETIC("Consumable.MagicBorder.Value"), sMagicBorder_ori); + } break; } } @@ -3617,8 +3620,8 @@ void Interface_DrawEnemyHealthBar(TargetContext* targetCtx, PlayState* play) { s32 healthbar_offsetY = CVarGetInteger(CVAR_COSMETIC("HUD.EnemyHealthBar.PosY"), 0); s8 anchorType = CVarGetInteger(CVAR_COSMETIC("HUD.EnemyHealthBar.PosType"), ENEMYHEALTH_ANCHOR_ACTOR); - if (CVarGetInteger(CVAR_COSMETIC("HUD.EnemyHealthBar..Changed"), 0)) { - healthbar_red = CVarGetColor(CVAR_COSMETIC("HUD.EnemyHealthBar..Value"), healthbar_red); + if (CVarGetInteger(CVAR_COSMETIC("HUD.EnemyHealthBar.Changed"), 0)) { + healthbar_red = CVarGetColor(CVAR_COSMETIC("HUD.EnemyHealthBar.Value"), healthbar_red); } if (CVarGetInteger(CVAR_COSMETIC("HUD.EnemyHealthBorder.Changed"), 0)) { healthbar_border = CVarGetColor(CVAR_COSMETIC("HUD.EnemyHealthBorder.Value"), healthbar_border); |
