Change: Enable dropdown text filter for various dropdown lists.

This commit is contained in:
Peter Nelson
2026-03-08 19:25:28 +00:00
committed by Peter Nelson
parent 38b74639be
commit d685fc97f1
11 changed files with 42 additions and 27 deletions
+14 -4
View File
@@ -1154,18 +1154,28 @@ struct GameOptionsWindow : Window {
ShowNetworkContentListWindow(nullptr, CONTENT_TYPE_BASE_MUSIC);
break;
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_REFRESH_RATE_DROPDOWN: {
int selected;
DropDownList list = this->BuildDropDownList(widget, &selected);
if (!list.empty()) {
ShowDropDownList(this, std::move(list), selected, widget);
} else {
if (widget == WID_GO_RESOLUTION_DROPDOWN) ShowErrorMessage(GetEncodedString(STR_ERROR_RESOLUTION_LIST_FAILED), {}, WL_ERROR);
}
break;
}
case WID_GO_CURRENCY_DROPDOWN:
case WID_GO_LANG_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()) {
ShowDropDownList(this, std::move(list), selected, widget);
ShowDropDownList(this, std::move(list), selected, widget, 0, DropDownOption::Filterable);
} else {
if (widget == WID_GO_RESOLUTION_DROPDOWN) ShowErrorMessage(GetEncodedString(STR_ERROR_RESOLUTION_LIST_FAILED), {}, WL_ERROR);
}