| 348 | } |
| 349 | |
| 350 | void update() |
| 351 | { |
| 352 | if (!s_game) { return; } |
| 353 | |
| 354 | static s32 lastState = 0; |
| 355 | const char* saveFilename = saveRequestFilename(); |
| 356 | |
| 357 | bool canSave = !lastState && s_game->canSave(); |
| 358 | if (isReplaySystemLive()) |
| 359 | { |
| 360 | // no saving or loading during replay system |
| 361 | return; |
| 362 | } |
| 363 | else if (saveFilename && canSave) |
| 364 | { |
| 365 | saveGame(saveFilename, s_reqSavename); |
| 366 | lastState = 1; |
| 367 | } |
| 368 | else if (inputMapping_getActionState(IAS_QUICK_SAVE) == STATE_PRESSED && canSave) |
| 369 | { |
| 370 | saveGame(c_quickSaveName, "Quicksave"); |
| 371 | lastState = 1; |
| 372 | } |
| 373 | else if (inputMapping_getActionState(IAS_QUICK_LOAD) == STATE_PRESSED && !lastState) |
| 374 | { |
| 375 | char filePath[TFE_MAX_PATH]; |
| 376 | sprintf(filePath, "%s%s", s_gameSavePath, c_quickSaveName); |
| 377 | if (FileUtil::exists(filePath)) |
| 378 | { |
| 379 | postLoadRequest(c_quickSaveName); |
| 380 | lastState = 1; |
| 381 | } |
| 382 | else |
| 383 | { |
| 384 | TFE_DarkForces::hud_sendTextMessage("No Quicksave Found", 0, false); |
| 385 | lastState = 0; |
| 386 | } |
| 387 | } |
| 388 | else |
| 389 | { |
| 390 | lastState = 0; |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | void getSaveFilename(char* filename, s32 index) |
| 395 | { |
nothing calls this directly
no test coverage detected