Compare commits
24 Commits
master
...
origin_14.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdff0d37ec | ||
|
|
33b63dbd55 | ||
|
|
c5416bcd63 | ||
|
|
56defd5a4c | ||
| 24b93febeb | |||
|
|
991440009a | ||
| 740b6a4c4e | |||
|
|
c2dbe3923e | ||
|
|
349322cad0 | ||
|
|
a52c2f1413 | ||
|
|
15475d644d | ||
|
|
472cac5e15 | ||
|
|
a4c524dd06 | ||
|
|
ab587a163a | ||
|
|
b11f5a76a9 | ||
|
|
f9a2f4e8a2 | ||
| e776135d7d | |||
|
|
93871cc260 | ||
|
|
c7daaa1f0d | ||
|
|
5782b849a6 | ||
|
|
6603de47ff | ||
|
|
6afde1cb7d | ||
| d165533e9a | |||
|
|
269a557c6f |
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,13 @@ namespace citymania {
|
||||
|
||||
void ShowCommandsToolbar();
|
||||
void ShowLoginWindow();
|
||||
void CheckAdmin();
|
||||
void ShowAdminCompanyButtons(int left, int top, int width, int company2, bool draw, bool redraw);
|
||||
void JoinLastServer(int left, int top, int height);
|
||||
void CreateCommunityServerList();
|
||||
void ShowServerButtons(int left, int top, int height);
|
||||
|
||||
bool GetAdmin();
|
||||
|
||||
} // namespace citymania
|
||||
|
||||
|
||||
@@ -678,4 +678,15 @@ std::string GetStationCoverageProductionText(TileIndex tile, int w, int h, int r
|
||||
return s.str();
|
||||
}
|
||||
|
||||
/* enable/disable catchment area with ctrl+click on a station */
|
||||
void ShowCatchmentByClick(StationID station)
|
||||
{
|
||||
if (_viewport_highlight_station != nullptr) {
|
||||
if (_viewport_highlight_station == Station::Get(station))
|
||||
SetViewportCatchmentStation(Station::Get(station), false);
|
||||
else SetViewportCatchmentStation(Station::Get(station), true);
|
||||
}
|
||||
else SetViewportCatchmentStation(Station::Get(station), true);
|
||||
}
|
||||
|
||||
} // namespace citymania
|
||||
|
||||
@@ -39,6 +39,7 @@ void SelectStationToJoin(const Station *station);
|
||||
void MarkCoverageHighlightDirty();
|
||||
bool CheckRedrawStationCoverage();
|
||||
void AbortStationPlacement();
|
||||
void ShowCatchmentByClick(StationID station);
|
||||
|
||||
std::string GetStationCoverageProductionText(TileIndex tile, int w, int h, int rad, StationCoverageType sct);
|
||||
|
||||
|
||||
@@ -49,9 +49,12 @@
|
||||
|
||||
#include "citymania/cm_hotkeys.hpp"
|
||||
#include "citymania/cm_main.hpp"
|
||||
#include "citymania/cm_commands_gui.hpp"
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
/* Admin company buttons */
|
||||
bool Show_ACB[15];
|
||||
|
||||
/** Company GUI constants. */
|
||||
static void DoSelectCompanyManagerFace(Window *parent);
|
||||
@@ -2196,6 +2199,10 @@ static constexpr NWidgetPart _nested_company_widgets[] = {
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_C_RELOCATE_HQ), SetDataTip(STR_COMPANY_VIEW_RELOCATE_HQ, STR_COMPANY_VIEW_RELOCATE_COMPANY_HEADQUARTERS),
|
||||
NWidget(NWID_SPACER),
|
||||
EndContainer(),
|
||||
/* Admin company buttons */
|
||||
NWidget(NWID_SELECTION, INVALID_COLOUR, CM_WID_C_SELECT_ADMINBUTTONS),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, CM_WID_C_ADMINBUTTONS), SetDataTip(CM_STR_ACB_COMPANY_ADMIN_BUTTON, CM_STR_ACB_COMPANY_ADMIN_BUTTON_TOOLTIP),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
|
||||
@@ -2225,14 +2232,6 @@ static constexpr NWidgetPart _nested_company_widgets[] = {
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_C_COMPANY_PASSWORD), SetDataTip(STR_COMPANY_VIEW_PASSWORD, STR_COMPANY_VIEW_PASSWORD_TOOLTIP),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_C_COMPANY_JOIN), SetDataTip(STR_COMPANY_VIEW_JOIN, STR_COMPANY_VIEW_JOIN_TOOLTIP),
|
||||
EndContainer(),
|
||||
// NWidget(NWID_SELECTION, INVALID_COLOUR, WID_C_SELECT_MOD),
|
||||
// NWidget(NWID_SPACER), SetMinimalSize(0, 0), SetFill(0, 1),
|
||||
// NWidget(NWID_VERTICAL), SetPIP(4, 2, 4),
|
||||
// NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_C_MOD_COMPANY_JOIN), SetFill(1, 0), SetDataTip(STR_MOD_COMPANY_JOIN_BUTTON, STR_NULL),
|
||||
// NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_C_MOD_COMPANY_TOGGLE_LOCK), SetFill(1, 0), SetDataTip(STR_MOD_TOGGLE_LOCK_BUTTON, STR_NULL),
|
||||
// NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_C_MOD_COMPANY_RESET), SetFill(1, 0), SetDataTip(STR_MOD_COMPANY_RESET_BUTTON, STR_NULL),
|
||||
// EndContainer(),
|
||||
// EndContainer(),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
@@ -2257,14 +2256,6 @@ static const StringID _company_view_vehicle_count_strings[] = {
|
||||
/**
|
||||
* Window with general information about a company
|
||||
*/
|
||||
static void ResetCallback(Window *w, bool confirmed)
|
||||
{
|
||||
if (confirmed) {
|
||||
CompanyID company2 = (CompanyID)w->window_number;
|
||||
citymania::NetworkClientSendChatToServer(fmt::format("!reset {}", company2 + 1));
|
||||
}
|
||||
}
|
||||
|
||||
struct CompanyWindow : Window
|
||||
{
|
||||
CompanyWidgets query_widget;
|
||||
@@ -2302,6 +2293,10 @@ struct CompanyWindow : Window
|
||||
/* Button bar selection. */
|
||||
reinit |= this->GetWidget<NWidgetStacked>(WID_C_SELECT_BUTTONS)->SetDisplayedPlane(local ? 0 : SZSP_NONE);
|
||||
|
||||
/* Admin company buttons: show/hide admin menue button from param of citymania.cfg */
|
||||
citymania::CheckAdmin();
|
||||
reinit |= this->GetWidget<NWidgetStacked>(CM_WID_C_SELECT_ADMINBUTTONS)->SetDisplayedPlane(citymania::GetAdmin() ? 0 : SZSP_NONE);
|
||||
|
||||
/* Build HQ button handling. */
|
||||
reinit |= this->GetWidget<NWidgetStacked>(WID_C_SELECT_VIEW_BUILD_HQ)->SetDisplayedPlane((local && c->location_of_HQ == INVALID_TILE) ? CWP_VB_BUILD : CWP_VB_VIEW);
|
||||
|
||||
@@ -2321,17 +2316,13 @@ struct CompanyWindow : Window
|
||||
|
||||
if (reinit) {
|
||||
this->ReInit();
|
||||
/* Admin company buttons: recall buttons while join/leave company */
|
||||
if (Show_ACB[this->window_number]) citymania::ShowAdminCompanyButtons(this->left, this->top, this->width, this->window_number + 1, Show_ACB[this->window_number], true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// if(!_networking) {
|
||||
// this->SetWidgetDisabledState(CW_WIDGET_COMPANY_RESUME, true);
|
||||
// this->SetWidgetDisabledState(CW_WIDGET_COMPANY_SUSPEND, true);
|
||||
// this->SetWidgetDisabledState(CW_WIDGET_COMPANY_RESET, true);
|
||||
// this->SetWidgetDisabledState(CW_WIDGET_COMPANY_JOIN2, true);
|
||||
// }
|
||||
|
||||
/* Admin company buttons: recall buttons while moving company window */
|
||||
if (Show_ACB[this->window_number]) citymania::ShowAdminCompanyButtons(this->left, this->top, this->width, this->window_number + 1, Show_ACB[this->window_number], false);
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
@@ -2389,19 +2380,14 @@ struct CompanyWindow : Window
|
||||
size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_GIVE_MONEY_BUTTON).width);
|
||||
size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_HOSTILE_TAKEOVER_BUTTON).width);
|
||||
size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_PASSWORD).width);
|
||||
size->width = std::max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_JOIN).width);
|
||||
|
||||
size->width += padding.width;
|
||||
break;
|
||||
|
||||
// case CW_WIDGET_COMPANY_RESUME:
|
||||
// case CW_WIDGET_COMPANY_SUSPEND:
|
||||
// case CW_WIDGET_COMPANY_RESET:
|
||||
// case CW_WIDGET_COMPANY_JOIN2:
|
||||
// if(!_novarole){
|
||||
// size->width = 0;
|
||||
// size->height = 0;
|
||||
// }
|
||||
// break;
|
||||
/* Admin company buttons */
|
||||
case CM_WID_C_ADMINBUTTONS:
|
||||
size->width = std::max(size->width, GetStringBoundingBox(CM_STR_ACB_COMPANY_ADMIN_BUTTON).width);
|
||||
|
||||
case WID_C_HAS_PASSWORD:
|
||||
if (_networking) *size = maxdim(*size, GetSpriteSize(SPR_LOCK));
|
||||
break;
|
||||
@@ -2624,27 +2610,12 @@ struct CompanyWindow : Window
|
||||
MarkWholeScreenDirty();
|
||||
break;
|
||||
}
|
||||
|
||||
case WID_C_MOD_COMPANY_JOIN: {
|
||||
if (!_novarole) return;
|
||||
/* Admin company buttons: show/hide buttons */
|
||||
case CM_WID_C_ADMINBUTTONS: {
|
||||
CompanyID company2 = (CompanyID)this->window_number;
|
||||
// this->query_widget = WID_C_MOD_COMPANY_JOIN;
|
||||
citymania::NetworkClientSendChatToServer(fmt::format("!move {}", company2 + 1));
|
||||
MarkWholeScreenDirty();
|
||||
break;
|
||||
}
|
||||
case WID_C_MOD_COMPANY_RESET: {
|
||||
if (!_networking) return;
|
||||
this->query_widget = WID_C_MOD_COMPANY_RESET;
|
||||
ShowQuery(CM_STR_XI_RESET_CAPTION, CM_STR_XI_REALY_RESET, this, ResetCallback);
|
||||
MarkWholeScreenDirty();
|
||||
break;
|
||||
}
|
||||
case WID_C_MOD_COMPANY_TOGGLE_LOCK: {
|
||||
if (!_novarole) return;
|
||||
CompanyID company2 = (CompanyID)this->window_number;
|
||||
citymania::NetworkClientSendChatToServer(fmt::format("!lockp {}", company2 + 1));
|
||||
MarkWholeScreenDirty();
|
||||
if (!Show_ACB[company2]) Show_ACB[company2] = true;
|
||||
else Show_ACB[company2] = false;
|
||||
citymania::ShowAdminCompanyButtons(this->left, this->top, this->width,company2 + 1, Show_ACB[company2], false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2702,6 +2673,14 @@ struct CompanyWindow : Window
|
||||
OnResize();
|
||||
}
|
||||
}
|
||||
|
||||
/* Admin company buttons: close window */
|
||||
void Close([[maybe_unused]] int data) override
|
||||
{
|
||||
if (FindWindowById(CM_WC_ADMIN_COMPANY_BUTTONS,this->window_number+1))
|
||||
CloseWindowById(CM_WC_ADMIN_COMPANY_BUTTONS,this->window_number+1);
|
||||
this->Window::Close();
|
||||
}
|
||||
};
|
||||
|
||||
static WindowDesc _company_desc(__FILE__, __LINE__,
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "table/sprites.h"
|
||||
|
||||
#include "citymania/cm_hotkeys.hpp"
|
||||
#include "citymania/cm_commands_gui.hpp"
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
@@ -297,6 +298,10 @@ struct SelectGameWindow : public Window {
|
||||
DrawStringMultiLine(r.left, r.right, r.top, r.bottom, STR_INTRO_TRANSLATION, TC_FROMSTRING, SA_CENTER);
|
||||
break;
|
||||
}
|
||||
/* last server widget */
|
||||
citymania::CreateCommunityServerList();
|
||||
citymania::JoinLastServer(this->left, this->top, this->height);
|
||||
citymania::ShowServerButtons(this->left, this->top, this->height + 28);
|
||||
}
|
||||
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
|
||||
@@ -452,7 +457,9 @@ static constexpr NWidgetPart _nested_select_game_widgets[] = {
|
||||
|
||||
/* 'Exit' button */
|
||||
NWidget(NWID_HORIZONTAL), SetPIPRatio(1, 0, 1),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(138, 0), SetFill(1, 0),
|
||||
NWidget(WWT_PUSHTXTBTN, COLOUR_ORANGE, WID_SGI_EXIT), SetMinimalSize(128, 0), SetDataTip(STR_INTRO_QUIT, STR_INTRO_TOOLTIP_QUIT),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(138, 0), SetFill(1, 0),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
|
||||
@@ -5951,6 +5951,8 @@ CM_STR_TOOLBAR_COMMANDS_HINT_CAPTION :{BLACK}CB Hint
|
||||
CM_STR_TOOLBAR_COMMANDS_HINT_TOOLTIP :{BLACK}Send !hint command to server(Shows town demand in CB mode).
|
||||
CM_STR_TOOLBAR_COMMANDS_LOGIN_CAPTION :{BLACK}Login
|
||||
CM_STR_TOOLBAR_COMMANDS_LOGIN_TOOLTIP :{BLACK}Send !login command to server.
|
||||
CM_STR_TOOLBAR_COMMANDS_LOGOUT_CAPTION :{BLACK}Logout
|
||||
CM_STR_TOOLBAR_COMMANDS_LOGOUT_TOOLTIP :{BLACK}Send !logout command to server.
|
||||
CM_STR_TOOLBAR_COMMANDS_TIMELEFT_CAPTION :{BLACK}Timeleft
|
||||
CM_STR_TOOLBAR_COMMANDS_TIMELEFT_TOOLTIP :{BLACK}Send !timeleft command to server.
|
||||
CM_STR_TOOLBAR_COMMANDS_NS_CAPTION :{BLACK}CM{NUM}
|
||||
@@ -6198,14 +6200,17 @@ 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 :{WHITE}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_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
|
||||
@@ -6215,6 +6220,7 @@ CM_STR_LOGIN_WINDOW_CHANGE_PASSWORD_HELPTEXT :{BLACK}Change p
|
||||
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
|
||||
@@ -6297,7 +6303,7 @@ 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 :CityMania server login
|
||||
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:
|
||||
@@ -6316,3 +6322,61 @@ CM_STR_SHOW_HIDDEN_ENGINES_VEHICLE_TRAIN :{BLACK}Show
|
||||
CM_STR_SHOW_HIDDEN_ENGINES_VEHICLE_ROAD_VEHICLE :{BLACK}Show hidden ({NUM})
|
||||
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.
|
||||
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
|
||||
CM_STR_ACB_UNLOCK_TOOLTIP :{BLACK}Unlock Company making possible player(s) joining it again.
|
||||
CM_STR_ACB_KNOWN :{BLACK}Known
|
||||
CM_STR_ACB_KNOWN_TOOLTIP :{BLACK}Show the known player(s) of company.
|
||||
CM_STR_ACB_RESET_KNOWN :{BLACK}Reset Known
|
||||
CM_STR_ACB_RESET_KNOWN_TOOLTIP :{BLACK}Reset list of known players of company.
|
||||
CM_STR_ACB_MOVE_PLAYER_TO :{BLACK}Move to ...
|
||||
CM_STR_ACB_MOVE_PLAYER_TO_TOOLTIP :{BLACK}Move a player (number #.. or name) to company
|
||||
CM_STR_ACB_COMPANY_NEWSTICKET_BUTTON :{BLACK}News
|
||||
CM_STR_ACB_COMPANY_NEWSTICKET_BUTTON_TOOLTIP :{BLACK}Open a Newspapper message directed to Company
|
||||
CM_STR_ACB_COMPANY_NEWSTICKET_BUTTON_COMP :{BLACK}News (P. C.)
|
||||
CM_STR_ACB_COMPANY_NEWSTICKET_BUTTON_COMP_TOOLTIP :{BLACK}Open a Newspapper message only showed to Company
|
||||
CM_STR_ACB_SUSPEND :{BLACK}Suspend
|
||||
CM_STR_ACB_SUSPEND_TOOLTIP :{BLACK}Suspend Company actions keeping player in the company.
|
||||
CM_STR_ACB_UNSUSPEND :{BLACK}Unsuspend
|
||||
CM_STR_ACB_UNSUSPEND_TOOLTIP :{BLACK}Unsuspend Company actions.
|
||||
CM_STR_ACB_EMPTY :{BLACK}Empty
|
||||
CM_STR_ACB_EMPTY_TOOLTIP :{BLACK}Send players in company to Spectators.
|
||||
CM_STR_ACB_RESET :{BLACK}Reset
|
||||
CM_STR_ACB_RESET_TOOLTIP :{BLACK}Reset the company. The company must be empty.
|
||||
CM_STR_ACB_RESET_SPEC :{BLACK}Reset Spec
|
||||
CM_STR_ACB_RESET_SPEC_TOOLTIP :{BLACK}Reset company and send player(s) to spectators.
|
||||
CM_STR_ACB_RESET_KICK :{BLACK}Reset Kick
|
||||
CM_STR_ACB_RESET_KICK_TOOLTIP :{BLACK}Reset company and Kick out of the game player(s) on it.
|
||||
CM_STR_ACB_RESET_TIMER_120 :{BLACK}Reset T. 2m
|
||||
CM_STR_ACB_RESET_TIMER_120_TOOLTIP :{BLACK}Starts a timer to reset company when after 2 minutes countdown.
|
||||
CM_STR_ACB_RESET_TIMER :{BLACK}Reset T....
|
||||
CM_STR_ACB_RESET_TIMER_TOOLTIP :{BLACK}Starts a timer to reset company when time expire (time is Admin input).
|
||||
CM_STR_ACB_RESET_TIMER_VALUE :{BLACK}Time to Reset (seconds):
|
||||
CM_STR_ACB_RESET_TIMER_CANCEL :{BLACK}Cancel Reset
|
||||
CM_STR_ACB_RESET_TIMER_CANCEL_TOOLTIP :{BLACK}Cancel the Reset timer.
|
||||
CM_STR_ACB_AWARNING :{BLACK}Warning
|
||||
CM_STR_ACB_AWARNING_TOOLTIP :{BLACK}Sends a Warning to company that an admin is trying to contact.
|
||||
CM_STR_ACB_RESET_COMP :{BLACK}RESET Company
|
||||
CM_STR_ACB_RESET_COMP_SURE :{WHITE}Sure to RESET this company?
|
||||
CM_STR_ACB_RESET_SPEC_SURE :{WHITE}Sure to RESET this company, send players to SPECTATORS?
|
||||
CM_STR_ACB_RESET_KICK_SURE :{WHITE}Sure to RESET this company, and KICK players on it?
|
||||
CM_STR_ACB_PLAYER_NEWSTICKET :{BLACK}Type message as newspapper ticket to this Player
|
||||
CM_STR_ACB_COMPANY_NEWSTICKET :{BLACK}Type message as newspapper ticket to this Company
|
||||
CM_STR_ACB_COMPANY_JOIN2 :{BLACK}A. Join
|
||||
CM_STR_ACB_COMPANY_JOIN2_TOOLTIP :{BLACK}Join as an admin
|
||||
|
||||
### Server buttons ###
|
||||
CM_STR_SB_SELECT_NICE :{BLACK}N-ice
|
||||
CM_STR_SB_SELECT_BTPRO :{BLACK}BTPro
|
||||
CM_STR_SB_SELECT_CITYMANIA :{BLACK}Citymania
|
||||
CM_STR_SB_SERVER_LIST_UNREACHABLE :{WHITE}Couldn't get server details
|
||||
CM_STR_SB_SERVER_DISABLED :{WHITE}Server is Disabled / Offline
|
||||
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.
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "../citymania/cm_client_list_gui.hpp"
|
||||
#include "../citymania/cm_commands.hpp"
|
||||
#include "../citymania/cm_newgrf_revisions.hpp"
|
||||
#include "../citymania/cm_commands_gui.hpp" /* Admin company buttons */
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
@@ -1227,7 +1228,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_CONFIG_UPDATE(P
|
||||
_network_server_max_companies = p.Recv_uint8();
|
||||
_network_server_name = p.Recv_string(NETWORK_NAME_LENGTH);
|
||||
SetWindowClassesDirty(WC_CLIENT_LIST);
|
||||
|
||||
citymania::CreateCommunityServerList(); //@cm_commands_gui.cpp
|
||||
Debug(net, 9, "Client::Receive_SERVER_CONFIG_UPDATE(): max_companies={}", _network_server_max_companies);
|
||||
|
||||
return NETWORK_RECV_STATUS_OKAY;
|
||||
@@ -1325,7 +1326,8 @@ void NetworkClientsToSpectators(CompanyID cid)
|
||||
NetworkTextMessage(NETWORK_ACTION_COMPANY_SPECTATOR, CC_DEFAULT, false, ci->client_name);
|
||||
ci->client_playas = COMPANY_SPECTATOR;
|
||||
}
|
||||
|
||||
/* Admin company buttons: delete window */
|
||||
citymania::ShowAdminCompanyButtons(0, 0, 0, cid+1, false, false);
|
||||
cur_company.Restore();
|
||||
}
|
||||
|
||||
|
||||
@@ -902,9 +902,8 @@ static CommandCost CmdRailTrackHelper(DoCommandFlag flags, TileIndex tile, TileI
|
||||
bool had_success = false;
|
||||
CommandCost last_error = CMD_ERROR;
|
||||
for (;;) {
|
||||
ret = remove ? Command<CMD_REMOVE_SINGLE_RAIL>::Do(flags, tile, TrackdirToTrack(trackdir)) : Command<CMD_BUILD_SINGLE_RAIL>::Do(flags, tile, railtype, TrackdirToTrack(trackdir), auto_remove_signals);
|
||||
|
||||
TileIndex last_endtile = _rail_track_endtile; // CM
|
||||
ret = remove ? Command<CMD_REMOVE_SINGLE_RAIL>::Do(flags, tile, TrackdirToTrack(trackdir)) : Command<CMD_BUILD_SINGLE_RAIL>::Do(flags, tile, railtype, TrackdirToTrack(trackdir), auto_remove_signals);
|
||||
if (ret.Failed()) {
|
||||
last_error = ret;
|
||||
if (_rail_track_endtile == INVALID_TILE) _rail_track_endtile = last_endtile; // CM
|
||||
|
||||
@@ -2202,6 +2202,7 @@ static WindowDesc _station_view_desc(__FILE__, __LINE__,
|
||||
*/
|
||||
void ShowStationViewWindow(StationID station)
|
||||
{
|
||||
if (_ctrl_pressed) citymania::ShowCatchmentByClick(station); else
|
||||
AllocateWindowDescFront<StationViewWindow>(&_station_view_desc, station);
|
||||
}
|
||||
|
||||
|
||||
@@ -282,6 +282,11 @@ void ShowStatusBar()
|
||||
}
|
||||
|
||||
void CM_RedrawStatusBar() {
|
||||
StatusBarWindow *w = dynamic_cast<StatusBarWindow*>(FindWindowById(WC_STATUS_BAR, 0));
|
||||
w->ReInit();
|
||||
Window *w = FindWindowById(WC_STATUS_BAR, 0);
|
||||
|
||||
if (w == nullptr) return;
|
||||
|
||||
StatusBarWindow *st = static_cast<StatusBarWindow*>(w);
|
||||
|
||||
st->ReInit();
|
||||
}
|
||||
|
||||
@@ -52,11 +52,8 @@ enum CompanyWidgets : WidgetID {
|
||||
WID_C_COMPANY_PASSWORD, ///< Button to set company password.
|
||||
WID_C_COMPANY_JOIN, ///< Button to join company.
|
||||
|
||||
WID_C_SELECT_MOD,
|
||||
WID_C_SELECT_MOD_JOIN,
|
||||
WID_C_MOD_COMPANY_JOIN,
|
||||
WID_C_MOD_COMPANY_RESET,
|
||||
WID_C_MOD_COMPANY_TOGGLE_LOCK,
|
||||
CM_WID_C_SELECT_ADMINBUTTONS,
|
||||
CM_WID_C_ADMINBUTTONS,
|
||||
};
|
||||
|
||||
/** Widgets of the #CompanyFinancesWindow class. */
|
||||
|
||||
@@ -732,6 +732,9 @@ enum WindowClass {
|
||||
CM_WC_COMMAND_TOOLBAR,
|
||||
CM_WC_LOGIN_WINDOW,
|
||||
CM_WC_CB_TOWN,
|
||||
CM_WC_ADMIN_COMPANY_BUTTONS,
|
||||
CM_WC_SERVER_BUTTONS,
|
||||
CM_LAST_SERVER,
|
||||
|
||||
WC_INVALID = 0xFFFF, ///< Invalid window.
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user