| 3473 | } |
| 3474 | |
| 3475 | LoadResult GuiController::DoLoad() |
| 3476 | { |
| 3477 | constexpr auto DEATH_NO_INPUT_LOAD_TIMEOUT = FPS / 2; |
| 3478 | |
| 3479 | bool canLoop = g_Configuration.MenuOptionLoopingMode == MenuOptionLoopingMode::SaveLoadOnly || |
| 3480 | g_Configuration.MenuOptionLoopingMode == MenuOptionLoopingMode::AllMenus; |
| 3481 | |
| 3482 | // If load menu is accessed after death, delay input polling to allow player to stop spamming input. |
| 3483 | if (GetLaraInfo(*LaraItem).Control.Count.Death > 0 && TimeInMenu < DEATH_NO_INPUT_LOAD_TIMEOUT) |
| 3484 | return LoadResult::None; |
| 3485 | |
| 3486 | SelectedSaveSlot = GetLoopedSelectedOption(SelectedSaveSlot, SAVEGAME_MAX - 1, canLoop); |
| 3487 | |
| 3488 | if (GuiIsSelected()) |
| 3489 | { |
| 3490 | if (!SaveGame::Infos[SelectedSaveSlot].Present) |
| 3491 | SayNo(); |
| 3492 | else |
| 3493 | { |
| 3494 | SoundEffect(SFX_TR4_MENU_CHOOSE, nullptr, SoundEnvironment::Always); |
| 3495 | g_GameFlow->SelectedSaveGame = SelectedSaveSlot; |
| 3496 | return LoadResult::Load; |
| 3497 | } |
| 3498 | } |
| 3499 | |
| 3500 | if (GuiIsDeselected() || IsClicked(In::Load)) |
| 3501 | return LoadResult::Cancel; |
| 3502 | |
| 3503 | return LoadResult::None; |
| 3504 | } |
| 3505 | |
| 3506 | bool GuiController::DoSave() |
| 3507 | { |
nothing calls this directly
no test coverage detected