Added server filter button for TeamGame

This commit is contained in:
dP
2021-10-10 00:41:08 +03:00
parent 2ea12b9a72
commit c9e1b3eff1
4 changed files with 45 additions and 34 deletions

View File

@@ -5742,13 +5742,6 @@ STR_SORT_BY_HOUSES :Houses
STR_SORT_BY_REAL_POPULATION :Real population
STR_ORDER_DIST :{NUM}, {NUM}
#server list
STR_NETWORK_SELECT_CITYMANIA :{BLACK}CityMania
STR_NETWORK_SELECT_NICE :{BLACK}N-ice
STR_NETWORK_SELECT_BTPRO :{BLACK}BTPro
STR_NETWORK_SELECT_REDDIT :{BLACK}reddit
STR_NETWORK_SELECT_SERVER_TOOLTIP :{BLACK}Filter this one
### Town CB gui
STR_BUTTON_CB :{STRING}
STR_BUTTON_CB_YES :{BLACK}CB
@@ -5970,3 +5963,12 @@ CM_STR_TOGGLE_CLIENTS_OVERLAY :Toggle client list overlay.
CM_STR_SMALLMAP_TOWN_LARGE :{TINY_FONT}{YELLOW}{TOWN}
CM_STR_SMALLMAP_POPULATION_LARGE :{TINY_FONT}{YELLOW}({NUM})
CM_STR_SMALLMAP_POPULATION :{TINY_FONT}{WHITE}({NUM})
# Network server list filters
CM_STR_NETWORK_SERVER_LIST_FILTER_CITYMANIA :{BLACK}CityMania
CM_STR_NETWORK_SERVER_LIST_FILTER_NICE :{BLACK}N-ice
CM_STR_NETWORK_SERVER_LIST_FILTER_BTPRO :{BLACK}BTPro
CM_STR_NETWORK_SERVER_LIST_FILTER_REDDIT :{BLACK}reddit
CM_STR_NETWORK_SERVER_LIST_FILTER_TEAMGAME :{BLACK}TeamGame
CM_STR_NETWORK_SERVER_LIST_FILTER_TOOLTIP :{BLACK}Filter this community

View File

@@ -5744,13 +5744,6 @@ STR_SORT_BY_HOUSES :Gebäude
STR_SORT_BY_REAL_POPULATION :Reale Bevölkerung
STR_ORDER_DIST :{NUM}, {NUM}
#server list
STR_NETWORK_SELECT_CITYMANIA :{BLACK}CityMania
STR_NETWORK_SELECT_NICE :{BLACK}N-ice
STR_NETWORK_SELECT_BTPRO :{BLACK}BTPro
STR_NETWORK_SELECT_REDDIT :{BLACK}reddit
STR_NETWORK_SELECT_SERVER_TOOLTIP :{BLACK}Diesen filtern
### Town CB gui
STR_BUTTON_CB :{STRING}
STR_BUTTON_CB_YES :{BLACK}CB
@@ -5961,3 +5954,11 @@ STR_CONFIG_SETTING_PERSISTENT_DEPOTTOOLS_HELPTEXT :Die Bauwerkzeug
STR_CM_CONFIG_SETTING_IMPROVED_STATION_JOIN :Verbesserte Steuerung zur Stationsverbindung verwenden: {STRING}
STR_CM_CONFIG_SETTING_IMPROVED_STATION_JOIN_HELPTEXT :Strg-Klick auf ein Stationsfeld anwenden, um eine Station zum verbinden an- oder abzuwählen. Strg-Klick auf das Stationsschild, falls die Station keine Felder hat. Für eine neue Station, Strg-Klick auf ein leeres Feld. Eine kürzlich gebaute Station ist automatisch zum Verbinden ausgewählt. {RED}Funktioniert nicht, falls das Verbinden von nicht direkt angrenzenden Stationen in den Einstellungen verboten ist.
# Network server list filters
CM_STR_NETWORK_SERVER_LIST_FILTER_CITYMANIA :{BLACK}CityMania
CM_STR_NETWORK_SERVER_LIST_FILTER_NICE :{BLACK}N-ice
CM_STR_NETWORK_SERVER_LIST_FILTER_BTPRO :{BLACK}BTPro
CM_STR_NETWORK_SERVER_LIST_FILTER_REDDIT :{BLACK}reddit
CM_STR_NETWORK_SERVER_LIST_FILTER_TEAMGAME :{BLACK}TeamGame
CM_STR_NETWORK_SERVER_LIST_FILTER_TOOLTIP :{BLACK}Diesen filtern

View File

