diff options
Diffstat (limited to 'launcher/ui/pages/modplatform/ModPage.h')
-rw-r--r-- | launcher/ui/pages/modplatform/ModPage.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/launcher/ui/pages/modplatform/ModPage.h b/launcher/ui/pages/modplatform/ModPage.h index f79d494f..cd034a3a 100644 --- a/launcher/ui/pages/modplatform/ModPage.h +++ b/launcher/ui/pages/modplatform/ModPage.h @@ -15,23 +15,27 @@ namespace Ui { class ModPage; } +/* This page handles most logic related to browsing and selecting mods to download. + * By default, the methods provided work with net requests, to fetch data from remote APIs. */ class ModPage : public QWidget, public BasePage { Q_OBJECT public: - explicit ModPage(ModDownloadDialog* dialog, BaseInstance* instance); + explicit ModPage(ModDownloadDialog* dialog, BaseInstance* instance, ModAPI* api); virtual ~ModPage(); + /* The name visible to the user */ virtual QString displayName() const override = 0; virtual QIcon icon() const override = 0; virtual QString id() const override = 0; virtual QString helpPage() const override = 0; - virtual QString debugName() const = 0; virtual QString metaEntryBase() const = 0; + /* This only appears in the debug console */ + virtual QString debugName() const = 0; virtual bool shouldDisplay() const override = 0; - virtual const ModAPI* apiProvider() const = 0; + const ModAPI* apiProvider() const { return api.get(); }; void openedImpl() override; bool eventFilter(QObject* watched, QEvent* event) override; @@ -55,5 +59,7 @@ class ModPage : public QWidget, public BasePage { ModPlatform::ListModel* listModel = nullptr; ModPlatform::IndexedPack current; + std::unique_ptr<ModAPI> api; + int selectedVersion = -1; }; |