Skip to content

Commit

Permalink
Codechange: Don't assume game options widget is a dropdown list.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterN committed Jan 14, 2024
1 parent 8ca867e commit e3bb649
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/settings_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,14 @@ struct GameOptionsWindow : Window {
break;
}

default: {
case WID_GO_CURRENCY_DROPDOWN:
case WID_GO_AUTOSAVE_DROPDOWN:
case WID_GO_LANG_DROPDOWN:
case WID_GO_RESOLUTION_DROPDOWN:
case WID_GO_REFRESH_RATE_DROPDOWN:
case WID_GO_BASE_GRF_DROPDOWN:
case WID_GO_BASE_SFX_DROPDOWN:
case WID_GO_BASE_MUSIC_DROPDOWN: {
int selected;
size->width = std::max(size->width, GetDropDownListDimension(this->BuildDropDownList(widget, &selected)).width + padding.width);
break;
Expand Down Expand Up @@ -623,7 +630,14 @@ struct GameOptionsWindow : Window {
OpenBrowser(BaseMusic::GetUsedSet()->url);
break;

default: {
case WID_GO_CURRENCY_DROPDOWN:
case WID_GO_AUTOSAVE_DROPDOWN:
case WID_GO_LANG_DROPDOWN:
case WID_GO_RESOLUTION_DROPDOWN:
case WID_GO_REFRESH_RATE_DROPDOWN:
case WID_GO_BASE_GRF_DROPDOWN:
case WID_GO_BASE_SFX_DROPDOWN:
case WID_GO_BASE_MUSIC_DROPDOWN: {
int selected;
DropDownList list = this->BuildDropDownList(widget, &selected);
if (!list.empty()) {
Expand Down

0 comments on commit e3bb649

Please sign in to comment.