| 63 | |
| 64 | |
| 65 | void Manager::launch(std::string pathArg) { |
| 66 | // Don't load any patches if safe mode is enabled |
| 67 | if (settings::safeMode) |
| 68 | return; |
| 69 | |
| 70 | // Load the argument if exists |
| 71 | if (pathArg != "") { |
| 72 | loadAction(pathArg); |
| 73 | return; |
| 74 | } |
| 75 | |
| 76 | // Try loading the autosave patch |
| 77 | if (hasAutosave()) { |
| 78 | try { |
| 79 | loadAutosave(); |
| 80 | // Keep path and save state as it was stored in patch.json |
| 81 | } |
| 82 | catch (Exception& e) { |
| 83 | osdialog_message(OSDIALOG_WARNING, OSDIALOG_OK, e.what()); |
| 84 | } |
| 85 | return; |
| 86 | } |
| 87 | |
| 88 | // Try loading the template patch |
| 89 | loadTemplate(); |
| 90 | } |
| 91 | |
| 92 | |
| 93 | void Manager::clear() { |