diff options
| -rw-r--r-- | src/createinstancedialog.cpp | 12 | ||||
| -rw-r--r-- | src/main.cpp | 12 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/createinstancedialog.cpp b/src/createinstancedialog.cpp index d2846367..c976ee13 100644 --- a/src/createinstancedialog.cpp +++ b/src/createinstancedialog.cpp @@ -333,11 +333,17 @@ void CreateInstanceDialog::finish() if (ui->launch->isChecked()) { InstanceManager::instance().setCurrentInstance(ci.instanceName); - ExitModOrganizer(Exit::Restart); + + if (m_settings) { + // don't restart without settings, it happens on startup when there are + // no instances + ExitModOrganizer(Exit::Restart); + } + m_switching = true; - } else { - accept(); } + + accept(); } catch(Failed&) { diff --git a/src/main.cpp b/src/main.cpp index bfc074ec..bd7f8303 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -277,10 +277,20 @@ void openInstanceManager(PluginContainer& pc, QWidget* parent); std::optional<Instance> selectInstance() { NexusInterface ni(nullptr); - PluginContainer pc(nullptr); pc.loadPlugins(); + if (InstanceManager::instance().instancePaths().empty()) { + // no instances configured + CreateInstanceDialog dlg(pc, nullptr); + if (dlg.exec() != QDialog::Accepted) { + return {}; + } + + return InstanceManager::instance().currentInstance(); + } + + InstanceManagerDialog dlg(pc); dlg.setRestartOnSelect(false); |
