MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / ShortcutQuickSaveGame

Function ShortcutQuickSaveGame

src/openrct2-ui/input/Shortcuts.cpp:412–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412static void ShortcutQuickSaveGame()
413{
414 // Do a quick save in playing mode and a regular save in Scenario Editor mode. In other cases, don't do anything.
415 if (gLegacyScene == LegacyScene::playing)
416 {
417 ToolCancel();
418 SaveGame();
419 }
420 else if (gLegacyScene == LegacyScene::scenarioEditor)
421 {
422 auto intent = Intent(WindowClass::loadsave);
423 intent.PutEnumExtra<LoadSaveAction>(INTENT_EXTRA_LOADSAVE_ACTION, LoadSaveAction::save);
424 intent.PutEnumExtra<LoadSaveType>(INTENT_EXTRA_LOADSAVE_TYPE, LoadSaveType::landscape);
425 intent.PutExtra(INTENT_EXTRA_PATH, getGameState().scenarioOptions.name);
426 ContextOpenIntent(&intent);
427 }
428}
429
430static void ShortcutLoadGame()
431{

Callers

nothing calls this directly

Calls 5

ToolCancelFunction · 0.85
SaveGameFunction · 0.85
ContextOpenIntentFunction · 0.85
IntentClass · 0.50
PutExtraMethod · 0.45

Tested by

no test coverage detected