| 483 | } |
| 484 | |
| 485 | static bool ConLoadScenario(std::span<std::string_view> argv) |
| 486 | { |
| 487 | if (argv.empty()) { |
| 488 | IConsolePrint(CC_HELP, "Load a scenario by name or index. Usage: 'load_scenario <file | number>'."); |
| 489 | return true; |
| 490 | } |
| 491 | |
| 492 | if (argv.size() != 2) return false; |
| 493 | |
| 494 | std::string_view file = argv[1]; |
| 495 | _console_file_list_scenario.ValidateFileList(); |
| 496 | const FiosItem *item = _console_file_list_scenario.FindItem(file); |
| 497 | if (item != nullptr) { |
| 498 | if (item->type.abstract == FT_SCENARIO) { |
| 499 | _switch_mode = SM_LOAD_GAME; |
| 500 | _file_to_saveload.Set(*item); |
| 501 | } else { |
| 502 | IConsolePrint(CC_ERROR, "'{}' is not a scenario.", file); |
| 503 | } |
| 504 | } else { |
| 505 | IConsolePrint(CC_ERROR, "'{}' cannot be found.", file); |
| 506 | } |
| 507 | |
| 508 | return true; |
| 509 | } |
| 510 | |
| 511 | static bool ConLoadHeightmap(std::span<std::string_view> argv) |
| 512 | { |
nothing calls this directly
no test coverage detected