Skip to content

Commit

Permalink
Fix: admin join; update: several language strings
Browse files Browse the repository at this point in the history
  • Loading branch information
AdminChucky committed Jun 28, 2024
1 parent fa57e8a commit 1df440a
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 91 deletions.
28 changes: 14 additions & 14 deletions src/citymania/cm_commands_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ struct AdminCompanyButtonsWindow : Window {

virtual void OnClick([[maybe_unused]] Point pt, int widget,[[maybe_unused]] int click_count)

Check warning on line 1083 in src/citymania/cm_commands_gui.cpp

View workflow job for this annotation

GitHub Actions / Mac OS (arm64)

'OnClick' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

Check warning on line 1083 in src/citymania/cm_commands_gui.cpp

View workflow job for this annotation

GitHub Actions / Emscripten

'OnClick' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

Check warning on line 1083 in src/citymania/cm_commands_gui.cpp

View workflow job for this annotation

GitHub Actions / Linux (Clang - Debug)

'OnClick' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

Check warning on line 1083 in src/citymania/cm_commands_gui.cpp

View workflow job for this annotation

GitHub Actions / Linux (GCC - SDL2)

‘virtual void citymania::AdminCompanyButtonsWindow::OnClick(Point, int, int)’ can be marked override [-Wsuggest-override]

Check warning on line 1083 in src/citymania/cm_commands_gui.cpp

View workflow job for this annotation

GitHub Actions / Linux (GCC - SDL1.2)

‘virtual void citymania::AdminCompanyButtonsWindow::OnClick(Point, int, int)’ can be marked override [-Wsuggest-override]

Check warning on line 1083 in src/citymania/cm_commands_gui.cpp

View workflow job for this annotation

GitHub Actions / Linux (Clang - Release)

'OnClick' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
{
if(!_networking) return;

int _company = this->window_number;
switch (widget) {
case ACB_COMPANY_EMPTY:
Expand Down Expand Up @@ -1157,7 +1157,7 @@ struct AdminCompanyButtonsWindow : Window {
MarkWholeScreenDirty();
break;
case ACB_COMPANY_JOIN2:
NetworkClientSendChatToServer(fmt::format("!move #{} {}",_network_own_client_id ,_company));
NetworkClientSendChatToServer(fmt::format("!move #{} {}",_network_own_client_id, _company));
MarkWholeScreenDirty();
break;
case ACB_COMPANY_LEAVE:
Expand Down Expand Up @@ -1424,23 +1424,23 @@ static const NWidgetPart _nested_login_window_widgets[] = {
NWidget(WWT_TEXT, COLOUR_BROWN, LWW_USERNAME), SetDataTip(CM_STR_LOGIN_WINDOW_USERNAME, 0),
NWidget(NWID_SPACER), SetMinimalSize(5, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, LWW_USER_NAME), SetMinimalSize(100, 15), SetFill(1, 1),
SetDataTip(CM_STR_LOGIN_WINDOW_USERNAME_DISPLAY, CM_STR_LOGIN_WINDOW_CHANGE_USERNAME_HELPTEXT),
SetDataTip(CM_STR_LOGIN_WINDOW_USERNAME_DISPLAY, CM_STR_LOGIN_WINDOW_CHANGE_USERNAME_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(20, 0),
NWidget(WWT_TEXT, COLOUR_BROWN, LWW_PASSWORD), SetDataTip(CM_STR_LOGIN_WINDOW_PASSWORD, 0),
NWidget(NWID_SPACER), SetMinimalSize(5, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, LWW_USER_PW), SetMinimalSize(50, 15), SetFill(1, 1),
SetDataTip(CM_STR_LOGIN_WINDOW_PASSWORD_DISPLAY, CM_STR_LOGIN_WINDOW_CHANGE_PASSWORD_HELPTEXT),
SetDataTip(CM_STR_LOGIN_WINDOW_PASSWORD_DISPLAY, CM_STR_LOGIN_WINDOW_CHANGE_PASSWORD_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(45, 0),
EndContainer(),
NWidget(NWID_SPACER), SetMinimalSize(0, 20),
//login and logout
NWidget(NWID_HORIZONTAL),

Check failure on line 1437 in src/citymania/cm_commands_gui.cpp

View workflow job for this annotation

GitHub Actions / Commit checker

Use tabs for indentation
NWidget(NWID_SPACER), SetMinimalSize(105, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, LWW_USER_LOGIN), SetMinimalSize(40, 20), SetAlignment(SA_CENTER), SetFill(1, 1),
SetDataTip(CM_STR_TOOLBAR_COMMANDS_LOGIN_CAPTION, CM_STR_TOOLBAR_COMMANDS_LOGIN_TOOLTIP),
SetDataTip(CM_STR_LOGIN_WINDOW_LOGIN, CM_STR_LOGIN_WINDOW_LOGIN_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(10, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, LWW_USER_LOGOUT), SetMinimalSize(40, 20), SetAlignment(SA_CENTER), SetFill(1, 1),
SetDataTip(CM_STR_TOOLBAR_COMMANDS_LOGOUT_CAPTION, CM_STR_TOOLBAR_COMMANDS_LOGOUT_TOOLTIP),
SetDataTip(CM_STR_LOGIN_WINDOW_LOGOUT, CM_STR_LOGIN_WINDOW_LOGOUT_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(105, 0),
EndContainer(),
NWidget(NWID_SPACER), SetMinimalSize(0, 10),
Expand Down Expand Up @@ -1468,34 +1468,34 @@ static const NWidgetPart _nested_admin_window_widgets[] = {
NWidget(WWT_TEXT, COLOUR_BROWN, LWW_USERNAME), SetDataTip(CM_STR_LOGIN_WINDOW_USERNAME, 0),
NWidget(NWID_SPACER), SetMinimalSize(5, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, LWW_USER_NAME), SetMinimalSize(100, 15), SetFill(1, 1),
SetDataTip(CM_STR_LOGIN_WINDOW_USERNAME_DISPLAY, CM_STR_LOGIN_WINDOW_CHANGE_USERNAME_HELPTEXT),
SetDataTip(CM_STR_LOGIN_WINDOW_USERNAME_DISPLAY, CM_STR_LOGIN_WINDOW_CHANGE_USERNAME_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(10, 0),

Check failure on line 1472 in src/citymania/cm_commands_gui.cpp

View workflow job for this annotation

GitHub Actions / Commit checker

Use tabs for indentation
NWidget(WWT_TEXT, COLOUR_BROWN, LWW_PASSWORD), SetDataTip(CM_STR_LOGIN_WINDOW_PASSWORD, 0),
NWidget(NWID_SPACER), SetMinimalSize(5, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, LWW_USER_PW), SetMinimalSize(50, 15), SetFill(1, 1),
SetDataTip(CM_STR_LOGIN_WINDOW_PASSWORD_DISPLAY, CM_STR_LOGIN_WINDOW_CHANGE_PASSWORD_HELPTEXT),
SetDataTip(CM_STR_LOGIN_WINDOW_PASSWORD_DISPLAY, CM_STR_LOGIN_WINDOW_CHANGE_PASSWORD_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(10, 0),
NWidget(WWT_TEXT, COLOUR_BROWN, LWW_ADMIN_PW), SetDataTip(CM_STR_LOGIN_WINDOW_ADMIN_PASSWORD, 0),
NWidget(NWID_SPACER), SetMinimalSize(5, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, LWW_ADMIN_PW), SetMinimalSize(50, 15), SetFill(1, 1),
SetDataTip(CM_STR_LOGIN_WINDOW_PASSWORD_DISPLAY, CM_STR_LOGIN_WINDOW_CHANGE_PASSWORD_HELPTEXT),
SetDataTip(CM_STR_LOGIN_WINDOW_PASSWORD_DISPLAY, CM_STR_LOGIN_WINDOW_CHANGE_PASSWORD_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(15, 0),
EndContainer(),
NWidget(NWID_SPACER), SetMinimalSize(0, 20),
//login and logout
NWidget(NWID_HORIZONTAL),

Check failure on line 1486 in src/citymania/cm_commands_gui.cpp

View workflow job for this annotation

GitHub Actions / Commit checker

Use tabs for indentation
NWidget(NWID_SPACER), SetMinimalSize(15, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, LWW_USER_LOGIN), SetMinimalSize(40, 20), SetAlignment(SA_CENTER), SetFill(1, 1),
SetDataTip(CM_STR_TOOLBAR_COMMANDS_LOGIN_CAPTION, CM_STR_TOOLBAR_COMMANDS_LOGIN_TOOLTIP),
SetDataTip(CM_STR_LOGIN_WINDOW_LOGIN, CM_STR_LOGIN_WINDOW_LOGIN_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(10, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, LWW_USER_LOGOUT), SetMinimalSize(40, 20), SetAlignment(SA_CENTER), SetFill(1, 1),
SetDataTip(CM_STR_TOOLBAR_COMMANDS_LOGOUT_CAPTION, CM_STR_TOOLBAR_COMMANDS_LOGOUT_TOOLTIP),
SetDataTip(CM_STR_LOGIN_WINDOW_LOGOUT, CM_STR_LOGIN_WINDOW_LOGOUT_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(10, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, LWW_ADMIN_LOGIN), SetMinimalSize(40, 20), SetAlignment(SA_CENTER), SetFill(1, 1),
SetDataTip(CM_STR_LOGIN_WINDOW_ADMIN_LOGIN, CM_STR_TOOLBAR_COMMANDS_LOGIN_TOOLTIP),
SetDataTip(CM_STR_LOGIN_WINDOW_ADMIN_LOGIN, CM_STR_LOGIN_WINDOW_ADMIN_LOGIN_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(10, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, LWW_ADMIN_LOGOUT), SetMinimalSize(40, 20), SetAlignment(SA_CENTER), SetFill(1, 1),
SetDataTip(CM_STR_LOGIN_WINDOW_ADMIN_LOGOUT, CM_STR_TOOLBAR_COMMANDS_LOGOUT_TOOLTIP),
SetDataTip(CM_STR_LOGIN_WINDOW_ADMIN_LOGOUT, CM_STR_LOGIN_WINDOW_ADMIN_LOGOUT_TOOLTIP),
NWidget(NWID_SPACER), SetMinimalSize(15, 0),
EndContainer(),
NWidget(NWID_SPACER), SetMinimalSize(0, 10),
Expand Down Expand Up @@ -1545,7 +1545,7 @@ static const NWidgetPart _nested_last_server_widgets[] = {
NWidget(WWT_PANEL, COLOUR_BROWN), SetFill(0, 1),
NWidget(NWID_HORIZONTAL), SetPadding(WidgetDimensions::unscaled.sparse),
NWidget(NWID_SPACER), SetMinimalSize(81, 0), SetFill(1, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, LSW_BUTTON), SetMinimalSize(242, 15), SetAlignment(SA_CENTER), SetDataTip(STR_NETWORK_SERVER_LIST_CLICK_TO_SELECT_LAST, CM_STR_SB_NETWORK_DIRECT_JOIN_TOOLTIP), SetFill(1, 1),
NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, LSW_BUTTON), SetMinimalSize(242, 15), SetAlignment(SA_CENTER), SetDataTip(CM_STR_SB_LAST_SERVER, CM_STR_SB_NETWORK_DIRECT_JOIN_TOOLTIP), SetFill(1, 1),
NWidget(NWID_SPACER), SetMinimalSize(81, 0), SetFill(1, 0),
EndContainer(),
EndContainer(),
Expand Down
63 changes: 34 additions & 29 deletions src/lang/english.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6199,29 +6199,6 @@ CM_STR_CONFIG_SETTING_GRAPH_BACKGROUND_HELPTEXT :Main background
CM_STR_CONFIG_SETTING_GRAPH_BACKGROUND_BLACK :Black
CM_STR_CONFIG_SETTING_GRAPH_BACKGROUND_GREY :Light grey

# Community login window
CM_STR_LOGIN_WINDOW_CAPTION :{BLACK}Login Window
CM_STR_LOGIN_WINDOW_CITYMANIA :{BLACK}CityMania
CM_STR_LOGIN_WINDOW_NICE :{BLACK}N-ice
CM_STR_LOGIN_WINDOW_BTPRO :{BLACK}BTPro
CM_STR_LOGIN_ERROR_SIGN_IN_FAILED :{WHITE}Failed to connect
CM_STR_LOGIN_ERROR_BAD_INPUT :{WHITE}Bad username or password
CM_STR_LOGIN_WINDOW_USERNAME :{WHITE}Username:
CM_STR_LOGIN_WINDOW_PASSWORD :{WHITE}Password:
CM_STR_LOGIN_WINDOW_ADMIN_LOGIN :{BLACK}A-Login
CM_STR_LOGIN_WINDOW_ADMIN_LOGOUT :{BLACK}A-Logout
CM_STR_LOGIN_WINDOW_ADMIN_PASSWORD :{WHITE}Admin:
CM_STR_LOGIN_WINDOW_SET :{WHITE}Set
CM_STR_LOGIN_WINDOW_NOT_SET :{WHITE}Not Set
CM_STR_LOGIN_WINDOW_CHANGE_USERNAME :{WHITE}Change username
CM_STR_LOGIN_WINDOW_CHANGE_PASSWORD :{WHITE}Change password
CM_STR_LOGIN_WINDOW_CHANGE_USERNAME_HELPTEXT :{BLACK}Change username
CM_STR_LOGIN_WINDOW_CHANGE_PASSWORD_HELPTEXT :{BLACK}Change password
CM_STR_LOGIN_WINDOW_SIGN_IN_HELPTEXT :{BLACK}Sign in (you must be on the correct community server)
CM_STR_LOGIN_WINDOW_USERNAME_DISPLAY :{WHITE}{RAW_STRING}
CM_STR_LOGIN_WINDOW_PASSWORD_DISPLAY :{WHITE}{STRING}
CM_STR_LOGIN_WINDOW_WELCOME :{BLACK}Welcome to {STRING} community !

CM_STR_NETWORK_COMPANY_LIST_NEW_COMPANY :New company
CM_STR_NETWORK_COMPANY_LIST_SPECTATE :Spectate

Expand Down Expand Up @@ -6303,7 +6280,6 @@ CM_STR_CONFIG_SETTING_TYPE_DROPDOWN_CITYMANIA :CityMania patch
CM_BUILDING_PREVIEW_COST_ENOUGH :Cost

CM_STR_NO_BLUEPRINT_IN_SLOT :{WHITE}No blueprint in slot {NUM}
CM_STR_ABOUT_MENU_LOGIN_WINDOW :Community tools
CM_STR_BUILD_INFO_OVERLAY_COST_OK :{WHITE}Cost: {CURRENCY_LONG}
CM_STR_BUILD_INFO_OVERLAY_COST_NO_MONEY :{RED}Cost: {CURRENCY_LONG}
CM_STR_BUILD_INFO_OVERLAY_STATION_ACCEPTS :{WHITE}Accepts:
Expand All @@ -6323,10 +6299,38 @@ CM_STR_SHOW_HIDDEN_ENGINES_VEHICLE_ROAD_VEHICLE :{BLACK}Show hid
CM_STR_SHOW_HIDDEN_ENGINES_VEHICLE_SHIP :{BLACK}Show hidden ({NUM})
CM_STR_SHOW_HIDDEN_ENGINES_VEHICLE_AIRCRAFT :{BLACK}Show hidden ({NUM})

### Admin Company Buttons ###
CM_STR_ACB_COMPANY_ADMIN_CAPTION :{WHITE}Admin buttons #{NUM}
CM_STR_ACB_COMPANY_ADMIN_BUTTON :{WHITE}Admin buttons
CM_STR_ACB_COMPANY_ADMIN_BUTTON_TOOLTIP :{BLACK}Show / hide the admin buttons.
### Community login window
CM_STR_LOGIN_WINDOW_CAPTION :Login Window
CM_STR_LOGIN_WINDOW_CITYMANIA :{BLACK}CityMania
CM_STR_LOGIN_WINDOW_NICE :{BLACK}N-ice
CM_STR_LOGIN_WINDOW_BTPRO :{BLACK}BTPro
CM_STR_LOGIN_ERROR_SIGN_IN_FAILED :{WHITE}Failed to connect
CM_STR_LOGIN_ERROR_BAD_INPUT :{WHITE}Bad username or password
CM_STR_LOGIN_WINDOW_USERNAME :{WHITE}Username:
CM_STR_LOGIN_WINDOW_PASSWORD :{WHITE}Password:
CM_STR_LOGIN_WINDOW_LOGIN :{BLACK}Login
CM_STR_LOGIN_WINDOW_LOGIN_TOOLTIP :Send login to server
CM_STR_LOGIN_WINDOW_LOGOUT :{BLACK}Logout
CM_STR_LOGIN_WINDOW_LOGOUT_TOOLTIP :Send logout to server
CM_STR_LOGIN_WINDOW_ADMIN_LOGIN :{BLACK}A-Login
CM_STR_LOGIN_WINDOW_ADMIN_LOGIN_TOOLTIP :Send admin login to server
CM_STR_LOGIN_WINDOW_ADMIN_LOGOUT :{BLACK}A-Logout
CM_STR_LOGIN_WINDOW_ADMIN_LOGOUT_TOOLTIP :Send admin logout to server
CM_STR_LOGIN_WINDOW_ADMIN_PASSWORD :{WHITE}Admin:
CM_STR_LOGIN_WINDOW_SET :{WHITE}Set
CM_STR_LOGIN_WINDOW_NOT_SET :{WHITE}Not Set
CM_STR_LOGIN_WINDOW_CHANGE_USERNAME :{WHITE}Change username
CM_STR_LOGIN_WINDOW_CHANGE_PASSWORD :{WHITE}Change password
CM_STR_LOGIN_WINDOW_CHANGE_USERNAME_TOOLTIP :Enter your username here
CM_STR_LOGIN_WINDOW_CHANGE_PASSWORD_TOOLTIP :Enter your password here
CM_STR_LOGIN_WINDOW_USERNAME_DISPLAY :{WHITE}{RAW_STRING}
CM_STR_LOGIN_WINDOW_PASSWORD_DISPLAY :{WHITE}{STRING}
CM_STR_LOGIN_WINDOW_WELCOME :{BLACK}Welcome to {STRING} server !

### Admin company buttons
CM_STR_ACB_COMPANY_ADMIN_CAPTION :{WHITE}Admin commands #{NUM}
CM_STR_ACB_COMPANY_ADMIN_BUTTON :{WHITE}Admin commands
CM_STR_ACB_COMPANY_ADMIN_BUTTON_TOOLTIP :{BLACK}Show / hide the admin commands.
CM_STR_ACB_LOCK :{BLACK}Lock
CM_STR_ACB_LOCK_TOOLTIP :{BLACK}Lock Company. All players on it will be sent to spectators.
CM_STR_ACB_UNLOCK :{BLACK}Unlock
Expand Down Expand Up @@ -6371,7 +6375,7 @@ CM_STR_ACB_COMPANY_NEWSTICKET :{BLACK}Type mes
CM_STR_ACB_COMPANY_JOIN2 :{BLACK}A. Join
CM_STR_ACB_COMPANY_JOIN2_TOOLTIP :{BLACK}Join as an admin

### Server buttons ###
### Server buttons
CM_STR_SB_SELECT_NICE :{BLACK}N-ice
CM_STR_SB_SELECT_BTPRO :{BLACK}BTPro
CM_STR_SB_SELECT_CITYMANIA :{BLACK}Citymania
Expand All @@ -6380,3 +6384,4 @@ CM_STR_SB_SERVER_DISABLED :{WHITE}Server i
CM_STR_SB_SERVER_LIST_ERROR_FILE :{WHITE}Error on getting servers file
CM_STR_SB_NETWORK_DIRECT_JOIN_GAME :{BLACK}{RAW_STRING}
CM_STR_SB_NETWORK_DIRECT_JOIN_TOOLTIP :{BLACK}Hold CTRL and click for joining with new company.
CM_STR_SB_LAST_SERVER :{BLACK}Join the server you played last time
Loading

0 comments on commit 1df440a

Please sign in to comment.