Rename step console command to cmstep and move code to cm files
This commit is contained in:
@@ -23,6 +23,18 @@ static void IConsoleHelp(const char *str)
|
|||||||
IConsolePrintF(CC_WARNING, "- %s", str);
|
IConsolePrintF(CC_WARNING, "- %s", str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ConStep(byte argc, char *argv[]) {
|
||||||
|
if (argc == 0 || argc > 2) {
|
||||||
|
IConsoleHelp("Advances the game for a certain amount of ticks (default 1). Usage: 'cmstep [n]'");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
auto n = (argc > 1 ? atoi(argv[1]) : 1);
|
||||||
|
|
||||||
|
DoCommandP(0, PM_PAUSED_NORMAL, 0 | (n << 1), CMD_PAUSE);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ConExport(byte argc, char *argv[]) {
|
bool ConExport(byte argc, char *argv[]) {
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
IConsoleHelp("Exports various game data in json format to openttd.json file");
|
IConsoleHelp("Exports various game data in json format to openttd.json file");
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
namespace citymania {
|
namespace citymania {
|
||||||
|
|
||||||
|
bool ConStep(byte argc, char *argv[]);
|
||||||
bool ConExport(byte argc, char *argv[]);
|
bool ConExport(byte argc, char *argv[]);
|
||||||
bool ConTreeMap(byte argc, char *argv[]);
|
bool ConTreeMap(byte argc, char *argv[]);
|
||||||
|
|
||||||
|
|||||||
@@ -651,19 +651,6 @@ DEF_CONSOLE_CMD(ConUnpauseGame)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEF_CONSOLE_CMD(ConStepGame)
|
|
||||||
{
|
|
||||||
if (argc == 0 || argc > 2) {
|
|
||||||
IConsoleHelp("Advances the game for a certain amount of ticks (default 1). Usage: 'step [n]'");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
auto n = (argc > 1 ? atoi(argv[1]) : 1);
|
|
||||||
|
|
||||||
DoCommandP(0, PM_PAUSED_NORMAL, 0 | (n << 1), CMD_PAUSE);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEF_CONSOLE_CMD(ConRcon)
|
DEF_CONSOLE_CMD(ConRcon)
|
||||||
{
|
{
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
@@ -2186,7 +2173,6 @@ void IConsoleStdLibRegister()
|
|||||||
|
|
||||||
IConsoleCmdRegister("pause", ConPauseGame, ConHookServerOnly);
|
IConsoleCmdRegister("pause", ConPauseGame, ConHookServerOnly);
|
||||||
IConsoleCmdRegister("unpause", ConUnpauseGame, ConHookServerOnly);
|
IConsoleCmdRegister("unpause", ConUnpauseGame, ConHookServerOnly);
|
||||||
IConsoleCmdRegister("step", ConStepGame, ConHookNoNetwork);
|
|
||||||
|
|
||||||
IConsoleCmdRegister("company_pw", ConCompanyPassword, ConHookNeedNetwork);
|
IConsoleCmdRegister("company_pw", ConCompanyPassword, ConHookNeedNetwork);
|
||||||
IConsoleAliasRegister("company_password", "company_pw %+");
|
IConsoleAliasRegister("company_password", "company_pw %+");
|
||||||
@@ -2224,6 +2210,7 @@ void IConsoleStdLibRegister()
|
|||||||
IConsoleCmdRegister("reload_newgrfs", ConNewGRFReload, ConHookNewGRFDeveloperTool);
|
IConsoleCmdRegister("reload_newgrfs", ConNewGRFReload, ConHookNewGRFDeveloperTool);
|
||||||
IConsoleCmdRegister("newgrf_profile", ConNewGRFProfile, ConHookNewGRFDeveloperTool);
|
IConsoleCmdRegister("newgrf_profile", ConNewGRFProfile, ConHookNewGRFDeveloperTool);
|
||||||
|
|
||||||
|
IConsoleCmdRegister("cmstep", citymania::ConStep, ConHookNoNetwork);
|
||||||
IConsoleCmdRegister("cmexport", citymania::ConExport);
|
IConsoleCmdRegister("cmexport", citymania::ConExport);
|
||||||
IConsoleCmdRegister("cmtreemap", citymania::ConTreeMap, ConHookNoNetwork);
|
IConsoleCmdRegister("cmtreemap", citymania::ConTreeMap, ConHookNoNetwork);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user