| 457 | } |
| 458 | |
| 459 | static bool ConLoad(std::span<std::string_view> argv) |
| 460 | { |
| 461 | if (argv.empty()) { |
| 462 | IConsolePrint(CC_HELP, "Load a game by name or index. Usage: 'load <file | number>'."); |
| 463 | return true; |
| 464 | } |
| 465 | |
| 466 | if (argv.size() != 2) return false; |
| 467 | |
| 468 | std::string_view file = argv[1]; |
| 469 | _console_file_list_savegame.ValidateFileList(); |
| 470 | const FiosItem *item = _console_file_list_savegame.FindItem(file); |
| 471 | if (item != nullptr) { |
| 472 | if (item->type.abstract == FT_SAVEGAME) { |
| 473 | _switch_mode = SM_LOAD_GAME; |
| 474 | _file_to_saveload.Set(*item); |
| 475 | } else { |
| 476 | IConsolePrint(CC_ERROR, "'{}' is not a savegame.", file); |
| 477 | } |
| 478 | } else { |
| 479 | IConsolePrint(CC_ERROR, "'{}' cannot be found.", file); |
| 480 | } |
| 481 | |
| 482 | return true; |
| 483 | } |
| 484 | |
| 485 | static bool ConLoadScenario(std::span<std::string_view> argv) |
| 486 | { |
nothing calls this directly
no test coverage detected