| 253 | } |
| 254 | |
| 255 | void SaveMenu::tryToLoadGame(sp<Control> slotControl) |
| 256 | { |
| 257 | if (slotControl->Name == existingSaveItemId) |
| 258 | { |
| 259 | sp<SaveMetadata> slot = slotControl->getData<SaveMetadata>(); |
| 260 | if (slot != nullptr) |
| 261 | { |
| 262 | auto state = mksp<GameState>(); |
| 263 | auto task = saveManager.loadGame(*slot, state); |
| 264 | fw().stageQueueCommand( |
| 265 | {StageCmd::Command::PUSH, |
| 266 | mksp<LoadingScreen>(nullptr, std::move(task), [state]() -> sp<Stage> { |
| 267 | if (state->current_battle) |
| 268 | { |
| 269 | return mksp<BattleView>(state); |
| 270 | } |
| 271 | else |
| 272 | { |
| 273 | return mksp<CityView>(state); |
| 274 | } |
| 275 | })}); |
| 276 | } |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | void SaveMenu::tryToSaveGame(const UString &saveName, sp<Control> parent) |
| 281 | { |
nothing calls this directly
no test coverage detected