mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-18 12:33:17 +01:00
Remove snake_case in interface folder
This commit is contained in:
@@ -83,15 +83,15 @@ static constexpr const char* ClimateNames[] = {
|
||||
"cold",
|
||||
};
|
||||
|
||||
static int32_t console_parse_int(const std::string& src, bool* valid);
|
||||
static double console_parse_double(const std::string& src, bool* valid);
|
||||
static int32_t ConsoleParseInt(const std::string& src, bool* valid);
|
||||
static double ConsoleParseDouble(const std::string& src, bool* valid);
|
||||
|
||||
static void console_write_all_commands(InteractiveConsole& console);
|
||||
static int32_t cc_variables(InteractiveConsole& console, const arguments_t& argv);
|
||||
static int32_t cc_windows(InteractiveConsole& console, const arguments_t& argv);
|
||||
static int32_t cc_help(InteractiveConsole& console, const arguments_t& argv);
|
||||
static void ConsoleWriteAllCommands(InteractiveConsole& console);
|
||||
static int32_t ConsoleCommandVariables(InteractiveConsole& console, const arguments_t& argv);
|
||||
static int32_t ConsoleCommandWindows(InteractiveConsole& console, const arguments_t& argv);
|
||||
static int32_t ConsoleCommandHelp(InteractiveConsole& console, const arguments_t& argv);
|
||||
|
||||
static bool invalidArguments(bool* invalid, bool arguments);
|
||||
static bool InvalidArguments(bool* invalid, bool arguments);
|
||||
|
||||
#define SET_FLAG(variable, flag, value) \
|
||||
{ \
|
||||
@@ -101,7 +101,7 @@ static bool invalidArguments(bool* invalid, bool arguments);
|
||||
variable &= ~(flag); \
|
||||
}
|
||||
|
||||
static int32_t console_parse_int(const std::string& src, bool* valid)
|
||||
static int32_t ConsoleParseInt(const std::string& src, bool* valid)
|
||||
{
|
||||
utf8* end;
|
||||
int32_t value;
|
||||
@@ -110,7 +110,7 @@ static int32_t console_parse_int(const std::string& src, bool* valid)
|
||||
return value;
|
||||
}
|
||||
|
||||
static double console_parse_double(const std::string& src, bool* valid)
|
||||
static double ConsoleParseDouble(const std::string& src, bool* valid)
|
||||
{
|
||||
utf8* end;
|
||||
double value;
|
||||
@@ -119,32 +119,32 @@ static double console_parse_double(const std::string& src, bool* valid)
|
||||
return value;
|
||||
}
|
||||
|
||||
static int32_t cc_clear(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandClear(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
console.Clear();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_close(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandClose(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
console.Close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_hide(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandHide(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
console.Hide();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_echo(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandEcho(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (!argv.empty())
|
||||
console.WriteLine(argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandRides(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (!argv.empty())
|
||||
{
|
||||
@@ -188,8 +188,8 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
|
||||
if (argv[1] == "type")
|
||||
{
|
||||
bool int_valid[2] = { false };
|
||||
int32_t ride_index = console_parse_int(argv[2], &int_valid[0]);
|
||||
int32_t type = console_parse_int(argv[3], &int_valid[1]);
|
||||
int32_t ride_index = ConsoleParseInt(argv[2], &int_valid[0]);
|
||||
int32_t type = ConsoleParseInt(argv[3], &int_valid[1]);
|
||||
if (!int_valid[0] || !int_valid[1])
|
||||
{
|
||||
console.WriteFormatLine("This command expects integer arguments");
|
||||
@@ -218,8 +218,8 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
|
||||
else if (argv[1] == "mode")
|
||||
{
|
||||
bool int_valid[2] = { false };
|
||||
int32_t ride_index = console_parse_int(argv[2], &int_valid[0]);
|
||||
int32_t mode = console_parse_int(argv[3], &int_valid[1]);
|
||||
int32_t ride_index = ConsoleParseInt(argv[2], &int_valid[0]);
|
||||
int32_t mode = ConsoleParseInt(argv[3], &int_valid[1]);
|
||||
if (!int_valid[0] || !int_valid[1])
|
||||
{
|
||||
console.WriteFormatLine("This command expects integer arguments");
|
||||
@@ -249,8 +249,8 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
|
||||
else if (argv[1] == "mass")
|
||||
{
|
||||
bool int_valid[2] = { false };
|
||||
int32_t ride_index = console_parse_int(argv[2], &int_valid[0]);
|
||||
int32_t mass = console_parse_int(argv[3], &int_valid[1]);
|
||||
int32_t ride_index = ConsoleParseInt(argv[2], &int_valid[0]);
|
||||
int32_t mass = ConsoleParseInt(argv[3], &int_valid[1]);
|
||||
|
||||
if (ride_index < 0)
|
||||
{
|
||||
@@ -287,8 +287,8 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
|
||||
else if (argv[1] == "excitement")
|
||||
{
|
||||
bool int_valid[2] = { false };
|
||||
int32_t ride_index = console_parse_int(argv[2], &int_valid[0]);
|
||||
ride_rating excitement = console_parse_int(argv[3], &int_valid[1]);
|
||||
int32_t ride_index = ConsoleParseInt(argv[2], &int_valid[0]);
|
||||
ride_rating excitement = ConsoleParseInt(argv[3], &int_valid[1]);
|
||||
|
||||
if (ride_index < 0)
|
||||
{
|
||||
@@ -320,8 +320,8 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
|
||||
else if (argv[1] == "intensity")
|
||||
{
|
||||
bool int_valid[2] = { false };
|
||||
int32_t ride_index = console_parse_int(argv[2], &int_valid[0]);
|
||||
ride_rating intensity = console_parse_int(argv[3], &int_valid[1]);
|
||||
int32_t ride_index = ConsoleParseInt(argv[2], &int_valid[0]);
|
||||
ride_rating intensity = ConsoleParseInt(argv[3], &int_valid[1]);
|
||||
|
||||
if (ride_index < 0)
|
||||
{
|
||||
@@ -353,8 +353,8 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
|
||||
else if (argv[1] == "nausea")
|
||||
{
|
||||
bool int_valid[2] = { false };
|
||||
int32_t ride_index = console_parse_int(argv[2], &int_valid[0]);
|
||||
ride_rating nausea = console_parse_int(argv[3], &int_valid[1]);
|
||||
int32_t ride_index = ConsoleParseInt(argv[2], &int_valid[0]);
|
||||
ride_rating nausea = ConsoleParseInt(argv[3], &int_valid[1]);
|
||||
|
||||
if (ride_index < 0)
|
||||
{
|
||||
@@ -388,7 +388,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
|
||||
bool int_valid[2] = { false };
|
||||
if (argv[2] == "all")
|
||||
{
|
||||
auto arg1 = console_parse_int(argv[3], &int_valid[0]);
|
||||
auto arg1 = ConsoleParseInt(argv[3], &int_valid[0]);
|
||||
if (argv.size() <= 4)
|
||||
{
|
||||
auto price = arg1;
|
||||
@@ -408,7 +408,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
|
||||
else
|
||||
{
|
||||
auto rideType = arg1;
|
||||
auto price = console_parse_int(argv[4], &int_valid[1]);
|
||||
auto price = ConsoleParseInt(argv[4], &int_valid[1]);
|
||||
|
||||
if (int_valid[0] && int_valid[1])
|
||||
{
|
||||
@@ -429,8 +429,8 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
int32_t rideId = console_parse_int(argv[2], &int_valid[0]);
|
||||
money16 price = console_parse_int(argv[3], &int_valid[1]);
|
||||
int32_t rideId = ConsoleParseInt(argv[2], &int_valid[0]);
|
||||
money16 price = ConsoleParseInt(argv[3], &int_valid[1]);
|
||||
|
||||
if (!int_valid[0] || !int_valid[1])
|
||||
{
|
||||
@@ -452,7 +452,7 @@ static int32_t cc_rides(InteractiveConsole& console, const arguments_t& argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_staff(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandStaff(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (!argv.empty())
|
||||
{
|
||||
@@ -487,8 +487,8 @@ static int32_t cc_staff(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
int32_t int_val[3];
|
||||
bool int_valid[3] = { false };
|
||||
int_val[0] = console_parse_int(argv[2], &int_valid[0]);
|
||||
int_val[1] = console_parse_int(argv[3], &int_valid[1]);
|
||||
int_val[0] = ConsoleParseInt(argv[2], &int_valid[0]);
|
||||
int_val[1] = ConsoleParseInt(argv[3], &int_valid[1]);
|
||||
|
||||
if (int_valid[0] && int_valid[1])
|
||||
{
|
||||
@@ -504,8 +504,8 @@ static int32_t cc_staff(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
int32_t int_val[2];
|
||||
bool int_valid[2] = { false };
|
||||
int_val[0] = console_parse_int(argv[2], &int_valid[0]);
|
||||
int_val[1] = console_parse_int(argv[3], &int_valid[1]);
|
||||
int_val[0] = ConsoleParseInt(argv[2], &int_valid[0]);
|
||||
int_val[1] = ConsoleParseInt(argv[3], &int_valid[1]);
|
||||
if (!int_valid[0])
|
||||
{
|
||||
console.WriteLineError("Invalid staff ID");
|
||||
@@ -541,7 +541,7 @@ static int32_t cc_staff(InteractiveConsole& console, const arguments_t& argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandGet(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (!argv.empty())
|
||||
{
|
||||
@@ -677,7 +677,7 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv)
|
||||
if (w != nullptr)
|
||||
{
|
||||
rct_viewport* viewport = WindowGetViewport(w);
|
||||
auto info = get_map_coordinates_from_pos(
|
||||
auto info = GetMapCoordinatesFromPos(
|
||||
{ viewport->view_width / 2, viewport->view_height / 2 }, EnumsToFlags(ViewportInteractionItem::Terrain));
|
||||
|
||||
auto tileMapCoord = TileCoordsXY(info.Loc);
|
||||
@@ -714,7 +714,7 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv)
|
||||
}
|
||||
else if (argv[0] == "current_rotation")
|
||||
{
|
||||
console.WriteFormatLine("current_rotation %d", get_current_rotation());
|
||||
console.WriteFormatLine("current_rotation %d", GetCurrentRotation());
|
||||
}
|
||||
else if (argv[0] == "host_timescale")
|
||||
{
|
||||
@@ -733,7 +733,7 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandSet(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (argv.size() > 1)
|
||||
{
|
||||
@@ -747,8 +747,8 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (i + 1 < argv.size())
|
||||
{
|
||||
int_val[i] = console_parse_int(argv[i + 1], &int_valid[i]);
|
||||
double_val[i] = console_parse_double(argv[i + 1], &double_valid[i]);
|
||||
int_val[i] = ConsoleParseInt(argv[i + 1], &int_valid[i]);
|
||||
double_val[i] = ConsoleParseDouble(argv[i + 1], &double_valid[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -759,7 +759,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (argv[0] == "money" && invalidArguments(&invalidArgs, double_valid[0]))
|
||||
if (argv[0] == "money" && InvalidArguments(&invalidArgs, double_valid[0]))
|
||||
{
|
||||
money32 money = ToMoney64FromGBP(double_val[0]);
|
||||
if (gCash != money)
|
||||
@@ -778,7 +778,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
console.Execute("get money");
|
||||
}
|
||||
}
|
||||
else if (argv[0] == "scenario_initial_cash" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "scenario_initial_cash" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(
|
||||
ScenarioSetSetting::InitialCash, std::clamp(ToMoney64FromGBP(int_val[0]), 0.00_GBP, 1000000.00_GBP));
|
||||
@@ -790,7 +790,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "current_loan" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "current_loan" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto amount = std::clamp(
|
||||
ToMoney64FromGBP(int_val[0]) - ToMoney64FromGBP(int_val[0] % 1000), 0.00_GBP, gMaxBankLoan);
|
||||
@@ -803,7 +803,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "max_loan" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "max_loan" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto amount = std::clamp(
|
||||
ToMoney64FromGBP(int_val[0]) - ToMoney64FromGBP(int_val[0] % 1000), 0.00_GBP, 5000000.00_GBP);
|
||||
@@ -816,7 +816,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "guest_initial_cash" && invalidArguments(&invalidArgs, double_valid[0]))
|
||||
else if (argv[0] == "guest_initial_cash" && InvalidArguments(&invalidArgs, double_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(
|
||||
ScenarioSetSetting::AverageCashPerGuest, std::clamp(ToMoney64FromGBP(double_val[0]), 0.00_GBP, 1000.00_GBP));
|
||||
@@ -828,7 +828,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "guest_initial_happiness" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "guest_initial_happiness" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(
|
||||
ScenarioSetSetting::GuestInitialHappiness, CalculateGuestInitialHappiness(static_cast<uint8_t>(int_val[0])));
|
||||
@@ -840,7 +840,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "guest_initial_hunger" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "guest_initial_hunger" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(
|
||||
ScenarioSetSetting::GuestInitialHunger, (std::clamp(int_val[0], 1, 84) * 255 / 100 - 255) * -1);
|
||||
@@ -852,7 +852,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "guest_initial_thirst" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "guest_initial_thirst" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(
|
||||
ScenarioSetSetting::GuestInitialThirst, (std::clamp(int_val[0], 1, 84) * 255 / 100 - 255) * -1);
|
||||
@@ -864,7 +864,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "guest_prefer_less_intense_rides" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "guest_prefer_less_intense_rides" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::GuestsPreferLessIntenseRides, int_val[0]);
|
||||
scenarioSetSetting.SetCallback([&console](const GameAction*, const GameActions::Result* res) {
|
||||
@@ -875,7 +875,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "guest_prefer_more_intense_rides" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "guest_prefer_more_intense_rides" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::GuestsPreferMoreIntenseRides, int_val[0]);
|
||||
scenarioSetSetting.SetCallback([&console](const GameAction*, const GameActions::Result* res) {
|
||||
@@ -886,7 +886,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "forbid_marketing_campaigns" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "forbid_marketing_campaigns" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::ForbidMarketingCampaigns, int_val[0]);
|
||||
scenarioSetSetting.SetCallback([&console](const GameAction*, const GameActions::Result* res) {
|
||||
@@ -897,7 +897,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "forbid_landscape_changes" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "forbid_landscape_changes" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::ForbidLandscapeChanges, int_val[0]);
|
||||
scenarioSetSetting.SetCallback([&console](const GameAction*, const GameActions::Result* res) {
|
||||
@@ -908,7 +908,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "forbid_tree_removal" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "forbid_tree_removal" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::ForbidTreeRemoval, int_val[0]);
|
||||
scenarioSetSetting.SetCallback([&console](const GameAction*, const GameActions::Result* res) {
|
||||
@@ -919,7 +919,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "forbid_high_construction" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "forbid_high_construction" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::ForbidHighConstruction, int_val[0]);
|
||||
scenarioSetSetting.SetCallback([&console](const GameAction*, const GameActions::Result* res) {
|
||||
@@ -930,12 +930,12 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "pay_for_rides" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "pay_for_rides" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
SET_FLAG(gParkFlags, PARK_FLAGS_PARK_FREE_ENTRY, int_val[0]);
|
||||
console.Execute("get pay_for_rides");
|
||||
}
|
||||
else if (argv[0] == "no_money" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "no_money" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto cheatSetAction = CheatSetAction(CheatType::NoMoney, int_val[0] != 0);
|
||||
cheatSetAction.SetCallback([&console](const GameAction*, const GameActions::Result* res) {
|
||||
@@ -946,7 +946,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&cheatSetAction);
|
||||
}
|
||||
else if (argv[0] == "difficult_park_rating" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "difficult_park_rating" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::ParkRatingHigherDifficultyLevel, int_val[0]);
|
||||
scenarioSetSetting.SetCallback([&console](const GameAction*, const GameActions::Result* res) {
|
||||
@@ -957,7 +957,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "difficult_guest_generation" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "difficult_guest_generation" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(
|
||||
ScenarioSetSetting::GuestGenerationHigherDifficultyLevel, int_val[0]);
|
||||
@@ -969,7 +969,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "park_open" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "park_open" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
auto parkSetParameter = ParkSetParameterAction((int_val[0] == 1) ? ParkParameter::Open : ParkParameter::Close);
|
||||
parkSetParameter.SetCallback([&console](const GameAction*, const GameActions::Result* res) {
|
||||
@@ -980,7 +980,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&parkSetParameter);
|
||||
}
|
||||
else if (argv[0] == "land_rights_cost" && invalidArguments(&invalidArgs, double_valid[0]))
|
||||
else if (argv[0] == "land_rights_cost" && InvalidArguments(&invalidArgs, double_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(
|
||||
ScenarioSetSetting::CostToBuyLand, std::clamp(ToMoney64FromGBP(double_val[0]), 0.00_GBP, 200.00_GBP));
|
||||
@@ -992,7 +992,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
});
|
||||
GameActions::Execute(&scenarioSetSetting);
|
||||
}
|
||||
else if (argv[0] == "construction_rights_cost" && invalidArguments(&invalidArgs, double_valid[0]))
|
||||
else if (argv[0] == "construction_rights_cost" && InvalidArguments(&invalidArgs, double_valid[0]))
|
||||
{
|
||||
auto scenarioSetSetting = ScenarioSetSettingAction(
|
||||
ScenarioSetSetting::CostToBuyConstructionRights,
|
||||
@@ -1039,18 +1039,18 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
console.Execute("get climate");
|
||||
}
|
||||
}
|
||||
else if (argv[0] == "game_speed" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "game_speed" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
gGameSpeed = std::clamp(int_val[0], 1, 8);
|
||||
console.Execute("get game_speed");
|
||||
}
|
||||
else if (argv[0] == "console_small_font" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "console_small_font" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
gConfigInterface.ConsoleSmallFont = (int_val[0] != 0);
|
||||
ConfigSaveDefault();
|
||||
console.Execute("get console_small_font");
|
||||
}
|
||||
else if (argv[0] == "location" && invalidArguments(&invalidArgs, int_valid[0] && int_valid[1]))
|
||||
else if (argv[0] == "location" && InvalidArguments(&invalidArgs, int_valid[0] && int_valid[1]))
|
||||
{
|
||||
rct_window* w = WindowGetMain();
|
||||
if (w != nullptr)
|
||||
@@ -1058,11 +1058,11 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
auto location = TileCoordsXYZ(int_val[0], int_val[1], 0).ToCoordsXYZ().ToTileCentre();
|
||||
location.z = TileElementHeight(location);
|
||||
w->SetLocation(location);
|
||||
viewport_update_position(w);
|
||||
ViewportUpdatePosition(w);
|
||||
console.Execute("get location");
|
||||
}
|
||||
}
|
||||
else if (argv[0] == "window_scale" && invalidArguments(&invalidArgs, double_valid[0]))
|
||||
else if (argv[0] == "window_scale" && InvalidArguments(&invalidArgs, double_valid[0]))
|
||||
{
|
||||
float newScale = static_cast<float>(0.001 * std::trunc(1000 * double_val[0]));
|
||||
gConfigGeneral.WindowScale = std::clamp(newScale, 0.5f, 5.0f);
|
||||
@@ -1072,24 +1072,24 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
ContextUpdateCursorScale();
|
||||
console.Execute("get window_scale");
|
||||
}
|
||||
else if (argv[0] == "window_limit" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "window_limit" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
WindowSetWindowLimit(int_val[0]);
|
||||
console.Execute("get window_limit");
|
||||
}
|
||||
else if (argv[0] == "render_weather_effects" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "render_weather_effects" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
gConfigGeneral.RenderWeatherEffects = (int_val[0] != 0);
|
||||
ConfigSaveDefault();
|
||||
console.Execute("get render_weather_effects");
|
||||
}
|
||||
else if (argv[0] == "render_weather_gloom" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "render_weather_gloom" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
gConfigGeneral.RenderWeatherGloom = (int_val[0] != 0);
|
||||
ConfigSaveDefault();
|
||||
console.Execute("get render_weather_gloom");
|
||||
}
|
||||
else if (argv[0] == "cheat_sandbox_mode" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "cheat_sandbox_mode" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
if (gCheatsSandboxMode != (int_val[0] != 0))
|
||||
{
|
||||
@@ -1107,7 +1107,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
console.Execute("get cheat_sandbox_mode");
|
||||
}
|
||||
}
|
||||
else if (argv[0] == "cheat_disable_clearance_checks" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "cheat_disable_clearance_checks" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
if (gCheatsDisableClearanceChecks != (int_val[0] != 0))
|
||||
{
|
||||
@@ -1125,7 +1125,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
console.Execute("get cheat_disable_clearance_checks");
|
||||
}
|
||||
}
|
||||
else if (argv[0] == "cheat_disable_support_limits" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "cheat_disable_support_limits" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
if (gCheatsDisableSupportLimits != (int_val[0] != 0))
|
||||
{
|
||||
@@ -1143,9 +1143,9 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
console.Execute("get cheat_disable_support_limits");
|
||||
}
|
||||
}
|
||||
else if (argv[0] == "current_rotation" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "current_rotation" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
uint8_t currentRotation = get_current_rotation();
|
||||
uint8_t currentRotation = GetCurrentRotation();
|
||||
rct_window* mainWindow = WindowGetMain();
|
||||
int32_t newRotation = int_val[0];
|
||||
if (newRotation < 0 || newRotation > 3)
|
||||
@@ -1158,7 +1158,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
}
|
||||
console.Execute("get current_rotation");
|
||||
}
|
||||
else if (argv[0] == "host_timescale" && invalidArguments(&invalidArgs, double_valid[0]))
|
||||
else if (argv[0] == "host_timescale" && InvalidArguments(&invalidArgs, double_valid[0]))
|
||||
{
|
||||
float newScale = static_cast<float>(double_val[0]);
|
||||
|
||||
@@ -1167,7 +1167,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
console.Execute("get host_timescale");
|
||||
}
|
||||
#ifndef NO_TTF
|
||||
else if (argv[0] == "enable_hinting" && invalidArguments(&invalidArgs, int_valid[0]))
|
||||
else if (argv[0] == "enable_hinting" && InvalidArguments(&invalidArgs, int_valid[0]))
|
||||
{
|
||||
gConfigFonts.EnableHinting = (int_val[0] != 0);
|
||||
ConfigSaveDefault();
|
||||
@@ -1193,7 +1193,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_load_object(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandLoadObject(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (!argv.empty())
|
||||
{
|
||||
@@ -1293,7 +1293,7 @@ constexpr std::array _objectTypeNames = {
|
||||
};
|
||||
static_assert(_objectTypeNames.size() == EnumValue(ObjectType::Count));
|
||||
|
||||
static int32_t cc_object_count(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandCountObjects(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
for (auto objectType : ObjectTypes)
|
||||
{
|
||||
@@ -1313,13 +1313,13 @@ static int32_t cc_object_count(InteractiveConsole& console, [[maybe_unused]] con
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_open(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandOpen(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (!argv.empty())
|
||||
{
|
||||
bool title = (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) != 0;
|
||||
bool invalidTitle = false;
|
||||
if (argv[0] == "object_selection" && invalidArguments(&invalidTitle, !title))
|
||||
if (argv[0] == "object_selection" && InvalidArguments(&invalidTitle, !title))
|
||||
{
|
||||
if (network_get_mode() != NETWORK_MODE_NONE)
|
||||
{
|
||||
@@ -1332,7 +1332,7 @@ static int32_t cc_open(InteractiveConsole& console, const arguments_t& argv)
|
||||
ContextOpenWindow(WindowClass::EditorObjectSelection);
|
||||
}
|
||||
}
|
||||
else if (argv[0] == "inventions_list" && invalidArguments(&invalidTitle, !title))
|
||||
else if (argv[0] == "inventions_list" && InvalidArguments(&invalidTitle, !title))
|
||||
{
|
||||
if (network_get_mode() != NETWORK_MODE_NONE)
|
||||
{
|
||||
@@ -1343,11 +1343,11 @@ static int32_t cc_open(InteractiveConsole& console, const arguments_t& argv)
|
||||
ContextOpenWindow(WindowClass::EditorInventionList);
|
||||
}
|
||||
}
|
||||
else if (argv[0] == "scenario_options" && invalidArguments(&invalidTitle, !title))
|
||||
else if (argv[0] == "scenario_options" && InvalidArguments(&invalidTitle, !title))
|
||||
{
|
||||
ContextOpenWindow(WindowClass::EditorScenarioOptions);
|
||||
}
|
||||
else if (argv[0] == "objective_options" && invalidArguments(&invalidTitle, !title))
|
||||
else if (argv[0] == "objective_options" && InvalidArguments(&invalidTitle, !title))
|
||||
{
|
||||
if (network_get_mode() != NETWORK_MODE_NONE)
|
||||
{
|
||||
@@ -1378,21 +1378,21 @@ static int32_t cc_open(InteractiveConsole& console, const arguments_t& argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_remove_unused_objects(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandRemoveUnusedObjects(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
int32_t result = editor_remove_unused_objects();
|
||||
console.WriteFormatLine("%d unused object entries have been removed.", result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_remove_floating_objects(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandRemoveFloatingObjects(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
uint16_t result = RemoveFloatingEntities();
|
||||
console.WriteFormatLine("Removed %d flying objects", result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_remove_park_fences(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandRemoveParkFences(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
tile_element_iterator it;
|
||||
TileElementIteratorBegin(&it);
|
||||
@@ -1411,7 +1411,7 @@ static int32_t cc_remove_park_fences(InteractiveConsole& console, [[maybe_unused
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_show_limits(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandShowLimits(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
const auto& tileElements = GetTileElements();
|
||||
const auto tileElementCount = tileElements.size();
|
||||
@@ -1433,7 +1433,7 @@ static int32_t cc_show_limits(InteractiveConsole& console, [[maybe_unused]] cons
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_for_date([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandForceDate([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
int32_t year = 0;
|
||||
int32_t month = 0;
|
||||
@@ -1490,7 +1490,7 @@ static int32_t cc_for_date([[maybe_unused]] InteractiveConsole& console, [[maybe
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int32_t cc_load_park([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandLoadPark([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
if (argv.size() < 1)
|
||||
{
|
||||
@@ -1526,7 +1526,7 @@ static int32_t cc_load_park([[maybe_unused]] InteractiveConsole& console, [[mayb
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int32_t cc_save_park([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandSavePark([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
if (argv.size() < 1)
|
||||
{
|
||||
@@ -1539,7 +1539,7 @@ static int32_t cc_save_park([[maybe_unused]] InteractiveConsole& console, [[mayb
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int32_t cc_say(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandSay(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (network_get_mode() == NETWORK_MODE_NONE || network_get_status() != NETWORK_STATUS_CONNECTED
|
||||
|| network_get_authstatus() != NetworkAuth::Ok)
|
||||
@@ -1558,7 +1558,7 @@ static int32_t cc_say(InteractiveConsole& console, const arguments_t& argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_replay_startrecord(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandReplayStartRecord(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (network_get_mode() != NETWORK_MODE_NONE)
|
||||
{
|
||||
@@ -1605,7 +1605,7 @@ static int32_t cc_replay_startrecord(InteractiveConsole& console, const argument
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_replay_stoprecord(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandReplayStopRecord(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (network_get_mode() != NETWORK_MODE_NONE)
|
||||
{
|
||||
@@ -1640,7 +1640,7 @@ static int32_t cc_replay_stoprecord(InteractiveConsole& console, const arguments
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_replay_start(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandReplayStart(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (network_get_mode() != NETWORK_MODE_NONE)
|
||||
{
|
||||
@@ -1682,7 +1682,7 @@ static int32_t cc_replay_start(InteractiveConsole& console, const arguments_t& a
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_replay_stop(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandReplayStop(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (network_get_mode() != NETWORK_MODE_NONE)
|
||||
{
|
||||
@@ -1700,7 +1700,7 @@ static int32_t cc_replay_stop(InteractiveConsole& console, const arguments_t& ar
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_replay_normalise(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandReplayNormalise(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (network_get_mode() != NETWORK_MODE_NONE)
|
||||
{
|
||||
@@ -1735,7 +1735,7 @@ static int32_t cc_replay_normalise(InteractiveConsole& console, const arguments_
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_mp_desync(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandMpDesync(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
int32_t desyncType = 0;
|
||||
if (argv.size() >= 1)
|
||||
@@ -1789,13 +1789,13 @@ static int32_t cc_mp_desync(InteractiveConsole& console, const arguments_t& argv
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4702) // unreachable code
|
||||
static int32_t cc_abort([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandAbort([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
std::abort();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_dereference([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandDereference([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wnull-dereference"
|
||||
@@ -1806,14 +1806,14 @@ static int32_t cc_dereference([[maybe_unused]] InteractiveConsole& console, [[ma
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
static int32_t cc_terminate([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandTerminate([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
std::terminate();
|
||||
return 0;
|
||||
}
|
||||
#pragma warning(pop)
|
||||
|
||||
static int32_t cc_assert([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandAssert([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
if (!argv.empty())
|
||||
Guard::Assert(false, "%s", argv[0].c_str());
|
||||
@@ -1822,7 +1822,7 @@ static int32_t cc_assert([[maybe_unused]] InteractiveConsole& console, [[maybe_u
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_add_news_item([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandAddNewsItem([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
if (argv.size() < 2)
|
||||
{
|
||||
@@ -1871,12 +1871,14 @@ static int32_t cc_add_news_item([[maybe_unused]] InteractiveConsole& console, [[
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_profiler_reset([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandProfilerReset(
|
||||
[[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
OpenRCT2::Profiling::ResetData();
|
||||
return 0;
|
||||
}
|
||||
static int32_t cc_profiler_start([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandProfilerStart(
|
||||
[[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
if (!OpenRCT2::Profiling::IsEnabled())
|
||||
console.WriteLine("Started profiler");
|
||||
@@ -1884,7 +1886,8 @@ static int32_t cc_profiler_start([[maybe_unused]] InteractiveConsole& console, [
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_profiler_exportcsv([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandProfilerExportCSV(
|
||||
[[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
if (argv.size() < 1)
|
||||
{
|
||||
@@ -1903,7 +1906,8 @@ static int32_t cc_profiler_exportcsv([[maybe_unused]] InteractiveConsole& consol
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_profiler_stop([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandProfilerStop(
|
||||
[[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
if (OpenRCT2::Profiling::IsEnabled())
|
||||
console.WriteLine("Stopped profiler");
|
||||
@@ -1912,7 +1916,7 @@ static int32_t cc_profiler_stop([[maybe_unused]] InteractiveConsole& console, [[
|
||||
// Export to CSV if argument is provided.
|
||||
if (argv.size() >= 1)
|
||||
{
|
||||
return cc_profiler_exportcsv(console, argv);
|
||||
return ConsoleCommandProfilerExportCSV(console, argv);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1979,56 +1983,59 @@ static constexpr const utf8* console_window_table[] = {
|
||||
// clang-format on
|
||||
|
||||
static constexpr const console_command console_command_table[] = {
|
||||
{ "abort", cc_abort, "Calls std::abort(), for testing purposes only.", "abort" },
|
||||
{ "add_news_item", cc_add_news_item, "Inserts a news item", "add_news_item [<type> <message> <assoc>]" },
|
||||
{ "assert", cc_assert, "Triggers assertion failure, for testing purposes only", "assert" },
|
||||
{ "clear", cc_clear, "Clears the console.", "clear" },
|
||||
{ "close", cc_close, "Closes the console.", "close" },
|
||||
{ "date", cc_for_date, "Sets the date to a given date.", "Format <year>[ <month>[ <day>]]." },
|
||||
{ "dereference", cc_dereference, "Dereferences a nullptr, for testing purposes only", "dereference" },
|
||||
{ "echo", cc_echo, "Echoes the text to the console.", "echo <text>" },
|
||||
{ "exit", cc_close, "Closes the console.", "exit" },
|
||||
{ "get", cc_get, "Gets the value of the specified variable.", "get <variable>" },
|
||||
{ "help", cc_help, "Lists commands or info about a command.", "help [command]" },
|
||||
{ "hide", cc_hide, "Hides the console.", "hide" },
|
||||
{ "load_object", cc_load_object,
|
||||
{ "abort", ConsoleCommandAbort, "Calls std::abort(), for testing purposes only.", "abort" },
|
||||
{ "add_news_item", ConsoleCommandAddNewsItem, "Inserts a news item", "add_news_item [<type> <message> <assoc>]" },
|
||||
{ "assert", ConsoleCommandAssert, "Triggers assertion failure, for testing purposes only", "assert" },
|
||||
{ "clear", ConsoleCommandClear, "Clears the console.", "clear" },
|
||||
{ "close", ConsoleCommandClose, "Closes the console.", "close" },
|
||||
{ "date", ConsoleCommandForceDate, "Sets the date to a given date.", "Format <year>[ <month>[ <day>]]." },
|
||||
{ "dereference", ConsoleCommandDereference, "Dereferences a nullptr, for testing purposes only", "dereference" },
|
||||
{ "echo", ConsoleCommandEcho, "Echoes the text to the console.", "echo <text>" },
|
||||
{ "exit", ConsoleCommandClose, "Closes the console.", "exit" },
|
||||
{ "get", ConsoleCommandGet, "Gets the value of the specified variable.", "get <variable>" },
|
||||
{ "help", ConsoleCommandHelp, "Lists commands or info about a command.", "help [command]" },
|
||||
{ "hide", ConsoleCommandHide, "Hides the console.", "hide" },
|
||||
{ "load_object", ConsoleCommandLoadObject,
|
||||
"Loads the object file into the scenario.\n"
|
||||
"Loading a scenery group will not load its associated objects.\n"
|
||||
"This is a safer method opposed to \"open object_selection\".",
|
||||
"load_object <objectfilenodat>" },
|
||||
{ "load_park", cc_load_park, "Load park from save directory or by absolute path", "load_park <filename>" },
|
||||
{ "object_count", cc_object_count, "Shows the number of objects of each type in the scenario.", "object_count" },
|
||||
{ "open", cc_open, "Opens the window with the give name.", "open <window>." },
|
||||
{ "quit", cc_close, "Closes the console.", "quit" },
|
||||
{ "remove_park_fences", cc_remove_park_fences, "Removes all park fences from the surface", "remove_park_fences" },
|
||||
{ "remove_unused_objects", cc_remove_unused_objects, "Removes all the unused objects from the object selection.",
|
||||
{ "load_park", ConsoleCommandLoadPark, "Load park from save directory or by absolute path", "load_park <filename>" },
|
||||
{ "object_count", ConsoleCommandCountObjects, "Shows the number of objects of each type in the scenario.", "object_count" },
|
||||
{ "open", ConsoleCommandOpen, "Opens the window with the give name.", "open <window>." },
|
||||
{ "quit", ConsoleCommandClose, "Closes the console.", "quit" },
|
||||
{ "remove_park_fences", ConsoleCommandRemoveParkFences, "Removes all park fences from the surface", "remove_park_fences" },
|
||||
{ "remove_unused_objects", ConsoleCommandRemoveUnusedObjects, "Removes all the unused objects from the object selection.",
|
||||
"remove_unused_objects" },
|
||||
{ "remove_floating_objects", cc_remove_floating_objects, "Removes floating objects", "remove_floating_objects" },
|
||||
{ "rides", cc_rides, "Ride management.", "rides <subcommand>" },
|
||||
{ "save_park", cc_save_park, "Save current state of park. If no name specified default path will be used.",
|
||||
{ "remove_floating_objects", ConsoleCommandRemoveFloatingObjects, "Removes floating objects", "remove_floating_objects" },
|
||||
{ "rides", ConsoleCommandRides, "Ride management.", "rides <subcommand>" },
|
||||
{ "save_park", ConsoleCommandSavePark, "Save current state of park. If no name specified default path will be used.",
|
||||
"save_park [name]" },
|
||||
{ "say", cc_say, "Say to other players.", "say <message>" },
|
||||
{ "set", cc_set, "Sets the variable to the specified value.", "set <variable> <value>" },
|
||||
{ "show_limits", cc_show_limits, "Shows the map data counts and limits.", "show_limits" },
|
||||
{ "staff", cc_staff, "Staff management.", "staff <subcommand>" },
|
||||
{ "terminate", cc_terminate, "Calls std::terminate(), for testing purposes only.", "terminate" },
|
||||
{ "variables", cc_variables, "Lists all the variables that can be used with get and sometimes set.", "variables" },
|
||||
{ "windows", cc_windows, "Lists all the windows that can be opened.", "windows" },
|
||||
{ "replay_startrecord", cc_replay_startrecord, "Starts recording a new replay.", "replay_startrecord <name> [max_ticks]" },
|
||||
{ "replay_stoprecord", cc_replay_stoprecord, "Stops recording a new replay.", "replay_stoprecord" },
|
||||
{ "replay_start", cc_replay_start, "Starts a replay", "replay_start <name>" },
|
||||
{ "replay_stop", cc_replay_stop, "Stops the replay", "replay_stop" },
|
||||
{ "replay_normalise", cc_replay_normalise, "Normalises the replay to remove all gaps",
|
||||
{ "say", ConsoleCommandSay, "Say to other players.", "say <message>" },
|
||||
{ "set", ConsoleCommandSet, "Sets the variable to the specified value.", "set <variable> <value>" },
|
||||
{ "show_limits", ConsoleCommandShowLimits, "Shows the map data counts and limits.", "show_limits" },
|
||||
{ "staff", ConsoleCommandStaff, "Staff management.", "staff <subcommand>" },
|
||||
{ "terminate", ConsoleCommandTerminate, "Calls std::terminate(), for testing purposes only.", "terminate" },
|
||||
{ "variables", ConsoleCommandVariables, "Lists all the variables that can be used with get and sometimes set.",
|
||||
"variables" },
|
||||
{ "windows", ConsoleCommandWindows, "Lists all the windows that can be opened.", "windows" },
|
||||
{ "replay_startrecord", ConsoleCommandReplayStartRecord, "Starts recording a new replay.",
|
||||
"replay_startrecord <name> [max_ticks]" },
|
||||
{ "replay_stoprecord", ConsoleCommandReplayStopRecord, "Stops recording a new replay.", "replay_stoprecord" },
|
||||
{ "replay_start", ConsoleCommandReplayStart, "Starts a replay", "replay_start <name>" },
|
||||
{ "replay_stop", ConsoleCommandReplayStop, "Stops the replay", "replay_stop" },
|
||||
{ "replay_normalise", ConsoleCommandReplayNormalise, "Normalises the replay to remove all gaps",
|
||||
"replay_normalise <input file> <output file>" },
|
||||
{ "mp_desync", cc_mp_desync, "Forces a multiplayer desync",
|
||||
"cc_mp_desync [desync_type, 0 = Random t-shirt color on random guest, 1 = Remove random guest ]" },
|
||||
{ "profiler_reset", cc_profiler_reset, "Resets the profiler data.", "profiler_reset" },
|
||||
{ "profiler_start", cc_profiler_start, "Starts the profiler.", "profiler_start" },
|
||||
{ "profiler_stop", cc_profiler_stop, "Stops the profiler.", "profiler_stop [<output file>]" },
|
||||
{ "profiler_exportcsv", cc_profiler_exportcsv, "Exports the current profiler data.", "profiler_exportcsv <output file>" },
|
||||
{ "mp_desync", ConsoleCommandMpDesync, "Forces a multiplayer desync",
|
||||
"ConsoleCommandMpDesync [desync_type, 0 = Random t-shirt color on random guest, 1 = Remove random guest ]" },
|
||||
{ "profiler_reset", ConsoleCommandProfilerReset, "Resets the profiler data.", "profiler_reset" },
|
||||
{ "profiler_start", ConsoleCommandProfilerStart, "Starts the profiler.", "profiler_start" },
|
||||
{ "profiler_stop", ConsoleCommandProfilerStop, "Stops the profiler.", "profiler_stop [<output file>]" },
|
||||
{ "profiler_exportcsv", ConsoleCommandProfilerExportCSV, "Exports the current profiler data.",
|
||||
"profiler_exportcsv <output file>" },
|
||||
};
|
||||
|
||||
static int32_t cc_windows(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandWindows(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
for (auto s : console_window_table)
|
||||
{
|
||||
@@ -2037,7 +2044,7 @@ static int32_t cc_windows(InteractiveConsole& console, [[maybe_unused]] const ar
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_variables(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
static int32_t ConsoleCommandVariables(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
|
||||
{
|
||||
for (auto s : console_variable_table)
|
||||
{
|
||||
@@ -2046,7 +2053,7 @@ static int32_t cc_variables(InteractiveConsole& console, [[maybe_unused]] const
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t cc_help(InteractiveConsole& console, const arguments_t& argv)
|
||||
static int32_t ConsoleCommandHelp(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
if (!argv.empty())
|
||||
{
|
||||
@@ -2061,12 +2068,12 @@ static int32_t cc_help(InteractiveConsole& console, const arguments_t& argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
console_write_all_commands(console);
|
||||
ConsoleWriteAllCommands(console);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void console_write_all_commands(InteractiveConsole& console)
|
||||
static void ConsoleWriteAllCommands(InteractiveConsole& console)
|
||||
{
|
||||
for (const auto& c : console_command_table)
|
||||
{
|
||||
@@ -2074,7 +2081,7 @@ static void console_write_all_commands(InteractiveConsole& console)
|
||||
}
|
||||
}
|
||||
|
||||
static bool invalidArguments(bool* invalid, bool arguments)
|
||||
static bool InvalidArguments(bool* invalid, bool arguments)
|
||||
{
|
||||
if (!arguments)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user