1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-26 07:59:09 +00:00

Codechange: introduce and use function to raise and dirty a set of widgets when they are lowered

This commit is contained in:
Rubidium
2023-09-17 06:40:28 +02:00
committed by rubidium42
parent 6580ff1adb
commit 7ef22af2bb
6 changed files with 31 additions and 36 deletions

View File

@@ -1180,13 +1180,7 @@ struct NetworkStartServerWindow : public Window {
void OnTimeout() override
{
static const int raise_widgets[] = {WID_NSS_CLIENTS_BTND, WID_NSS_CLIENTS_BTNU, WID_NSS_COMPANIES_BTND, WID_NSS_COMPANIES_BTNU, WIDGET_LIST_END};
for (const int *widget = raise_widgets; *widget != WIDGET_LIST_END; widget++) {
if (this->IsWidgetLowered(*widget)) {
this->RaiseWidget(*widget);
this->SetWidgetDirty(*widget);
}
}
this->RaiseWidgetsWhenLowered(WID_NSS_CLIENTS_BTND, WID_NSS_CLIENTS_BTNU, WID_NSS_COMPANIES_BTND, WID_NSS_COMPANIES_BTNU);
}
void OnQueryTextFinished(char *str) override