1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 04:23:20 +01:00

Invisible color sprite displays properly

This commit is contained in:
Trevor Finney
2023-02-20 19:27:47 -05:00
parent 3f26392bf5
commit 312a1590ab
9 changed files with 16 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

View File

@@ -20591,6 +20591,9 @@
},
{
"path": "icons/colour_invisible.png"
},
{
"path": "icons/colour_invisible_pressed.png"
},
{
"path": "palette_map/palette_map_dark_olive_dark.png"

View File

@@ -1186,5 +1186,12 @@ static void WidgetTextBoxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wid
ImageId GetColourButtonImage(colour_t colour)
{
return ImageId(SPR_PALETTE_BTN, colour).WithBlended(true);
if (colour == COLOUR_OFFSET_INVISIBLE)
{
return ImageId(SPR_G2_ICON_PALETTE_INVISIBLE - 1, colour).WithBlended(false);
}
else
{
return ImageId(SPR_PALETTE_BTN, colour).WithBlended(true);
}
}

View File

@@ -473,8 +473,7 @@ void WindowDropdownShowColour(WindowBase* w, Widget* widget, uint8_t dropdownCol
// Get palette offset for G2 colours
// Use special graphic for Invisible colour
//auto imageId = (orderedColour == FilterPaletteID::PaletteG2Invisible) ? ImageId(SPR_G2_ICON_PALETTE_INVISIBLE, COLOUR_BORDEAUX_RED)
auto imageId = ImageId(SPR_PALETTE_BTN, orderedColour);
auto imageId = (orderedColour == COLOUR_OFFSET_INVISIBLE) ? ImageId(SPR_G2_ICON_PALETTE_INVISIBLE - 1, COLOUR_WHITE) : ImageId(SPR_PALETTE_BTN, orderedColour);
gDropdownItems[i].Format = Dropdown::FormatColourPicker;
gDropdownItems[i].Args = (i << 32) | imageId.ToUInt32();

View File

@@ -295,8 +295,7 @@ enum
SPR_PALETTE_GLASS_LIGHT_PINK = 5047,
// Start of G2 Palettes
// For some reason these only load correctly if this is set to the G2 index ONE PRIOR to actual index
SPR_PALETTE_DARK_OLIVE_DARK = SPR_G2_ICON_PALETTE_INVISIBLE,
SPR_PALETTE_DARK_OLIVE_DARK = SPR_G2_PALETTE_BEGIN - 1,
SPR_PALETTE_DARK_OLIVE_LIGHT,
SPR_PALETTE_SATURATED_BROWN_LIGHT,
SPR_PALETTE_BORDEAUX_RED_DARK,

View File

@@ -42,6 +42,7 @@ void ColoursInitMaps()
// Get palette index in g1 / g2
auto paletteIndex = (i < COLOUR_NUM_ORIGINAL) ? SPR_PALETTE_2_START : SPR_G2_PALETTE_BEGIN - COLOUR_NUM_ORIGINAL;
const G1Element* g1 = GfxGetG1Element(paletteIndex + i);
//TODO: Integrate themes with G2 palettes
if (g1 != nullptr)
{
ColourMapA[i].colour_0 = g1->offset[INDEX_COLOUR_0];

View File

@@ -206,6 +206,7 @@ constexpr uint8_t PALETTE_LENGTH_ANIMATED = 16;
constexpr uint8_t COLOUR_NUM_ORIGINAL = 32;
constexpr uint8_t COLOUR_NUM_NORMAL = 54;
constexpr uint8_t COLOUR_ID_G2_OFFSET = 112;
constexpr uint8_t COLOUR_OFFSET_INVISIBLE = 166;
#define TEXT_COLOUR_254 (254)
#define TEXT_COLOUR_255 (255)

View File

@@ -1365,6 +1365,7 @@ enum
SPR_G2_ALPINE_END = SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 12,
SPR_G2_ICON_PALETTE_INVISIBLE,
SPR_G2_ICON_PALETTE_INVISIBLE_PRESSED,
SPR_G2_PALETTE_BEGIN,
SPR_G2_PAL_REMAP_DARK_OLIVE_DARK = SPR_G2_PALETTE_BEGIN,
SPR_G2_PAL_REMAP_DARK_OLIVE_LIGHT,