Cosmetics Editor fixes for icons in z_message_PAL.c (#3914)

* Fix resetting button icon colours in message boxes.

* Fix type/math error for custom color in textbox icon pulsing.

* Fix type error for custom color in ocarina icon pulsing.

* Make custom env colour math more closely match vanilla equivalents.

* Make comments presentable.
This commit is contained in:
Tina H. (sheepytina) 2024-02-16 12:49:13 +11:00 committed by GitHub
parent eeb6c7faaa
commit 7ccc816772
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -453,19 +453,20 @@ void Message_SetTextColor(MessageContext* msgCtx, u16 colorParameter) {
}
void Message_DrawTextboxIcon(PlayState* play, Gfx** p, s16 x, s16 y) {
static Color_RGB8 sIconPrimColors[2] = {
// SoH [Cosmetics] The following Color_RGB8 were originally static
Color_RGB8 sIconPrimColors[2] = {
{ 0, 80, 200 },
{ 50, 130, 255 },
};
static Color_RGB8 sIconEnvColors[2] = {
Color_RGB8 sIconEnvColors[2] = {
{ 0, 0, 0 },
{ 0, 130, 255 },
};
if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) {
Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_AButton.Value", (Color_RGB8){ 50, 130, 255 });
sIconPrimColors[0].r = (color.r / 255) * 95;
sIconPrimColors[0].g = (color.g / 255) * 95;
sIconPrimColors[0].b = (color.b / 255) * 95;
sIconPrimColors[0].r = color.r - 50;
sIconPrimColors[0].g = color.g - 50;
sIconPrimColors[0].b = color.b - 50;
sIconPrimColors[1] = color;
sIconEnvColors[1] = color;
} else if (CVarGetInteger("gCosmetics.DefaultColorScheme", COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) {
@ -2006,19 +2007,21 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
static void* sOcarinaNoteTextures[] = {
gOcarinaBtnIconATex, gOcarinaBtnIconCDownTex, gOcarinaBtnIconCRightTex, gOcarinaBtnIconCLeftTex, gOcarinaBtnIconCUpTex,
};
static Color_RGB8 sOcarinaNoteAPrimColors[2] = {
// SoH [Cosmetics] The following Color_RGB8 were originally static
Color_RGB8 sOcarinaNoteAPrimColors[2] = {
{ 80, 150, 255 },
{ 100, 200, 255 },
};
static Color_RGB8 sOcarinaNoteAEnvColors[2] = {
Color_RGB8 sOcarinaNoteAEnvColors[2] = {
{ 10, 10, 10 },
{ 50, 50, 255 },
};
if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) {
Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_AButton.Value", (Color_RGB8){ 100, 200, 255 });
sOcarinaNoteAPrimColors[0].r = (color.r / 255) * 95;
sOcarinaNoteAPrimColors[0].g = (color.g / 255) * 95;
sOcarinaNoteAPrimColors[0].b = (color.b / 255) * 95;
sOcarinaNoteAPrimColors[0].r = (color.r / 255.0f) * 95;
sOcarinaNoteAPrimColors[0].g = (color.g / 255.0f) * 95;
sOcarinaNoteAPrimColors[0].b = (color.b / 255.0f) * 95;
sOcarinaNoteAPrimColors[1] = color;
sOcarinaNoteAEnvColors[1] = color;
} else if (CVarGetInteger("gCosmetics.DefaultColorScheme", COLORSCHEME_N64) == COLORSCHEME_GAMECUBE) {
@ -2027,11 +2030,11 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
sOcarinaNoteAEnvColors[1] = (Color_RGB8){ 50, 255, 50 };
}
static Color_RGB8 sOcarinaNoteCPrimColors[2] = {
Color_RGB8 sOcarinaNoteCPrimColors[2] = {
{ 255, 255, 50 },
{ 255, 255, 180 },
};
static Color_RGB8 sOcarinaNoteCEnvColors[2] = {
Color_RGB8 sOcarinaNoteCEnvColors[2] = {
{ 10, 10, 10 },
{ 110, 110, 50 },
};
@ -2039,16 +2042,16 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CButtons.Value", (Color_RGB8){ 100, 200, 255 });
sOcarinaNoteCPrimColors[0] = color;
sOcarinaNoteCPrimColors[1] = color;
sOcarinaNoteCEnvColors[1].r = (color.r / 255) * 95;
sOcarinaNoteCEnvColors[1].g = (color.g / 255) * 95;
sOcarinaNoteCEnvColors[1].b = (color.b / 255) * 95;
sOcarinaNoteCEnvColors[1].r = (color.r / 255.0f) * 95;
sOcarinaNoteCEnvColors[1].g = (color.g / 255.0f) * 95;
sOcarinaNoteCEnvColors[1].b = (color.b / 255.0f) * 95;
}
static Color_RGB8 sOcarinaNoteCUpPrimColors[2] = {
Color_RGB8 sOcarinaNoteCUpPrimColors[2] = {
{ 255, 255, 50 },
{ 255, 255, 180 },
};
static Color_RGB8 sOcarinaNoteCUpEnvColors[2] = {
Color_RGB8 sOcarinaNoteCUpEnvColors[2] = {
{ 10, 10, 10 },
{ 110, 110, 50 },
};
@ -2056,16 +2059,16 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CUpButton.Value", (Color_RGB8){ 100, 200, 255 });
sOcarinaNoteCUpPrimColors[0] = color;
sOcarinaNoteCUpPrimColors[1] = color;
sOcarinaNoteCUpEnvColors[1].r = (color.r / 255) * 95;
sOcarinaNoteCUpEnvColors[1].g = (color.g / 255) * 95;
sOcarinaNoteCUpEnvColors[1].b = (color.b / 255) * 95;
sOcarinaNoteCUpEnvColors[1].r = (color.r / 255.0f) * 95;
sOcarinaNoteCUpEnvColors[1].g = (color.g / 255.0f) * 95;
sOcarinaNoteCUpEnvColors[1].b = (color.b / 255.0f) * 95;
}
static Color_RGB8 sOcarinaNoteCDownPrimColors[2] = {
Color_RGB8 sOcarinaNoteCDownPrimColors[2] = {
{ 255, 255, 50 },
{ 255, 255, 180 },
};
static Color_RGB8 sOcarinaNoteCDownEnvColors[2] = {
Color_RGB8 sOcarinaNoteCDownEnvColors[2] = {
{ 10, 10, 10 },
{ 110, 110, 50 },
};
@ -2073,16 +2076,16 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CDownButton.Value", (Color_RGB8){ 100, 200, 255 });
sOcarinaNoteCDownPrimColors[0] = color;
sOcarinaNoteCDownPrimColors[1] = color;
sOcarinaNoteCDownEnvColors[1].r = (color.r / 255) * 95;
sOcarinaNoteCDownEnvColors[1].g = (color.g / 255) * 95;
sOcarinaNoteCDownEnvColors[1].b = (color.b / 255) * 95;
sOcarinaNoteCDownEnvColors[1].r = (color.r / 255.0f) * 95;
sOcarinaNoteCDownEnvColors[1].g = (color.g / 255.0f) * 95;
sOcarinaNoteCDownEnvColors[1].b = (color.b / 255.0f) * 95;
}
static Color_RGB8 sOcarinaNoteCLeftPrimColors[2] = {
Color_RGB8 sOcarinaNoteCLeftPrimColors[2] = {
{ 255, 255, 50 },
{ 255, 255, 180 },
};
static Color_RGB8 sOcarinaNoteCLeftEnvColors[2] = {
Color_RGB8 sOcarinaNoteCLeftEnvColors[2] = {
{ 10, 10, 10 },
{ 110, 110, 50 },
};
@ -2090,16 +2093,16 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CLeftButton.Value", (Color_RGB8){ 100, 200, 255 });
sOcarinaNoteCLeftPrimColors[0] = color;
sOcarinaNoteCLeftPrimColors[1] = color;
sOcarinaNoteCLeftEnvColors[1].r = (color.r / 255) * 95;
sOcarinaNoteCLeftEnvColors[1].g = (color.g / 255) * 95;
sOcarinaNoteCLeftEnvColors[1].b = (color.b / 255) * 95;
sOcarinaNoteCLeftEnvColors[1].r = (color.r / 255.0f) * 95;
sOcarinaNoteCLeftEnvColors[1].g = (color.g / 255.0f) * 95;
sOcarinaNoteCLeftEnvColors[1].b = (color.b / 255.0f) * 95;
}
static Color_RGB8 sOcarinaNoteCRightPrimColors[2] = {
Color_RGB8 sOcarinaNoteCRightPrimColors[2] = {
{ 255, 255, 50 },
{ 255, 255, 180 },
};
static Color_RGB8 sOcarinaNoteCRightEnvColors[2] = {
Color_RGB8 sOcarinaNoteCRightEnvColors[2] = {
{ 10, 10, 10 },
{ 110, 110, 50 },
};
@ -2107,9 +2110,9 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CRightButton.Value", (Color_RGB8){ 100, 200, 255 });
sOcarinaNoteCRightPrimColors[0] = color;
sOcarinaNoteCRightPrimColors[1] = color;
sOcarinaNoteCRightEnvColors[1].r = (color.r / 255) * 95;
sOcarinaNoteCRightEnvColors[1].g = (color.g / 255) * 95;
sOcarinaNoteCRightEnvColors[1].b = (color.b / 255) * 95;
sOcarinaNoteCRightEnvColors[1].r = (color.r / 255.0f) * 95;
sOcarinaNoteCRightEnvColors[1].g = (color.g / 255.0f) * 95;
sOcarinaNoteCRightEnvColors[1].b = (color.b / 255.0f) * 95;
}
static s16 sOcarinaNoteFlashTimer = 12;