Merge tag '12.1' into branch 12

This commit is contained in:
Sergii Pylypenko
2021-12-10 02:36:38 +02:00
85 changed files with 2391 additions and 637 deletions

View File

@@ -616,6 +616,8 @@ public:
sel->info.clients_on >= sel->info.clients_max || // Server full
!sel->info.compatible); // Revision mismatch
this->SetWidgetLoweredState(WID_NG_REFRESH, sel != nullptr && sel->refreshing);
/* 'NewGRF Settings' button invisible if no NewGRF is used */
this->GetWidget<NWidgetStacked>(WID_NG_NEWGRF_SEL)->SetDisplayedPlane(sel == nullptr || sel->status != NGLS_ONLINE || sel->info.grfconfig == nullptr);
this->GetWidget<NWidgetStacked>(WID_NG_NEWGRF_MISSING_SEL)->SetDisplayedPlane(sel == nullptr || sel->status != NGLS_ONLINE || sel->info.grfconfig == nullptr || !sel->info.version_compatible || sel->info.compatible);
@@ -675,7 +677,8 @@ public:
y += FONT_HEIGHT_NORMAL;
SetDParamStr(0, sel->connection_string);
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_SERVER_ADDRESS); // server address
StringID invite_or_address = StrStartsWith(sel->connection_string, "+") ? STR_NETWORK_SERVER_LIST_INVITE_CODE : STR_NETWORK_SERVER_LIST_SERVER_ADDRESS;
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, invite_or_address); // server address / invite code
y += FONT_HEIGHT_NORMAL;
SetDParam(0, sel->info.start_date);
@@ -786,7 +789,7 @@ public:
break;
case WID_NG_REFRESH: // Refresh
if (this->server != nullptr) NetworkQueryServer(this->server->connection_string);
if (this->server != nullptr && !this->server->refreshing) NetworkQueryServer(this->server->connection_string);
break;
case WID_NG_NEWGRF: // NewGRF Settings