mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-18 21:43:48 +01:00
use correct window variable for highlighted scenario
This commit is contained in:
@@ -277,7 +277,7 @@ typedef struct rct_window {
|
|||||||
uint16 ride_colour;
|
uint16 ride_colour;
|
||||||
rct_research_item* research_item;
|
rct_research_item* research_item;
|
||||||
rct_object_entry* object_entry;
|
rct_object_entry* object_entry;
|
||||||
rct_scenario_basic* scenario;
|
scenario_index_entry* highlighted_scenario;
|
||||||
};
|
};
|
||||||
uint8 var_498[0x14];
|
uint8 var_498[0x14];
|
||||||
sint16 selected_tab; // 0x4AC
|
sint16 selected_tab; // 0x4AC
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ void window_scenarioselect_open()
|
|||||||
|
|
||||||
window_init_scroll_widgets(window);
|
window_init_scroll_widgets(window);
|
||||||
window->viewport_focus_coordinates.var_480 = -1;
|
window->viewport_focus_coordinates.var_480 = -1;
|
||||||
window->highlighted_item = 0;
|
window->highlighted_scenario = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -233,7 +233,7 @@ static void window_scenarioselect_mousedown(int widgetIndex, rct_window*w, rct_w
|
|||||||
{
|
{
|
||||||
if (widgetIndex >= WIDX_TAB1 && widgetIndex <= WIDX_TAB8) {
|
if (widgetIndex >= WIDX_TAB1 && widgetIndex <= WIDX_TAB8) {
|
||||||
w->selected_tab = widgetIndex - 4;
|
w->selected_tab = widgetIndex - 4;
|
||||||
w->highlighted_item = 0;
|
w->highlighted_scenario = NULL;
|
||||||
initialise_list_items(w);
|
initialise_list_items(w);
|
||||||
window_invalidate(w);
|
window_invalidate(w);
|
||||||
window_event_resize_call(w);
|
window_event_resize_call(w);
|
||||||
@@ -308,8 +308,8 @@ static void window_scenarioselect_scrollmouseover(rct_window *w, int scrollIndex
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w->highlighted_item != (uint32)selected) {
|
if (w->highlighted_scenario != selected) {
|
||||||
w->highlighted_item = (uint32)selected;
|
w->highlighted_scenario = selected;
|
||||||
window_invalidate(w);
|
window_invalidate(w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -368,9 +368,10 @@ static void window_scenarioselect_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return if no scenario highlighted
|
// Return if no scenario highlighted
|
||||||
scenario = (scenario_index_entry*)w->highlighted_item;
|
scenario = w->highlighted_scenario;
|
||||||
if (scenario == NULL)
|
if (scenario == NULL) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Scenario path
|
// Scenario path
|
||||||
if (gConfigGeneral.debugging_tools) {
|
if (gConfigGeneral.debugging_tools) {
|
||||||
@@ -440,7 +441,7 @@ static void window_scenarioselect_scrollpaint(rct_window *w, rct_drawpixelinfo *
|
|||||||
case LIST_ITEM_TYPE_SCENARIO:;
|
case LIST_ITEM_TYPE_SCENARIO:;
|
||||||
// Draw hover highlight
|
// Draw hover highlight
|
||||||
scenario_index_entry *scenario = listItem->scenario.scenario;
|
scenario_index_entry *scenario = listItem->scenario.scenario;
|
||||||
bool isHighlighted = w->highlighted_item == (uint32)scenario;
|
bool isHighlighted = w->highlighted_scenario == scenario;
|
||||||
if (isHighlighted) {
|
if (isHighlighted) {
|
||||||
gfx_fill_rect(dpi, 0, y, w->width, y + 23, 0x02000031);
|
gfx_fill_rect(dpi, 0, y, w->width, y + 23, 0x02000031);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user