mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #1854. Special track elements disable correctly.
Issue was caused by a change I asked to be done a month back. Dropdowns are awkward windows the global array for dropdown content should be populated before creating them but not anything else as that will get reset. In this case the disabled items were reset. The same happens for highlighted index if that is specified before window creation
This commit is contained in:
parent
9e1e0748f3
commit
eaa44ab1e1
|
@ -179,7 +179,7 @@ void window_dropdown_show_text_custom_width(int x, int y, int extray, uint8 colo
|
|||
|
||||
// Input state
|
||||
_dropdown_highlighted_index = -1;
|
||||
RCT2_GLOBAL(0x009DED34, sint32) = 0;
|
||||
*gDropdownItemsDisabled = 0;
|
||||
gDropdownItemsChecked = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_STATE, sint8) = INPUT_STATE_DROPDOWN_ACTIVE;
|
||||
|
||||
|
@ -258,7 +258,7 @@ void window_dropdown_show_image(int x, int y, int extray, uint8 colour, uint8 fl
|
|||
|
||||
// Input state
|
||||
_dropdown_highlighted_index = -1;
|
||||
RCT2_GLOBAL(0x009DED34, sint32) = 0;
|
||||
*gDropdownItemsDisabled = 0;
|
||||
gDropdownItemsChecked = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_STATE, sint8) = INPUT_STATE_DROPDOWN_ACTIVE;
|
||||
|
||||
|
@ -337,7 +337,7 @@ static void window_dropdown_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||
colour = w->colours[0] & 0x7F;
|
||||
if (i == _dropdown_highlighted_index)
|
||||
colour = 2;
|
||||
if (RCT2_GLOBAL(0x009DED34, uint32) & (1 << i))
|
||||
if (*gDropdownItemsDisabled & (1 << i))
|
||||
if (i < 32)
|
||||
colour = (w->colours[0] & 0x7F) | 0x40;
|
||||
|
||||
|
|
|
@ -3164,7 +3164,6 @@ static void window_ride_construction_show_special_track_dropdown(rct_window *w,
|
|||
RCT2_GLOBAL(0x009DEBA2, sint16) = i;
|
||||
}
|
||||
}
|
||||
*gDropdownItemsDisabled = RCT2_GLOBAL(0x00F4409C, uint32);
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
|
@ -3175,6 +3174,8 @@ static void window_ride_construction_show_special_track_dropdown(rct_window *w,
|
|||
_numCurrentPossibleRideConfigurations,
|
||||
widget->right - widget->left
|
||||
);
|
||||
|
||||
*gDropdownItemsDisabled = RCT2_GLOBAL(0x00F4409C, uint32);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue