MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ConSettingNewgame

Function ConSettingNewgame

src/console_cmds.cpp:2405–2422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2403}
2404
2405static bool ConSettingNewgame(std::span<std::string_view> argv)
2406{
2407 if (argv.empty()) {
2408 IConsolePrint(CC_HELP, "Change setting for the next game. Usage: 'setting_newgame <name> [<value>]'.");
2409 IConsolePrint(CC_HELP, "Omitting <value> will print out the current value of the setting.");
2410 return true;
2411 }
2412
2413 if (argv.size() == 1 || argv.size() > 3) return false;
2414
2415 if (argv.size() == 2) {
2416 IConsoleGetSetting(argv[1], true);
2417 } else {
2418 IConsoleSetSetting(argv[1], argv[2], true);
2419 }
2420
2421 return true;
2422}
2423
2424static bool ConListSettings(std::span<std::string_view> argv)
2425{

Callers

nothing calls this directly

Calls 5

IConsoleGetSettingFunction · 0.85
IConsoleSetSettingFunction · 0.85
IConsolePrintFunction · 0.70
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected