Changeset - r24493:4293afd64bae
[Not reviewed]
master
0 5 0
frosch - 4 years ago 2020-12-24 18:00:53
frosch@openttd.org
Change: Remove the LAN/Internet combobox from the server list in favour of adding two separate search buttons.
5 files changed with 19 insertions and 79 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -1938,28 +1938,24 @@ STR_FACE_LIPS_MOUSTACHE_TOOLTIP         
 
STR_FACE_CHIN                                                   :Chin:
 
STR_FACE_CHIN_TOOLTIP                                           :{BLACK}Change chin
 
STR_FACE_JACKET                                                 :Jacket:
 
STR_FACE_JACKET_TOOLTIP                                         :{BLACK}Change jacket
 
STR_FACE_COLLAR                                                 :Collar:
 
STR_FACE_COLLAR_TOOLTIP                                         :{BLACK}Change collar
 
STR_FACE_TIE                                                    :Tie:
 
STR_FACE_EARRING                                                :Earring:
 
STR_FACE_TIE_EARRING_TOOLTIP                                    :{BLACK}Change tie or earring
 

	
 
# Network server list
 
STR_NETWORK_SERVER_LIST_CAPTION                                 :{WHITE}Multiplayer
 
STR_NETWORK_SERVER_LIST_ADVERTISED                              :{BLACK}Advertised
 
STR_NETWORK_SERVER_LIST_ADVERTISED_TOOLTIP                      :{BLACK}Choose between an advertised (internet) and a not advertised (Local Area Network, LAN) game
 
STR_NETWORK_SERVER_LIST_ADVERTISED_NO                           :No
 
STR_NETWORK_SERVER_LIST_ADVERTISED_YES                          :Yes
 
STR_NETWORK_SERVER_LIST_PLAYER_NAME                             :{BLACK}Player name:
 
STR_NETWORK_SERVER_LIST_ENTER_NAME_TOOLTIP                      :{BLACK}This is the name other players will identify you by
 

	
 
STR_NETWORK_SERVER_LIST_GAME_NAME                               :{BLACK}Name
 
STR_NETWORK_SERVER_LIST_GAME_NAME_TOOLTIP                       :{BLACK}Name of the game
 
STR_NETWORK_SERVER_LIST_GENERAL_ONLINE                          :{BLACK}{COMMA}/{COMMA} - {COMMA}/{COMMA}
 
STR_NETWORK_SERVER_LIST_CLIENTS_CAPTION                         :{BLACK}Clients
 
STR_NETWORK_SERVER_LIST_CLIENTS_CAPTION_TOOLTIP                 :{BLACK}Clients online / clients max{}Companies online / companies max
 
STR_NETWORK_SERVER_LIST_MAP_SIZE_SHORT                          :{BLACK}{COMMA}x{COMMA}
 
STR_NETWORK_SERVER_LIST_MAP_SIZE_CAPTION                        :{BLACK}Map size
 
STR_NETWORK_SERVER_LIST_MAP_SIZE_CAPTION_TOOLTIP                :{BLACK}Map size of the game{}Click to sort by area
 
STR_NETWORK_SERVER_LIST_DATE_CAPTION                            :{BLACK}Date
 
@@ -1982,42 +1978,46 @@ STR_NETWORK_SERVER_LIST_SERVER_ADDRESS  
 
STR_NETWORK_SERVER_LIST_START_DATE                              :{SILVER}Start date: {WHITE}{DATE_SHORT}
 
STR_NETWORK_SERVER_LIST_CURRENT_DATE                            :{SILVER}Current date: {WHITE}{DATE_SHORT}
 
STR_NETWORK_SERVER_LIST_PASSWORD                                :{SILVER}Password protected!
 
STR_NETWORK_SERVER_LIST_SERVER_OFFLINE                          :{SILVER}SERVER OFFLINE
 
STR_NETWORK_SERVER_LIST_SERVER_FULL                             :{SILVER}SERVER FULL
 
STR_NETWORK_SERVER_LIST_VERSION_MISMATCH                        :{SILVER}VERSION MISMATCH
 
STR_NETWORK_SERVER_LIST_GRF_MISMATCH                            :{SILVER}NEWGRF MISMATCH
 

	
 
STR_NETWORK_SERVER_LIST_JOIN_GAME                               :{BLACK}Join game
 
STR_NETWORK_SERVER_LIST_REFRESH                                 :{BLACK}Refresh server
 
STR_NETWORK_SERVER_LIST_REFRESH_TOOLTIP                         :{BLACK}Refresh the server info
 

	
 
STR_NETWORK_SERVER_LIST_FIND_SERVER                             :{BLACK}Find server
 
STR_NETWORK_SERVER_LIST_FIND_SERVER_TOOLTIP                     :{BLACK}Search network for a server
 
STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET                  :{BLACK}Search internet
 
STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET_TOOLTIP          :{BLACK}Search internet for public servers
 
STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN                       :{BLACK}Search LAN
 
STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN_TOOLTIP               :{BLACK}Search local area network for servers
 
STR_NETWORK_SERVER_LIST_ADD_SERVER                              :{BLACK}Add server
 
STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP                      :{BLACK}Adds a server to the list which will always be checked for running games
 
STR_NETWORK_SERVER_LIST_START_SERVER                            :{BLACK}Start server
 
STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP                    :{BLACK}Start your own server
 

	
 
STR_NETWORK_SERVER_LIST_PLAYER_NAME_OSKTITLE                    :{BLACK}Enter your name
 
STR_NETWORK_SERVER_LIST_ENTER_IP                                :{BLACK}Enter the address of the host
 

	
 
# Start new multiplayer server
 
STR_NETWORK_START_SERVER_CAPTION                                :{WHITE}Start new multiplayer game
 

	
 
STR_NETWORK_START_SERVER_NEW_GAME_NAME                          :{BLACK}Game name:
 
STR_NETWORK_START_SERVER_NEW_GAME_NAME_TOOLTIP                  :{BLACK}The game name will be displayed to other players in the multiplayer game selection menu
 
STR_NETWORK_START_SERVER_SET_PASSWORD                           :{BLACK}Set password
 
STR_NETWORK_START_SERVER_PASSWORD_TOOLTIP                       :{BLACK}Protect your game with a password if you don't want it to be publicly accessible
 

	
 
STR_NETWORK_SERVER_LIST_ADVERTISED                              :{BLACK}Advertised
 
STR_NETWORK_SERVER_LIST_ADVERTISED_TOOLTIP                      :{BLACK}Choose between an advertised (internet) and a not advertised (Local Area Network, LAN) game
 
STR_NETWORK_START_SERVER_UNADVERTISED                           :No
 
STR_NETWORK_START_SERVER_ADVERTISED                             :Yes
 
STR_NETWORK_START_SERVER_CLIENTS_SELECT                         :{BLACK}{NUM} client{P "" s}
 
STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS                      :{BLACK}Maximum number of clients:
 
STR_NETWORK_START_SERVER_NUMBER_OF_CLIENTS_TOOLTIP              :{BLACK}Choose the maximum number of clients. Not all slots need to be filled
 
STR_NETWORK_START_SERVER_COMPANIES_SELECT                       :{BLACK}{NUM} compan{P y ies}
 
STR_NETWORK_START_SERVER_NUMBER_OF_COMPANIES                    :{BLACK}Maximum number of companies:
 
STR_NETWORK_START_SERVER_NUMBER_OF_COMPANIES_TOOLTIP            :{BLACK}Limit the server to a certain amount of companies
 
STR_NETWORK_START_SERVER_SPECTATORS_SELECT                      :{BLACK}{NUM} spectator{P "" s}
 
STR_NETWORK_START_SERVER_NUMBER_OF_SPECTATORS                   :{BLACK}Maximum number of spectators:
 
STR_NETWORK_START_SERVER_NUMBER_OF_SPECTATORS_TOOLTIP           :{BLACK}Limit the server to a certain amount of spectators
 
STR_NETWORK_START_SERVER_LANGUAGE_SPOKEN                        :{BLACK}Language spoken:
src/network/network_gui.cpp
Show inline comments
 
@@ -46,33 +46,24 @@
 
static void ShowNetworkStartServerWindow();
 
static void ShowNetworkLobbyWindow(NetworkGameList *ngl);
 

	
 
/**
 
 * Advertisement options in the start server window
 
 */
 
static const StringID _connection_types_dropdown[] = {
 
	STR_NETWORK_START_SERVER_UNADVERTISED,
 
	STR_NETWORK_START_SERVER_ADVERTISED,
 
	INVALID_STRING_ID
 
};
 

	
 
/**
 
 * Advertisement options in the server list
 
 */
 
