From 187499fd7233cf0abcefac3825c6da5c66eba60c Mon Sep 17 00:00:00 2001 From: Daniel Trujillo Date: Thu, 23 Jun 2016 22:52:10 +0200 Subject: [PATCH] Fix currency dropdown not showing checked custom currency. Due to the dropdown separator before custom currency entry, the selected item index was incorrectly assigned to the separator. --- src/windows/options.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/windows/options.c b/src/windows/options.c index 49344593da..b5945d6dcb 100644 --- a/src/windows/options.c +++ b/src/windows/options.c @@ -930,7 +930,11 @@ static void window_options_mousedown(int widgetIndex, rct_window*w, rct_widget* window_options_show_dropdown(w, widget, num_items); - dropdown_set_checked(gConfigGeneral.currency_format, true); + if(gConfigGeneral.currency_format == CURRENCY_CUSTOM){ + dropdown_set_checked(gConfigGeneral.currency_format+1, true); + } else { + dropdown_set_checked(gConfigGeneral.currency_format, true); + } break; case WIDX_DISTANCE_DROPDOWN: gDropdownItemsFormat[0] = STR_DROPDOWN_MENU_LABEL; @@ -1190,9 +1194,10 @@ static void window_options_dropdown(rct_window *w, int widgetIndex, int dropdown case WIDX_CURRENCY_DROPDOWN: if(dropdownIndex == CURRENCY_CUSTOM+1) { // Add 1 because the separator occupies a position gConfigGeneral.currency_format = (sint8)dropdownIndex-1; + window_custom_currency_open(); } else { gConfigGeneral.currency_format = (sint8)dropdownIndex; - } + } // TODO: Save current custom currency rate config_save_default(); gfx_invalidate_screen(); break;