1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 09:14:58 +01:00

#9285 Add feature to remember scernario tab

This commit is contained in:
Spongeloaf
2019-06-21 12:54:49 -04:00
parent 6bd298b3a3
commit 5777074a3e
4 changed files with 17 additions and 3 deletions

View File

@@ -226,10 +226,17 @@ static void window_scenarioselect_init_tabs(rct_window* w)
}
}
int32_t firstPage = bitscanforward(showPages);
if (firstPage != -1)
if (showPages & 1 << gConfigInterface.scenarioselect_last_tab)
{
w->selected_tab = firstPage;
w->selected_tab = gConfigInterface.scenarioselect_last_tab;
}
else
{
int32_t firstPage = bitscanforward(showPages);
if (firstPage != -1)
{
w->selected_tab = firstPage;
}
}
int32_t x = 3;
@@ -269,6 +276,8 @@ static void window_scenarioselect_mousedown(rct_window* w, rct_widgetindex widge
{
w->selected_tab = widgetIndex - 4;
w->highlighted_scenario = nullptr;
gConfigInterface.scenarioselect_last_tab = w->selected_tab;
config_save_default();
initialise_list_items(w);
window_invalidate(w);
window_event_resize_call(w);