static const StringID _lan_internet_types_dropdown[] = {
 
	STR_NETWORK_SERVER_LIST_ADVERTISED_NO,
 
	STR_NETWORK_SERVER_LIST_ADVERTISED_YES,
 
	INVALID_STRING_ID
 
};
 

	
 
static std::vector<StringID> _language_dropdown;
 

	
 
void SortNetworkLanguages()
 
{
 
	/* Init the strings */
 
	if (_language_dropdown.empty()) {
 
		for (int i = 0; i < NETLANG_COUNT; i++) _language_dropdown.emplace_back(STR_NETWORK_LANG_ANY + i);
 
		_language_dropdown.emplace_back(INVALID_STRING_ID);
 
	}
 

	
 
	/* Sort the strings (we don't move 'any' and the 'invalid' one) */
 
	std::sort(_language_dropdown.begin() + 1, _language_dropdown.end() - 1, StringIDSorter);
 
@@ -494,45 +485,30 @@ public:
 

	
 
		this->servers.SetListing(this->last_sorting);
 
		this->servers.SetSortFuncs(this->sorter_funcs);
 
		this->servers.SetFilterFuncs(this->filter_funcs);
 
		this->servers.ForceRebuild();
 
	}
 

	
 
	~NetworkGameWindow()
 
	{
 
		this->last_sorting = this->servers.GetListing();
 
	}
 

	
 
	void SetStringParameters(int widget) const override
 
	{
 
		switch (widget) {
 
			case WID_NG_CONN_BTN:
 
				SetDParam(0, _lan_internet_types_dropdown[_settings_client.network.lan_internet]);
 
				break;
 
		}
 
	}
 

	
 
	void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
 
	{
 
		switch (widget) {
 
			case WID_NG_CONN_BTN:
 
				*size = maxdim(*size, maxdim(GetStringBoundingBox(_lan_internet_types_dropdown[0]), GetStringBoundingBox(_lan_internet_types_dropdown[1])));
 
				size->width += padding.width;
 
				size->height += padding.height;
 
				break;
 

	
 
			case WID_NG_MATRIX:
 
				resize->height = WD_MATRIX_TOP + max(GetSpriteSize(SPR_BLOT).height, (uint)FONT_HEIGHT_NORMAL) + WD_MATRIX_BOTTOM;
 
				size->height = 10 * resize->height;
 
				size->height = 12 * resize->height;
 
				break;
 

	
 
			case WID_NG_LASTJOINED:
 
				size->height = WD_MATRIX_TOP + max(GetSpriteSize(SPR_BLOT).height, (uint)FONT_HEIGHT_NORMAL) + WD_MATRIX_BOTTOM;
 
				break;
 

	
 
			case WID_NG_LASTJOINED_SPACER:
 
				size->width = NWidgetScrollbar::GetVerticalDimension().width;
 
				break;
 

	
 
			case WID_NG_NAME:
 
				size->width += 2 * Window::SortButtonWidth(); // Make space for the arrow
 
@@ -551,28 +527,24 @@ public:
 
				size->width += 2 * Window::SortButtonWidth(); // Make space for the arrow
 
				SetDParamMaxValue(0, MAX_MAP_SIZE);
 
				SetDParamMaxValue(1, MAX_MAP_SIZE);
 
				*size = maxdim(*size, GetStringBoundingBox(STR_NETWORK_SERVER_LIST_MAP_SIZE_SHORT));
 
				break;
 

	
 
			case WID_NG_DATE:
 
			case WID_NG_YEARS:
 
				size->width += 2 * Window::SortButtonWidth(); // Make space for the arrow
 
				SetDParamMaxValue(0, 5);
 
				*size = maxdim(*size, GetStringBoundingBox(STR_JUST_INT));
 
				break;
 

	
 
			case WID_NG_DETAILS_SPACER:
 
				size->height = 20 + 12 * FONT_HEIGHT_NORMAL;
 
				break;
 
		}
 
	}
 

	
 
	void DrawWidget(const Rect &r, int widget) const override
 
	{
 
		switch (widget) {
 
			case WID_NG_MATRIX: {
 
				uint16 y = r.top;
 

	
 
				const int max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), (int)this->servers.size());
 

	
 
				for (int i = this->vscroll->GetPosition(); i < max; ++i) {
 
@@ -618,25 +590,26 @@ public:
 
		this->SetWidgetDisabledState(WID_NG_REFRESH, sel == nullptr);
 
		/* 'Join' button disabling conditions */
 
		this->SetWidgetDisabledState(WID_NG_JOIN, sel == nullptr || // no Selected Server
 
				!sel->online || // Server offline
 
				sel->info.clients_on >= sel->info.clients_max || // Server full
 
				!sel->info.compatible); // Revision mismatch
 

	
 
		/* 'NewGRF Settings' button invisible if no NewGRF is used */
 
		this->GetWidget<NWidgetStacked>(WID_NG_NEWGRF_SEL)->SetDisplayedPlane(sel == nullptr || !sel->online || sel->info.grfconfig == nullptr);
 
		this->GetWidget<NWidgetStacked>(WID_NG_NEWGRF_MISSING_SEL)->SetDisplayedPlane(sel == nullptr || !sel->online || sel->info.grfconfig == nullptr || !sel->info.version_compatible || sel->info.compatible);
 

	
 
#ifdef __EMSCRIPTEN__
 
		this->SetWidgetDisabledState(WID_NG_FIND, true);
 
		this->SetWidgetDisabledState(WID_NG_SEARCH_INTERNET, true);
 
		this->SetWidgetDisabledState(WID_NG_SEARCH_LAN, true);
 
		this->SetWidgetDisabledState(WID_NG_ADD, true);
 
		this->SetWidgetDisabledState(WID_NG_START, true);
 
#endif
 

	
 
		this->DrawWidgets();
 
	}
 

	
 
	void DrawDetails(const Rect &r) const
 
	{
 
		NetworkGameList *sel = this->server;
 

	
 
		const int detail_height = 6 + 8 + 6 + 3 * FONT_HEIGHT_NORMAL;
 
@@ -706,28 +679,24 @@ public:
 
				DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_PASSWORD, TC_FROMSTRING, SA_HOR_CENTER); // password warning
 
			}
 
		}
 
	}
 

	
 
	void OnClick(Point pt, int widget, int click_count) override
 
	{
 
		switch (widget) {
 
			case WID_NG_CANCEL: // Cancel button
 
				DeleteWindowById(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_GAME);
 
				break;
 

	
 
			case WID_NG_CONN_BTN: // 'Connection' droplist
 
				ShowDropDownMenu(this, _lan_internet_types_dropdown, _settings_client.network.lan_internet, WID_NG_CONN_BTN, 0, 0); // do it for widget WID_NSS_CONN_BTN
 
				break;
 

	
 
			case WID_NG_NAME:    // Sort by name
 
			case WID_NG_CLIENTS: // Sort by connected clients
 
			case WID_NG_MAPSIZE: // Sort by map size
 
			case WID_NG_DATE:    // Sort by date
 
			case WID_NG_YEARS:   // Sort by years
 
			case WID_NG_INFO:    // Connectivity (green dot)
 
				if (this->servers.SortType() == widget - WID_NG_NAME) {
 
					this->servers.ToggleSortOrder();
 
					if (this->list_pos != SLP_INVALID) this->list_pos = (ServerListPosition)this->servers.size() - this->list_pos - 1;
 
				} else {
 
					this->servers.SetSortType(widget - WID_NG_NAME);
 
					this->servers.ForceResort();
 
@@ -754,29 +723,30 @@ public:
 

	
 
					/* search the position of the newly selected server */
 
					this->UpdateListPos();
 
					this->ScrollToSelectedServer();
 
					this->SetDirty();
 

	
 
					/* FIXME the disabling should go into some InvalidateData, which is called instead of the SetDirty */
 
					if (click_count > 1 && !this->IsWidgetDisabled(WID_NG_JOIN)) this->OnClick(pt, WID_NG_JOIN, 1);
 
				}
 
				break;
 
			}
 

	
 
			case WID_NG_FIND: // Find server automatically
 
				switch (_settings_client.network.lan_internet) {
 
					case 0: NetworkUDPSearchGame(); break;
 
					case 1: NetworkUDPQueryMasterServer(); break;
 
				}
 
			case WID_NG_SEARCH_INTERNET:
 
				NetworkUDPQueryMasterServer();
 
				break;
 

	
 
			case WID_NG_SEARCH_LAN:
 
				NetworkUDPSearchGame();
 
				break;
 

	
 
			case WID_NG_ADD: // Add a server
 
				SetDParamStr(0, _settings_client.network.connect_to_ip);
 
				ShowQueryString(
 
					STR_JUST_RAW_STRING,
 
					STR_NETWORK_SERVER_LIST_ENTER_IP,
 
					NETWORK_HOSTNAME_LENGTH,  // maximum number of characters including '\0'
 
					this, CS_ALPHANUMERAL, QSF_ACCEPT_UNCHANGED);
 
				break;
 

	
 
			case WID_NG_START: // Start server
 
@@ -796,38 +766,24 @@ public:
 
				break;
 

	
 
			case WID_NG_NEWGRF: // NewGRF Settings
 
				if (this->server != nullptr) ShowNewGRFSettings(false, false, false, &this->server->info.grfconfig);
 
				break;
 

	
 
			case WID_NG_NEWGRF_MISSING: // Find missing content online
 
				if (this->server != nullptr) ShowMissingContentWindow(this->server->info.grfconfig);
 
				break;
 
		}
 
	}
 

	
 
	void OnDropdownSelect(int widget, int index) override
 
	{
 
		switch (widget) {
 
			case WID_NG_CONN_BTN:
 
				_settings_client.network.lan_internet = index;
 
				break;
 

	
 
			default:
 
				NOT_REACHED();
 
		}
 

	
 
		this->SetDirty();
 
	}
 

	
 
	/**
 
	 * Some data on this window has become invalid.
 
	 * @param data Information about the changed data.
 
	 * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
 
	 */
 
	void OnInvalidateData(int data = 0, bool gui_scope = true) override
 
	{
 
		this->servers.ForceRebuild();
 
		this->SetDirty();
 
	}
 

	
 
	EventState OnKeyPress(WChar key, uint16 keycode) override
 
