mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-26 00:45:35 +00:00
Change: Enable dropdown text filter for various dropdown lists.
This commit is contained in:
committed by
Peter Nelson
parent
38b74639be
commit
d685fc97f1
+14
-4
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user