@@ -810,19 +810,25 @@ public:
case WID_NG_NEWGRF_MISSING: // Find missing content online
if (this->server != nullptr) ShowMissingContentWindow(this->server->info.grfconfig);
break;
case WID_NG_NICE:
case WID_NG_BTPRO:
case WID_NG_REDDIT:
case WID_NG_CITYMANIA:
case CM_WID_NG_CITYMANIA:
_network_coordinator_client.GetListing();
if (widget == WID_NG_NICE) this->filter_editbox.text.Assign("n-ice");
else if(widget == WID_NG_BTPRO) this->filter_editbox.text.Assign("BTPro");
else if(widget == WID_NG_CITYMANIA) this->filter_editbox.text.Assign("citymania");
else if(widget == WID_NG_REDDIT) this->filter_editbox.text.Assign("reddit");
// this->servers.ForceRebuild();
// this->BuildGUINetworkGameList();
// this->ScrollToSelectedServer();
// this->SetDirty();
this->filter_editbox.text.Assign("citymania");
break;
case CM_WID_NG_REDDIT:
_network_coordinator_client.GetListing();
this->filter_editbox.text.Assign("reddit");
break;
case CM_WID_NG_NICE:
_network_coordinator_client.GetListing();
this->filter_editbox.text.Assign("n-ice");
break;
case CM_WID_NG_BTPRO:
_network_coordinator_client.GetListing();
this->filter_editbox.text.Assign("BTPro");
break;
case CM_WID_NG_TEAMGAME:
_network_coordinator_client.GetListing();
this->filter_editbox.text.Assign("TG");
break;
}
}
@@ -946,10 +952,11 @@ static const NWidgetPart _nested_network_game_widgets[] = {
/* CityMania code */
NWidget(NWID_HORIZONTAL), SetPIP(0, 7, 0),
NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_CITYMANIA), SetFill(1, 0), SetDataTip(STR_NETWORK_SELECT_CITYMANIA, STR_NETWORK_SELECT_SERVER_TOOLTIP),
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_BTPRO), SetFill(1, 0), SetDataTip(STR_NETWORK_SELECT_BTPRO, STR_NETWORK_SELECT_SERVER_TOOLTIP),
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_NICE), SetFill(1, 0), SetDataTip(STR_NETWORK_SELECT_NICE, STR_NETWORK_SELECT_SERVER_TOOLTIP),
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_REDDIT), SetFill(1, 0), SetDataTip(STR_NETWORK_SELECT_REDDIT, STR_NETWORK_SELECT_SERVER_TOOLTIP),
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, CM_WID_NG_CITYMANIA), SetFill(1, 0), SetDataTip(CM_STR_NETWORK_SERVER_LIST_FILTER_CITYMANIA, CM_STR_NETWORK_SERVER_LIST_FILTER_TOOLTIP),
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, CM_WID_NG_BTPRO), SetFill(1, 0), SetDataTip(CM_STR_NETWORK_SERVER_LIST_FILTER_BTPRO, CM_STR_NETWORK_SERVER_LIST_FILTER_TOOLTIP),
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, CM_WID_NG_NICE), SetFill(1, 0), SetDataTip(CM_STR_NETWORK_SERVER_LIST_FILTER_NICE, CM_STR_NETWORK_SERVER_LIST_FILTER_TOOLTIP),
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, CM_WID_NG_REDDIT), SetFill(1, 0), SetDataTip(CM_STR_NETWORK_SERVER_LIST_FILTER_REDDIT, CM_STR_NETWORK_SERVER_LIST_FILTER_TOOLTIP),
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, CM_WID_NG_TEAMGAME), SetFill(1, 0), SetDataTip(CM_STR_NETWORK_SERVER_LIST_FILTER_TEAMGAME, CM_STR_NETWORK_SERVER_LIST_FILTER_TOOLTIP),
EndContainer(),
/* end CityMania code */
NWidget(NWID_HORIZONTAL), SetPIP(0, 7, 0),

View File

@@ -49,10 +49,11 @@ enum NetworkGameWidgets {
WID_NG_START, ///< 'Start server' button.
WID_NG_CANCEL, ///< 'Cancel' button.
WID_NG_CITYMANIA, ///< filter citymania
WID_NG_REDDIT, ///< filter reddit
WID_NG_NICE, ///< filter n-ice
WID_NG_BTPRO, ///< filter btpro
CM_WID_NG_CITYMANIA, ///< filter citymania
CM_WID_NG_REDDIT, ///< filter reddit
CM_WID_NG_NICE, ///< filter n-ice
CM_WID_NG_BTPRO, ///< filter btpro
CM_WID_NG_TEAMGAME, ///< filter TeamGame
};
/** Widgets of the #NetworkStartServerWindow class. */