@@ -956,30 +912,24 @@ static const NWidgetPart _nested_network
 
	/* TOP */
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
 
		NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE), SetDataTip(STR_NETWORK_SERVER_LIST_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_DEFSIZEBOX, COLOUR_LIGHT_BLUE),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE, WID_NG_MAIN),
 
		NWidget(NWID_VERTICAL), SetPIP(10, 7, 0),
 
			NWidget(NWID_HORIZONTAL), SetPIP(10, 7, 10),
 
				/* LEFT SIDE */
 
				NWidget(NWID_VERTICAL), SetPIP(0, 7, 0),
 
					NWidget(NWID_HORIZONTAL), SetPIP(0, 7, 0),
 
						NWidget(WWT_TEXT, COLOUR_LIGHT_BLUE, WID_NG_CONNECTION), SetDataTip(STR_NETWORK_SERVER_LIST_ADVERTISED, STR_NULL),
 
						NWidget(WWT_DROPDOWN, COLOUR_LIGHT_BLUE, WID_NG_CONN_BTN),
 
											SetDataTip(STR_BLACK_STRING, STR_NETWORK_SERVER_LIST_ADVERTISED_TOOLTIP),
 
						NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0),
 
					EndContainer(),
 
					NWidget(NWID_HORIZONTAL), SetPIP(0, 7, 0),
 
						NWidget(WWT_TEXT, COLOUR_LIGHT_BLUE, WID_NG_FILTER_LABEL), SetDataTip(STR_LIST_FILTER_TITLE, STR_NULL),
 
						NWidget(WWT_EDITBOX, COLOUR_LIGHT_BLUE, WID_NG_FILTER), SetMinimalSize(251, 12), SetFill(1, 0), SetResize(1, 0),
 
											SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP),
 
					EndContainer(),
 
					NWidget(NWID_HORIZONTAL),
 
						NWidget(NWID_VERTICAL),
 
							NWidgetFunction(MakeResizableHeader),
 
							NWidget(WWT_MATRIX, COLOUR_LIGHT_BLUE, WID_NG_MATRIX), SetResize(1, 1), SetFill(1, 0),
 
												SetMatrixDataTip(1, 0, STR_NETWORK_SERVER_LIST_CLICK_GAME_TO_SELECT), SetScrollbar(WID_NG_SCROLLBAR),
 
						EndContainer(),
 
						NWidget(NWID_VSCROLLBAR, COLOUR_LIGHT_BLUE, WID_NG_SCROLLBAR),
 
					EndContainer(),
 
