Changeset - r25737:98a7e9214658
[Not reviewed]
master
0 3 0
TELK - 3 years ago 2021-06-28 16:42:23
telk5093@gmail.com
Add: Show the number of clients and companies in the online players window (#9376)
3 files changed with 11 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -2149,12 +2149,13 @@ STR_NETWORK_CLIENT_LIST_CHAT_COMPANY_TOO
 
STR_NETWORK_CLIENT_LIST_CHAT_SPECTATOR_TOOLTIP                  :{BLACK}Send a message to all spectators
 
STR_NETWORK_CLIENT_LIST_SPECTATORS                              :Spectators
 
STR_NETWORK_CLIENT_LIST_NEW_COMPANY                             :(New company)
 
STR_NETWORK_CLIENT_LIST_NEW_COMPANY_TOOLTIP                     :{BLACK}Create a new company and join it
 
STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP                :{BLACK}This is you
 
STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP                :{BLACK}This is the host of the game
 
STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT                    :{BLACK}{NUM} client{P "" s} / {NUM} compan{P y ies}
 

	
 
STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK                       :Kick
 
STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN                        :Ban
 
STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET                     :Delete
 
STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_UNLOCK                    :Password unlock
 

	
src/network/network_gui.cpp
Show inline comments
 
@@ -1624,13 +1624,16 @@ static const NWidgetPart _nested_client_
 
				NWidget(NWID_SPACER), SetMinimalSize(20, 0),
 
				NWidget(WWT_TEXT, COLOUR_GREY, WID_CL_CLIENT_NAME), SetFill(1, 0), SetMinimalTextLines(1, 0), SetResize(1, 0), SetDataTip(STR_BLACK_RAW_STRING, STR_NETWORK_CLIENT_LIST_PLAYER_NAME_TOOLTIP), SetAlignment(SA_VERT_CENTER | SA_RIGHT),
 
				NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_CL_CLIENT_NAME_EDIT), SetMinimalSize(12, 14), SetDataTip(SPR_RENAME, STR_NETWORK_CLIENT_LIST_PLAYER_NAME_EDIT_TOOLTIP),
 
			EndContainer(),
 
		EndContainer(),
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(WWT_MATRIX, COLOUR_GREY, WID_CL_MATRIX), SetMinimalSize(180, 0), SetResize(1, 1), SetFill(1, 1), SetMatrixDataTip(1, 0, STR_NULL), SetScrollbar(WID_CL_SCROLLBAR),
 
			NWidget(NWID_VERTICAL),
 
				NWidget(WWT_MATRIX, COLOUR_GREY, WID_CL_MATRIX), SetMinimalSize(180, 0), SetResize(1, 1), SetFill(1, 1), SetMatrixDataTip(1, 0, STR_NULL), SetScrollbar(WID_CL_SCROLLBAR),
 
				NWidget(WWT_TEXT, COLOUR_GREY, WID_CL_CLIENT_COMPANY_COUNT), SetFill(1, 0), SetMinimalTextLines(1, 0), SetResize(1, 0), SetPadding(2, 1, 2, 1), SetAlignment(SA_CENTER), SetDataTip(STR_NETWORK_CLIENT_LIST_CLIENT_COMPANY_COUNT, STR_NULL),
 
			EndContainer(),
 
			NWidget(NWID_VERTICAL),
 
				NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_CL_SCROLLBAR),
 
				NWidget(WWT_RESIZEBOX, COLOUR_GREY),
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
@@ -2047,12 +2050,17 @@ public:
 
				SetDParam(0, _server_visibility_dropdown[_settings_client.network.server_advertise]);
 
				break;
 

	
 
			case WID_CL_CLIENT_NAME:
 
				SetDParamStr(0, _settings_client.network.client_name);
 
				break;
 

	
 
			case WID_CL_CLIENT_COMPANY_COUNT:
 
				SetDParam(0, NetworkClientInfo::GetNumItems());
 
				SetDParam(1, Company::GetNumItems());
 
				break;
 
		}
 
	}
 

	
 
	void OnClick(Point pt, int widget, int click_count) override
 
	{
 
		switch (widget) {
src/widgets/network_widget.h
Show inline comments
 
@@ -103,12 +103,13 @@ enum ClientListWidgets {
 
	WID_CL_SERVER_VISIBILITY,          ///< Server visibility.
 
	WID_CL_CLIENT_NAME,                ///< Client name.
 
	WID_CL_CLIENT_NAME_EDIT,           ///< Edit button for client name.
 
	WID_CL_MATRIX,                     ///< Company/client list.
 
	WID_CL_SCROLLBAR,                  ///< Scrollbar for company/client list.
 
	WID_CL_COMPANY_JOIN,               ///< Used for QueryWindow when a company has a password.
 
	WID_CL_CLIENT_COMPANY_COUNT,       ///< Count of clients and companies.
 
};
 

	
 
/** Widgets of the #NetworkJoinStatusWindow class. */
 
enum NetworkJoinStatusWidgets {
 
	WID_NJS_BACKGROUND, ///< Background of the window.
 
	WID_NJS_CANCELOK,   ///< Cancel / OK button.
0 comments (0 inline, 0 general)