diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-07-24 10:10:19 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-11-03 11:39:04 -0500 |
| commit | 7b02c77a3961d859aae270922db26bbc999677cb (patch) | |
| tree | 26ee7c2d8387aad110c53477aed85bd3757d47c2 /src/createinstancedialog.h | |
| parent | 2cb5c21b8e15b02a09144ff6c1ab11e87879a420 (diff) | |
review page
Diffstat (limited to 'src/createinstancedialog.h')
| -rw-r--r-- | src/createinstancedialog.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/createinstancedialog.h b/src/createinstancedialog.h index 02608c8d..d9c392ca 100644 --- a/src/createinstancedialog.h +++ b/src/createinstancedialog.h @@ -21,6 +21,17 @@ public: Portable }; + struct Paths + { + QString base; + QString downloads; + QString mods; + QString profiles; + QString overwrite; + + auto operator<=>(const Paths&) const = default; + }; + explicit CreateInstanceDialog( const PluginContainer& pc, QWidget *parent = nullptr); @@ -38,15 +49,31 @@ public: void updateNavigation(); bool isOnLastPage() const; - Types selectedType() const; - MOBase::IPluginGame* selectedGame() const; + Types instanceType() const; + MOBase::IPluginGame* game() const; + QString gameLocation() const; + QString gameEdition() const; QString instanceName() const; + Paths paths() const; private: std::unique_ptr<Ui::CreateInstanceDialog> ui; const PluginContainer& m_pc; std::vector<std::unique_ptr<cid::Page>> m_pages; QString m_originalNext; + + template <class T> + T getSelected(T (cid::Page::*mf)() const) const + { + for (auto&& p : m_pages) { + const auto t = (p.get()->*mf)(); + if (t != T()) { + return t; + } + } + + return T(); + } }; #endif // MODORGANIZER_CREATEINSTANCEDIALOG_INCLUDED |