@@ -1020,25 +970,26 @@ static const NWidgetPart _nested_network
 
							NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(5, 5, 5),
 
								NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_JOIN), SetFill(1, 0), SetDataTip(STR_NETWORK_SERVER_LIST_JOIN_GAME, STR_NULL),
 
								NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_REFRESH), SetFill(1, 0), SetDataTip(STR_NETWORK_SERVER_LIST_REFRESH, STR_NETWORK_SERVER_LIST_REFRESH_TOOLTIP),
 
							EndContainer(),
 
						EndContainer(),
 
					EndContainer(),
 
				EndContainer(),
 
			EndContainer(),
 
			/* BOTTOM */
 
			NWidget(NWID_HORIZONTAL),
 
				NWidget(NWID_VERTICAL),
 
					NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(10, 7, 4),
 
						NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_FIND), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_NETWORK_SERVER_LIST_FIND_SERVER, STR_NETWORK_SERVER_LIST_FIND_SERVER_TOOLTIP),
 
						NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_SEARCH_INTERNET), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET, STR_NETWORK_SERVER_LIST_SEARCH_SERVER_INTERNET_TOOLTIP),
 
						NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_SEARCH_LAN), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN, STR_NETWORK_SERVER_LIST_SEARCH_SERVER_LAN_TOOLTIP),
 
						NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_ADD), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_NETWORK_SERVER_LIST_ADD_SERVER, STR_NETWORK_SERVER_LIST_ADD_SERVER_TOOLTIP),
 
						NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_START), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_NETWORK_SERVER_LIST_START_SERVER, STR_NETWORK_SERVER_LIST_START_SERVER_TOOLTIP),
 
						NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NG_CANCEL), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
 
					EndContainer(),
 
					NWidget(NWID_SPACER), SetMinimalSize(0, 6), SetResize(1, 0), SetFill(1, 0),
 
				EndContainer(),
 
				NWidget(NWID_VERTICAL),
 
					NWidget(NWID_SPACER), SetFill(0, 1),
 
					NWidget(WWT_RESIZEBOX, COLOUR_LIGHT_BLUE),
 
				EndContainer(),
 
			EndContainer(),
 
		EndContainer(),
