mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 04:53:12 +01:00
New colors almost work
This commit is contained in:
@@ -1473,7 +1473,12 @@ void InputStateWidgetPressed(
|
||||
STR_COLOUR_INVISIBLE_TIP,
|
||||
STR_COLOUR_VOID_TIP,
|
||||
};
|
||||
WindowTooltipShow(OpenRCT2String{ _colourTooltips[COLOUR_UI_ORDER[dropdown_index]], {} }, screenCoords);
|
||||
auto stringId = COLOUR_UI_ORDER[dropdown_index];
|
||||
if (stringId > COLOUR_NUM_ORIGINAL)
|
||||
{
|
||||
stringId -= COLOUR_ID_G2_OFFSET;
|
||||
}
|
||||
WindowTooltipShow(OpenRCT2String{ _colourTooltips[stringId], {} }, screenCoords);
|
||||
}
|
||||
|
||||
if (dropdown_index < Dropdown::ItemsMaxSize && Dropdown::IsDisabled(dropdown_index))
|
||||
|
||||
@@ -37,13 +37,13 @@ static constexpr const uint8_t _appropriateImageDropdownItemsPerRow[34] = {
|
||||
|
||||
// Map of color picker index to true color index
|
||||
static constexpr uint8_t COLOUR_UI_ORDER[] = {
|
||||
0, 3, 47, 6, 50, 45, 11, 37, 39,
|
||||
1, 4, 5, 7, 9, 12, 14, 13, 15,
|
||||
2, 44, 48, 8, 10, 46, 41, 38, 40,
|
||||
29, 27, 35, 42, 23, 52, 21, 19, 32,
|
||||
30, 28, 26, 25, 22, 24, 20, 18, 16,
|
||||
51, 31, 36, 43, 34, 53, 49, 17, 33,
|
||||
54, 55
|
||||
0, 3, 159, 6, 162, 157, 11, 149, 151,
|
||||
1, 4, 5, 7, 9, 12, 14, 13, 15,
|
||||
2, 156, 160, 8, 10, 158, 153, 150, 152,
|
||||
29, 27, 147, 154, 23, 164, 21, 19, 144,
|
||||
30, 28, 26, 25, 22, 24, 20, 18, 16,
|
||||
163, 31, 148, 155, 146, 165, 161, 17, 145,
|
||||
166, 167
|
||||
};
|
||||
|
||||
|
||||
@@ -466,12 +466,15 @@ void WindowDropdownShowColour(WindowBase* w, Widget* widget, uint8_t dropdownCol
|
||||
// Set items
|
||||
for (uint64_t i = 0; i < numColours; i++)
|
||||
{
|
||||
if (selectedColour == COLOUR_UI_ORDER[i])
|
||||
defaultIndex = selectedColour;
|
||||
auto orderedColour = COLOUR_UI_ORDER[i];
|
||||
if (selectedColour == orderedColour)
|
||||
defaultIndex = orderedColour;
|
||||
|
||||
// Use special graphic for Invisible color
|
||||
auto imageId = (i == COLOUR_INVISIBLE) ? ImageId(SPR_G2_ICON_PALETTE_INVISIBLE, COLOUR_BORDEAUX_RED)
|
||||
: ImageId(SPR_PALETTE_BTN, COLOUR_UI_ORDER[i]);
|
||||
// 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);
|
||||
|
||||
gDropdownItems[i].Format = Dropdown::FormatColourPicker;
|
||||
gDropdownItems[i].Args = (i << 32) | imageId.ToUInt32();
|
||||
|
||||
@@ -296,30 +296,33 @@ enum class FilterPaletteID : int32_t
|
||||
PaletteGlassDarkPink = PaletteGlass + COLOUR_DARK_PINK,
|
||||
PaletteGlassBrightPink = PaletteGlass + COLOUR_BRIGHT_PINK,
|
||||
PaletteGlassLightPink = PaletteGlass + COLOUR_LIGHT_PINK,
|
||||
PaletteGlassDarkOliveDark = PaletteGlass + COLOUR_DARK_OLIVE_DARK,
|
||||
PaletteGlassDarkOliveLight = PaletteGlass + COLOUR_DARK_OLIVE_LIGHT,
|
||||
PaletteGlassSaturatedBrownLight = PaletteGlass + COLOUR_SATURATED_BROWN_LIGHT,
|
||||
PaletteGlassBordeauxRedDark = PaletteGlass + COLOUR_BORDEAUX_RED_DARK,
|
||||
PaletteGlassBordeauxRedLight = PaletteGlass + COLOUR_BORDEAUX_RED_LIGHT,
|
||||
PaletteGlassGrassGreenDark = PaletteGlass + COLOUR_GRASS_GREEN_DARK,
|
||||
PaletteGlassGrassGreenLight = PaletteGlass + COLOUR_GRASS_GREEN_LIGHT,
|
||||
PaletteGlassOliveDark = PaletteGlass + COLOUR_OLIVE_DARK,
|
||||
PaletteGlassOliveLight = PaletteGlass + COLOUR_OLIVE_LIGHT,
|
||||
PaletteGlassSaturatedGreenLight = PaletteGlass + COLOUR_SATURATED_GREEN_LIGHT,
|
||||
PaletteGlassTanDark = PaletteGlass + COLOUR_TAN_DARK,
|
||||
PaletteGlassTanLight = PaletteGlass + COLOUR_TAN_LIGHT,
|
||||
PaletteGlassDullPurpleLight = PaletteGlass + COLOUR_DULL_PURPLE_LIGHT,
|
||||
PaletteGlassDullGreenDark = PaletteGlass + COLOUR_DULL_GREEN_DARK,
|
||||
PaletteGlassDullGreenLight = PaletteGlass + COLOUR_DULL_GREEN_LIGHT,
|
||||
PaletteGlassSaturatedPurpleDark = PaletteGlass + COLOUR_SATURATED_PURPLE_DARK,
|
||||
PaletteGlassSaturatedPurpleLight = PaletteGlass + COLOUR_SATURATED_PURPLE_LIGHT,
|
||||
PaletteGlassOrangeLight = PaletteGlass + COLOUR_ORANGE_LIGHT,
|
||||
PaletteGlassAquaDark = PaletteGlass + COLOUR_AQUA_DARK,
|
||||
PaletteGlassMagentaLight = PaletteGlass + COLOUR_MAGENTA_LIGHT,
|
||||
PaletteGlassDullBrownDark = PaletteGlass + COLOUR_DULL_BROWN_DARK,
|
||||
PaletteGlassDullBrownLight = PaletteGlass + COLOUR_DULL_BROWN_LIGHT,
|
||||
PaletteGlassInvisible = PaletteGlass + COLOUR_INVISIBLE,
|
||||
PaletteGlassVoid = PaletteGlass + COLOUR_VOID,
|
||||
PaletteG2 = 144,
|
||||
PaletteG2Invisible = 166,
|
||||
PaletteGlassG2 = 168,
|
||||
PaletteGlassDarkOliveDark = PaletteGlassG2,
|
||||
PaletteGlassDarkOliveLight,
|
||||
PaletteGlassSaturatedBrownLight,
|
||||
PaletteGlassBordeauxRedDark,
|
||||
PaletteGlassBordeauxRedLight,
|
||||
PaletteGlassGrassGreenDark,
|
||||
PaletteGlassGrassGreenLight,
|
||||
PaletteGlassOliveDark,
|
||||
PaletteGlassOliveLight,
|
||||
PaletteGlassSaturatedGreenLight,
|
||||
PaletteGlassTanDark,
|
||||
PaletteGlassTanLight,
|
||||
PaletteGlassDullPurpleLight,
|
||||
PaletteGlassDullGreenDark,
|
||||
PaletteGlassDullGreenLight,
|
||||
PaletteGlassSaturatedPurpleDark,
|
||||
PaletteGlassSaturatedPurpleLight,
|
||||
PaletteGlassOrangeLight,
|
||||
PaletteGlassAquaDark,
|
||||
PaletteGlassMagentaLight,
|
||||
PaletteGlassDullBrownDark,
|
||||
PaletteGlassDullBrownLight,
|
||||
PaletteGlassInvisible,
|
||||
PaletteGlassVoid,
|
||||
};
|
||||
|
||||
struct TranslucentWindowPalette
|
||||
|
||||
@@ -40,7 +40,7 @@ void ColoursInitMaps()
|
||||
for (int32_t i = 0; i < COLOUR_COUNT; i++)
|
||||
{
|
||||
// Get palette index in g1 / g2
|
||||
auto paletteIndex = (i < COLOUR_NUM_ORIGINAL) ? SPR_PALETTE_2_START : SPR_G2_PALETTE_BEGIN - (COLOUR_NUM_ORIGINAL - 1);
|
||||
auto paletteIndex = (i < COLOUR_NUM_ORIGINAL) ? SPR_PALETTE_2_START : SPR_G2_PALETTE_BEGIN - COLOUR_NUM_ORIGINAL;
|
||||
const G1Element* g1 = GfxGetG1Element(paletteIndex + i);
|
||||
if (g1 != nullptr)
|
||||
{
|
||||
|
||||
@@ -205,6 +205,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;
|
||||
|
||||
#define TEXT_COLOUR_254 (254)
|
||||
#define TEXT_COLOUR_255 (255)
|
||||
|
||||
@@ -1365,8 +1365,8 @@ enum
|
||||
SPR_G2_ALPINE_END = SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 12,
|
||||
|
||||
SPR_G2_ICON_PALETTE_INVISIBLE,
|
||||
SPR_G2_PALETTE_BEGIN = SPR_G2_ICON_PALETTE_INVISIBLE,
|
||||
SPR_G2_PAL_REMAP_DARK_OLIVE_DARK,
|
||||
SPR_G2_PALETTE_BEGIN,
|
||||
SPR_G2_PAL_REMAP_DARK_OLIVE_DARK = SPR_G2_PALETTE_BEGIN,
|
||||
SPR_G2_PAL_REMAP_DARK_OLIVE_LIGHT,
|
||||
SPR_G2_PAL_REMAP_SATURATED_BROWN_LIGHT,
|
||||
SPR_G2_PAL_REMAP_BORDEAUX_RED_DARK,
|
||||
|
||||
Reference in New Issue
Block a user