From e3bb6497f7a1bfbde3488428636f7d31e868e67e Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 14 Jan 2024 10:49:27 +0000 Subject: [PATCH] Codechange: Don't assume game options widget is a dropdown list. --- src/settings_gui.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 8fd9b6e569f01..07bd14b087478 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -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; @@ -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()) {