forked from rosebudai/OpenRCT2-Web
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.
This commit is contained in:
1 parent
9355eef5d4
commit
187499fd72
1 file changed
+7
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user