src/settings_type.h
Show inline comments
 
@@ -246,25 +246,24 @@ struct NetworkSettings {
 
	uint16 max_download_time;                             ///< maximum amount of time, in game ticks, a client may take to download the map
 
	uint16 max_password_time;                             ///< maximum amount of time, in game ticks, a client may take to enter the password
 
	uint16 max_lag_time;                                  ///< maximum amount of time, in game ticks, a client may be lagging behind the server
 
	bool   pause_on_join;                                 ///< pause the game when people join
 
	uint16 server_port;                                   ///< port the server listens on
 
	uint16 server_admin_port;                             ///< port the server listens on for the admin network
 
	bool   server_admin_chat;                             ///< allow private chat for the server to be distributed to the admin network
 
	char   server_name[NETWORK_NAME_LENGTH];              ///< name of the server
 
	char   server_password[NETWORK_PASSWORD_LENGTH];      ///< password for joining this server
 
	char   rcon_password[NETWORK_PASSWORD_LENGTH];        ///< password for rconsole (server side)
 
	char   admin_password[NETWORK_PASSWORD_LENGTH];       ///< password for the admin network
 
	bool   server_advertise;                              ///< advertise the server to the masterserver
 
	uint8  lan_internet;                                  ///< search on the LAN or internet for servers
 
	char   client_name[NETWORK_CLIENT_NAME_LENGTH];       ///< name of the player (as client)
 
	char   default_company_pass[NETWORK_PASSWORD_LENGTH]; ///< default password for new companies in encrypted form
 
	char   connect_to_ip[NETWORK_HOSTNAME_LENGTH];        ///< default for the "Add server" query
 
	char   network_id[NETWORK_SERVER_ID_LENGTH];          ///< network ID for servers
 
	bool   autoclean_companies;                           ///< automatically remove companies that are not in use
 
	uint8  autoclean_unprotected;                         ///< remove passwordless companies after this many months
 
	uint8  autoclean_protected;                           ///< remove the password from passworded companies after this many months
 
	uint8  autoclean_novehicles;                          ///< remove companies with no vehicles after this many months
 
	uint8  max_companies;                                 ///< maximum amount of companies
 
	uint8  max_clients;                                   ///< maximum amount of clients
 
	uint8  max_spectators;                                ///< maximum amount of spectators
 
	Year   restart_game_year;                             ///< year the server restarts
src/table/settings.ini
Show inline comments
 
@@ -3792,33 +3792,24 @@ cat      = SC_EXPERT
 
var      = network.server_admin_chat
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
guiflags = SGF_NETWORK_ONLY
 
def      = true
 
cat      = SC_EXPERT
 

	
 
[SDTC_BOOL]
 
var      = network.server_advertise
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
guiflags = SGF_NETWORK_ONLY
 
def      = false
 

	
 
[SDTC_VAR]
 
var      = network.lan_internet
 
type     = SLE_UINT8
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
guiflags = SGF_NETWORK_ONLY
 
def      = 1
 
min      = 0
 
max      = 1
 

	
 
[SDTC_STR]
 
var      = network.client_name
 
type     = SLE_STRB
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
def      = nullptr
 
proc     = UpdateClientName
 
cat      = SC_BASIC
 

	
 
[SDTC_STR]
 
var      = network.server_password
 
type     = SLE_STRB
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
src/widgets/network_widget.h
Show inline comments
 
@@ -5,26 +5,24 @@
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file network_widget.h Types related to the network widgets. */
 

	
 
#ifndef WIDGETS_NETWORK_WIDGET_H
 
#define WIDGETS_NETWORK_WIDGET_H
 

	
 
/** Widgets of the #NetworkGameWindow class. */
 
enum NetworkGameWidgets {
 
	WID_NG_MAIN,               ///< Main panel.
 

	
 
	WID_NG_CONNECTION,         ///< Label in front of connection droplist.
 
	WID_NG_CONN_BTN,           ///< 'Connection' droplist button.
 
	WID_NG_CLIENT_LABEL,       ///< Label in front of client name edit box.
 
	WID_NG_CLIENT,             ///< Panel with editbox to set client name.
 
	WID_NG_FILTER_LABEL,       ///< Label in front of the filter/search edit box.
 
	WID_NG_FILTER,             ///< Panel with the edit box to enter the search text.
 

	
 
	WID_NG_HEADER,             ///< Header container of the matrix.
 
	WID_NG_NAME,               ///< 'Name' button.
 
	WID_NG_CLIENTS,            ///< 'Clients' button.
 
	WID_NG_MAPSIZE,            ///< 'Map size' button.
 
	WID_NG_DATE,               ///< 'Date' button.
 
	WID_NG_YEARS,              ///< 'Years' button.
 
	WID_NG_INFO,               ///< Third button in the game list panel.
 
@@ -36,25 +34,26 @@ enum NetworkGameWidgets {
 
	WID_NG_LASTJOINED,         ///< Info about the last joined server.
 
	WID_NG_LASTJOINED_SPACER,  ///< Spacer after last joined server panel.
 

	
 
	WID_NG_DETAILS,            ///< Panel with game details.
 
	WID_NG_DETAILS_SPACER,     ///< Spacer for game actual details.
 
	WID_NG_JOIN,               ///< 'Join game' button.
 
	WID_NG_REFRESH,            ///< 'Refresh server' button.
 
	WID_NG_NEWGRF,             ///< 'NewGRF Settings' button.
 
	WID_NG_NEWGRF_SEL,         ///< Selection 'widget' to hide the NewGRF settings.
 
	WID_NG_NEWGRF_MISSING,     ///< 'Find missing NewGRF online' button.
 
	WID_NG_NEWGRF_MISSING_SEL, ///< Selection widget for the above button.
 

	
 
	WID_NG_FIND,               ///< 'Find server' button.
 
	WID_NG_SEARCH_INTERNET,    ///< 'Search internet server' button.
 
	WID_NG_SEARCH_LAN,         ///< 'Search LAN server' button.
 
	WID_NG_ADD,                ///< 'Add server' button.
 
	WID_NG_START,              ///< 'Start server' button.
 
	WID_NG_CANCEL,             ///< 'Cancel' button.
 
};
 

	
 
/** Widgets of the #NetworkStartServerWindow class. */
 
enum NetworkStartServerWidgets {
 
	WID_NSS_BACKGROUND,        ///< Background of the window.
 
	WID_NSS_GAMENAME_LABEL,    ///< Label for the game name.
 
	WID_NSS_GAMENAME,          ///< Background for editbox to set game name.
 
	WID_NSS_SETPWD,            ///< 'Set password' button.
 
	WID_NSS_CONNTYPE_LABEL,    ///< Label for 'connection type'.
0 comments (0 inline, 0 general)