diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt
index ce2771a49..d09895773 100644
--- a/launcher/CMakeLists.txt
+++ b/launcher/CMakeLists.txt
@@ -944,6 +944,8 @@ SET(LAUNCHER_SOURCES
ui/dialogs/ChooseProviderDialog.cpp
ui/dialogs/ModUpdateDialog.cpp
ui/dialogs/ModUpdateDialog.h
+ ui/dialogs/InstallLoaderDialog.cpp
+ ui/dialogs/InstallLoaderDialog.h
# GUI - widgets
ui/widgets/Common.cpp
@@ -1066,6 +1068,7 @@ qt_wrap_ui(LAUNCHER_UI
ui/dialogs/ScrollMessageBox.ui
ui/dialogs/BlockedModsDialog.ui
ui/dialogs/ChooseProviderDialog.ui
+ ui/dialogs/InstallLoaderDialog.ui
)
qt_add_resources(LAUNCHER_RESOURCES
diff --git a/launcher/resources/multimc/multimc.qrc b/launcher/resources/multimc/multimc.qrc
index 2c00f28fa..f018e8748 100644
--- a/launcher/resources/multimc/multimc.qrc
+++ b/launcher/resources/multimc/multimc.qrc
@@ -347,5 +347,9 @@
scalable/export.svg
scalable/launch.svg
scalable/server.svg
+
+ scalable/fabric-loader.svg
+ scalable/quilt-loader.svg
+ scalable/forge-loader.svg
diff --git a/launcher/resources/multimc/scalable/fabric-loader.svg b/launcher/resources/multimc/scalable/fabric-loader.svg
new file mode 100644
index 000000000..06aa7801e
--- /dev/null
+++ b/launcher/resources/multimc/scalable/fabric-loader.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/launcher/resources/multimc/scalable/forge-loader.svg b/launcher/resources/multimc/scalable/forge-loader.svg
new file mode 100644
index 000000000..b73360b86
--- /dev/null
+++ b/launcher/resources/multimc/scalable/forge-loader.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/launcher/resources/multimc/scalable/quilt-loader.svg b/launcher/resources/multimc/scalable/quilt-loader.svg
new file mode 100644
index 000000000..fd6faea4b
--- /dev/null
+++ b/launcher/resources/multimc/scalable/quilt-loader.svg
@@ -0,0 +1,70 @@
+
+
diff --git a/launcher/ui/InstanceWindow.cpp b/launcher/ui/InstanceWindow.cpp
index c62b370fd..d9a21f6f2 100644
--- a/launcher/ui/InstanceWindow.cpp
+++ b/launcher/ui/InstanceWindow.cpp
@@ -263,6 +263,11 @@ bool InstanceWindow::selectPage(QString pageId)
return m_container->selectPage(pageId);
}
+BasePage* InstanceWindow::selectedPage()
+{
+ return m_container->selectedPage();
+}
+
void InstanceWindow::refreshContainer()
{
m_container->refreshContainer();
diff --git a/launcher/ui/InstanceWindow.h b/launcher/ui/InstanceWindow.h
index 554c4c740..78d7474da 100644
--- a/launcher/ui/InstanceWindow.h
+++ b/launcher/ui/InstanceWindow.h
@@ -56,6 +56,7 @@ public:
virtual ~InstanceWindow();
bool selectPage(QString pageId) override;
+ BasePage* selectedPage() override;
void refreshContainer() override;
QString instanceId();
diff --git a/launcher/ui/dialogs/InstallLoaderDialog.cpp b/launcher/ui/dialogs/InstallLoaderDialog.cpp
new file mode 100644
index 000000000..34c91c681
--- /dev/null
+++ b/launcher/ui/dialogs/InstallLoaderDialog.cpp
@@ -0,0 +1,121 @@
+#include "InstallLoaderDialog.h"
+
+#include
+#include
+#include
+#include "Application.h"
+#include "BuildConfig.h"
+#include "DesktopServices.h"
+#include "meta/Index.h"
+#include "minecraft/MinecraftInstance.h"
+#include "minecraft/PackProfile.h"
+#include "ui/widgets/PageContainer.h"
+#include "ui/widgets/VersionSelectWidget.h"
+
+class LoaderPage : public VersionSelectWidget, public BasePage {
+ public:
+ LoaderPage(const QString&& id,
+ const QString&& icon,
+ const QString&& name,
+ // "lightweight" loaders are independent to any game version
+ const bool lightweight,
+ const std::shared_ptr profile,
+ QWidget* parent = nullptr)
+ : VersionSelectWidget(parent), m_id(std::move(id)), m_icon(std::move(icon)), m_name(std::move(name))
+ {
+ const QString minecraftVersion = profile->getComponentVersion("net.minecraft");
+ setEmptyErrorString(tr("No versions are currently available for Minecraft %1").arg(minecraftVersion));
+ if (!lightweight)
+ setExactFilter(BaseVersionList::ParentVersionRole, minecraftVersion);
+
+ if (const QString currentVersion = profile->getComponentVersion(id); !currentVersion.isNull())
+ setCurrentVersion(currentVersion);
+ }
+
+ QString id() const override { return m_id; }
+ QString displayName() const override { return m_name; }
+ QIcon icon() const override { return APPLICATION->getThemedIcon(m_icon); }
+
+ void openedImpl() override
+ {
+ if (m_loaded)
+ return;
+
+ const auto versions = APPLICATION->metadataIndex()->get(m_id);
+ if (!versions)
+ return;
+
+ initialize(versions.get());
+ m_loaded = true;
+ }
+
+ private:
+ const QString m_id;
+ const QString m_icon;
+ const QString m_name;
+ bool m_loaded = false;
+};
+
+InstallLoaderDialog::InstallLoaderDialog(std::shared_ptr profile, QWidget* parent)
+ : QDialog(parent), m_profile(profile), m_container(new PageContainer(this))
+{
+ auto layout = new QVBoxLayout(this);
+
+ m_container->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+ layout->addWidget(m_container);
+
+ auto buttonLayout = new QHBoxLayout(this);
+
+ auto refreshButton = new QPushButton(tr("&Refresh"), this);
+ connect(refreshButton, &QPushButton::pressed, this, [this] {
+ LoaderPage* page = dynamic_cast(m_container->selectedPage());
+ Q_ASSERT(page != nullptr);
+ page->loadList();
+ });
+ buttonLayout->addWidget(refreshButton);
+
+ auto buttons = new QDialogButtonBox(this);
+ buttons->setOrientation(Qt::Horizontal);
+ buttons->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
+ connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
+ connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
+ buttonLayout->addWidget(buttons);
+
+ layout->addLayout(buttonLayout);
+
+ setWindowTitle(dialogTitle());
+ resize(650, 400);
+}
+
+QList InstallLoaderDialog::getPages()
+{
+ return { // Fabric
+ new LoaderPage("net.fabricmc.fabric-loader", "fabric-loader", tr("Fabric"), true, m_profile, this),
+ // Quilt
+ new LoaderPage("org.quiltmc.quilt-loader", "quilt-loader", tr("Quilt"), true, m_profile, this),
+ // Forge
+ new LoaderPage("net.minecraftforge", "forge-loader", tr("Forge"), false, m_profile, this),
+ // LiteLoader
+ new LoaderPage("com.mumfrey.liteloader", "liteloader", tr("LiteLoader"), false, m_profile, this)
+ };
+}
+
+QString InstallLoaderDialog::dialogTitle()
+{
+ return tr("Install Loader");
+}
+
+void InstallLoaderDialog::done(int result)
+{
+ if (result == Accepted) {
+ LoaderPage* page = dynamic_cast(m_container->selectedPage());
+ Q_ASSERT(page != nullptr);
+
+ if (page->selectedVersion()) {
+ m_profile->setComponentVersion(page->id(), page->selectedVersion()->descriptor());
+ m_profile->resolve(Net::Mode::Online);
+ }
+ }
+
+ QDialog::done(result);
+}
diff --git a/launcher/ui/dialogs/InstallLoaderDialog.h b/launcher/ui/dialogs/InstallLoaderDialog.h
new file mode 100644
index 000000000..26b39e4a9
--- /dev/null
+++ b/launcher/ui/dialogs/InstallLoaderDialog.h
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-3.0-only
+/*
+ * Prism Launcher - Minecraft Launcher
+ * Copyright (C) 2022 TheKodeToad
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#pragma once
+
+#include
+#include "ui/pages/BasePageProvider.h"
+
+class MinecraftInstance;
+class PageContainer;
+class PackProfile;
+
+class InstallLoaderDialog : public QDialog, public BasePageProvider {
+ Q_OBJECT
+
+ public:
+ explicit InstallLoaderDialog(std::shared_ptr instance, QWidget* parent = nullptr);
+
+ QList getPages() override;
+ QString dialogTitle() override;
+
+ void done(int result) override;
+
+ private:
+ std::shared_ptr m_profile;
+ PageContainer* m_container;
+};
diff --git a/launcher/ui/dialogs/ResourceDownloadDialog.cpp b/launcher/ui/dialogs/ResourceDownloadDialog.cpp
index 6d90480ff..784662a07 100644
--- a/launcher/ui/dialogs/ResourceDownloadDialog.cpp
+++ b/launcher/ui/dialogs/ResourceDownloadDialog.cpp
@@ -148,15 +148,17 @@ bool ResourceDownloadDialog::selectPage(QString pageId)
return m_container->selectPage(pageId);
}
-ResourcePage* ResourceDownloadDialog::getSelectedPage()
+ResourcePage* ResourceDownloadDialog::selectedPage()
{
- return m_selectedPage;
+ ResourcePage* result = dynamic_cast(m_container->selectedPage());
+ Q_ASSERT(result != nullptr);
+ return result;
}
void ResourceDownloadDialog::addResource(ModPlatform::IndexedPack::Ptr pack, ModPlatform::IndexedVersion& ver)
{
removeResource(pack->name);
- m_selectedPage->addResourceToPage(pack, ver, getBaseModel());
+ selectedPage()->addResourceToPage(pack, ver, getBaseModel());
setButtonStatus();
}
@@ -196,14 +198,8 @@ void ResourceDownloadDialog::selectedPageChanged(BasePage* previous, BasePage* s
return;
}
- m_selectedPage = dynamic_cast(selected);
- if (!m_selectedPage) {
- qCritical() << "Page '" << selected->displayName() << "' in ResourceDownloadDialog is not a ResourcePage!";
- return;
- }
-
// Same effect as having a global search bar
- m_selectedPage->setSearchTerm(prev_page->getSearchTerm());
+ selectedPage()->setSearchTerm(prev_page->getSearchTerm());
}
ModDownloadDialog::ModDownloadDialog(QWidget* parent, const std::shared_ptr& mods, BaseInstance* instance)
@@ -226,8 +222,6 @@ QList ModDownloadDialog::getPages()
if (APPLICATION->capabilities() & Application::SupportsFlame)
pages.append(FlameModPage::create(this, *m_instance));
- m_selectedPage = dynamic_cast(pages[0]);
-
return pages;
}
@@ -253,8 +247,6 @@ QList ResourcePackDownloadDialog::getPages()
if (APPLICATION->capabilities() & Application::SupportsFlame)
pages.append(FlameResourcePackPage::create(this, *m_instance));
- m_selectedPage = dynamic_cast(pages[0]);
-
return pages;
}
@@ -280,8 +272,6 @@ QList TexturePackDownloadDialog::getPages()
if (APPLICATION->capabilities() & Application::SupportsFlame)
pages.append(FlameTexturePackPage::create(this, *m_instance));
- m_selectedPage = dynamic_cast(pages[0]);
-
return pages;
}
@@ -302,11 +292,7 @@ ShaderPackDownloadDialog::ShaderPackDownloadDialog(QWidget* parent,
QList ShaderPackDownloadDialog::getPages()
{
QList pages;
-
pages.append(ModrinthShaderPackPage::create(this, *m_instance));
-
- m_selectedPage = dynamic_cast(pages[0]);
-
return pages;
}
diff --git a/launcher/ui/dialogs/ResourceDownloadDialog.h b/launcher/ui/dialogs/ResourceDownloadDialog.h
index 5b5b48c63..5077b2ca0 100644
--- a/launcher/ui/dialogs/ResourceDownloadDialog.h
+++ b/launcher/ui/dialogs/ResourceDownloadDialog.h
@@ -60,7 +60,7 @@ class ResourceDownloadDialog : public QDialog, public BasePageProvider {
QString dialogTitle() override { return tr("Download %1").arg(resourcesString()); };
bool selectPage(QString pageId);
- ResourcePage* getSelectedPage();
+ ResourcePage* selectedPage();
void addResource(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&);
void removeResource(const QString&);
@@ -85,7 +85,6 @@ class ResourceDownloadDialog : public QDialog, public BasePageProvider {
const std::shared_ptr m_base_model;
PageContainer* m_container = nullptr;
- ResourcePage* m_selectedPage = nullptr;
QDialogButtonBox m_buttons;
QVBoxLayout m_vertical_layout;
diff --git a/launcher/ui/pages/BasePageContainer.h b/launcher/ui/pages/BasePageContainer.h
index b41fe12af..4cb7fe29c 100644
--- a/launcher/ui/pages/BasePageContainer.h
+++ b/launcher/ui/pages/BasePageContainer.h
@@ -7,6 +7,7 @@ class BasePageContainer
public:
virtual ~BasePageContainer(){};
virtual bool selectPage(QString pageId) = 0;
+ virtual BasePage* selectedPage() = 0;
virtual BasePage* getPage(QString pageId) { return nullptr; };
virtual void refreshContainer() = 0;
virtual bool requestClose() = 0;
diff --git a/launcher/ui/pages/instance/VersionPage.cpp b/launcher/ui/pages/instance/VersionPage.cpp
index 74b7ec7c2..97a6bbe4a 100644
--- a/launcher/ui/pages/instance/VersionPage.cpp
+++ b/launcher/ui/pages/instance/VersionPage.cpp
@@ -52,6 +52,7 @@
#include
#include "VersionPage.h"
+#include "ui/dialogs/InstallLoaderDialog.h"
#include "ui_VersionPage.h"
#include "ui/dialogs/CustomMessageBox.h"
@@ -254,20 +255,6 @@ void VersionPage::updateRunningStatus(bool running)
void VersionPage::updateVersionControls()
{
- // FIXME: this is a dirty hack
- auto minecraftVersion = Version(m_profile->getComponentVersion("net.minecraft"));
-
- ui->actionInstall_Forge->setEnabled(controlsEnabled);
-
- bool supportsFabric = minecraftVersion >= Version("1.14");
- ui->actionInstall_Fabric->setEnabled(controlsEnabled && supportsFabric);
-
- bool supportsQuilt = minecraftVersion >= Version("1.14");
- ui->actionInstall_Quilt->setEnabled(controlsEnabled && supportsQuilt);
-
- bool supportsLiteLoader = minecraftVersion <= Version("1.12.2");
- ui->actionInstall_LiteLoader->setEnabled(controlsEnabled && supportsLiteLoader);
-
updateButtons();
}
@@ -287,7 +274,6 @@ void VersionPage::updateButtons(int row)
ui->actionAdd_Empty->setEnabled(controlsEnabled);
ui->actionImport_Components->setEnabled(controlsEnabled);
ui->actionReload->setEnabled(controlsEnabled);
- ui->actionInstall_mods->setEnabled(controlsEnabled);
ui->actionReplace_Minecraft_jar->setEnabled(controlsEnabled);
ui->actionAdd_to_Minecraft_jar->setEnabled(controlsEnabled);
ui->actionAdd_Agents->setEnabled(controlsEnabled);
@@ -446,17 +432,6 @@ void VersionPage::on_actionChange_version_triggered()
return;
}
auto uid = list->uid();
- // FIXME: this is a horrible HACK. Get version filtering information from the actual metadata...
- if(uid == "net.minecraftforge")
- {
- on_actionInstall_Forge_triggered();
- return;
- }
- else if (uid == "com.mumfrey.liteloader")
- {
- on_actionInstall_LiteLoader_triggered();
- return;
- }
VersionSelectDialog vselect(list.get(), tr("Change %1 version").arg(name), this);
if (uid == "net.fabricmc.intermediary" || uid == "org.quiltmc.hashed")
{
@@ -508,87 +483,11 @@ void VersionPage::on_actionDownload_All_triggered()
m_container->refreshContainer();
}
-void VersionPage::on_actionInstall_Forge_triggered()
+void VersionPage::on_actionInstall_Loader_triggered()
{
- auto vlist = APPLICATION->metadataIndex()->get("net.minecraftforge");
- if(!vlist)
- {
- return;
- }
- VersionSelectDialog vselect(vlist.get(), tr("Select Forge version"), this);
- vselect.setExactFilter(BaseVersionList::ParentVersionRole, m_profile->getComponentVersion("net.minecraft"));
- vselect.setEmptyString(tr("No Forge versions are currently available for Minecraft ") + m_profile->getComponentVersion("net.minecraft"));
- vselect.setEmptyErrorString(tr("Couldn't load or download the Forge version lists!"));
-
- auto currentVersion = m_profile->getComponentVersion("net.minecraftforge");
- if(!currentVersion.isEmpty())
- {
- vselect.setCurrentVersion(currentVersion);
- }
-
- if (vselect.exec() && vselect.selectedVersion())
- {
- auto vsn = vselect.selectedVersion();
- m_profile->setComponentVersion("net.minecraftforge", vsn->descriptor());
- m_profile->resolve(Net::Mode::Online);
- // m_profile->installVersion();
- preselect(m_profile->rowCount(QModelIndex())-1);
- m_container->refreshContainer();
- }
-}
-
-void VersionPage::on_actionInstall_Fabric_triggered()
-{
- auto vlist = APPLICATION->metadataIndex()->get("net.fabricmc.fabric-loader");
- if(!vlist)
- {
- return;
- }
- VersionSelectDialog vselect(vlist.get(), tr("Select Fabric Loader version"), this);
- vselect.setEmptyString(tr("No Fabric Loader versions are currently available."));
- vselect.setEmptyErrorString(tr("Couldn't load or download the Fabric Loader version lists!"));
-
- auto currentVersion = m_profile->getComponentVersion("net.fabricmc.fabric-loader");
- if(!currentVersion.isEmpty())
- {
- vselect.setCurrentVersion(currentVersion);
- }
-
- if (vselect.exec() && vselect.selectedVersion())
- {
- auto vsn = vselect.selectedVersion();
- m_profile->setComponentVersion("net.fabricmc.fabric-loader", vsn->descriptor());
- m_profile->resolve(Net::Mode::Online);
- preselect(m_profile->rowCount(QModelIndex())-1);
- m_container->refreshContainer();
- }
-}
-
-void VersionPage::on_actionInstall_Quilt_triggered()
-{
- auto vlist = APPLICATION->metadataIndex()->get("org.quiltmc.quilt-loader");
- if(!vlist)
- {
- return;
- }
- VersionSelectDialog vselect(vlist.get(), tr("Select Quilt Loader version"), this);
- vselect.setEmptyString(tr("No Quilt Loader versions are currently available."));
- vselect.setEmptyErrorString(tr("Couldn't load or download the Quilt Loader version lists!"));
-
- auto currentVersion = m_profile->getComponentVersion("org.quiltmc.quilt-loader");
- if(!currentVersion.isEmpty())
- {
- vselect.setCurrentVersion(currentVersion);
- }
-
- if (vselect.exec() && vselect.selectedVersion())
- {
- auto vsn = vselect.selectedVersion();
- m_profile->setComponentVersion("org.quiltmc.quilt-loader", vsn->descriptor());
- m_profile->resolve(Net::Mode::Online);
- preselect(m_profile->rowCount(QModelIndex())-1);
- m_container->refreshContainer();
- }
+ InstallLoaderDialog dialog(m_inst->getPackProfile(), this);
+ dialog.exec();
+ m_container->refreshContainer();
}
void VersionPage::on_actionAdd_Empty_triggered()
@@ -609,35 +508,6 @@ void VersionPage::on_actionAdd_Empty_triggered()
}
}
-void VersionPage::on_actionInstall_LiteLoader_triggered()
-{
- auto vlist = APPLICATION->metadataIndex()->get("com.mumfrey.liteloader");
- if(!vlist)
- {
- return;
- }
- VersionSelectDialog vselect(vlist.get(), tr("Select LiteLoader version"), this);
- vselect.setExactFilter(BaseVersionList::ParentVersionRole, m_profile->getComponentVersion("net.minecraft"));
- vselect.setEmptyString(tr("No LiteLoader versions are currently available for Minecraft ") + m_profile->getComponentVersion("net.minecraft"));
- vselect.setEmptyErrorString(tr("Couldn't load or download the LiteLoader version lists!"));
-
- auto currentVersion = m_profile->getComponentVersion("com.mumfrey.liteloader");
- if(!currentVersion.isEmpty())
- {
- vselect.setCurrentVersion(currentVersion);
- }
-
- if (vselect.exec() && vselect.selectedVersion())
- {
- auto vsn = vselect.selectedVersion();
- m_profile->setComponentVersion("com.mumfrey.liteloader", vsn->descriptor());
- m_profile->resolve(Net::Mode::Online);
- // m_profile->installVersion(vselect.selectedVersion());
- preselect(m_profile->rowCount(QModelIndex())-1);
- m_container->refreshContainer();
- }
-}
-
void VersionPage::on_actionLibrariesFolder_triggered()
{
DesktopServices::openDirectory(m_inst->getLocalLibraryPath(), true);
diff --git a/launcher/ui/pages/instance/VersionPage.h b/launcher/ui/pages/instance/VersionPage.h
index d00877142..0dcb4635a 100644
--- a/launcher/ui/pages/instance/VersionPage.h
+++ b/launcher/ui/pages/instance/VersionPage.h
@@ -79,11 +79,8 @@ public:
private slots:
void on_actionChange_version_triggered();
- void on_actionInstall_Forge_triggered();
- void on_actionInstall_Fabric_triggered();
- void on_actionInstall_Quilt_triggered();
+ void on_actionInstall_Loader_triggered();
void on_actionAdd_Empty_triggered();
- void on_actionInstall_LiteLoader_triggered();
void on_actionReload_triggered();
void on_actionRemove_triggered();
void on_actionMove_up_triggered();
diff --git a/launcher/ui/pages/instance/VersionPage.ui b/launcher/ui/pages/instance/VersionPage.ui
index 4777eafe0..cf7c659bc 100644
--- a/launcher/ui/pages/instance/VersionPage.ui
+++ b/launcher/ui/pages/instance/VersionPage.ui
@@ -98,12 +98,7 @@
-
-
-
-
-
-
+
@@ -118,26 +113,26 @@
- Change version
+ Change Version
- Change version of the selected package.
+ Change version of the selected component.
- Move up
+ Move Up
- Make the selected package apply sooner.
+ Make the selected component apply sooner.
- Move down
+ Move Down
- Make the selected package apply later.
+ Make the selected component apply later.
@@ -145,7 +140,7 @@
Remove
- Remove selected package from the instance.
+ Remove selected component from the instance.
@@ -153,7 +148,7 @@
Customize
- Customize selected package.
+ Customize selected component.
@@ -161,7 +156,7 @@
Edit
- Edit selected package.
+ Edit selected component.
@@ -169,47 +164,15 @@
Revert
- Revert the selected package to default.
+ Revert the selected component to default.
-
+
- Install Forge
+ Install Loader
- Install the Minecraft Forge package.
-
-
-
-
- Install Fabric
-
-
- Install the Fabric Loader package.
-
-
-
-
- Install Quilt
-
-
- Install the Quilt Loader package.
-
-
-
-
- Install LiteLoader
-
-
- Install the LiteLoader package.
-
-
-
-
- Install mods
-
-
- Install normal mods.
+ Install a mod loader.
@@ -238,7 +201,7 @@
Add Empty
- Add an empty custom package.
+ Add an empty custom component.
@@ -246,12 +209,12 @@
Reload
- Reload all packages.
+ Reload all components.
- Download All
+ Download all
Download the files needed to launch the instance now.
diff --git a/launcher/ui/pages/modplatform/ResourcePage.cpp b/launcher/ui/pages/modplatform/ResourcePage.cpp
index 1d2509d80..91d722fca 100644
--- a/launcher/ui/pages/modplatform/ResourcePage.cpp
+++ b/launcher/ui/pages/modplatform/ResourcePage.cpp
@@ -389,7 +389,7 @@ void ResourcePage::openUrl(const QUrl& url)
if (slug != getCurrentPack()->slug) {
m_parent_dialog->selectPage(page);
- auto newPage = m_parent_dialog->getSelectedPage();
+ auto newPage = m_parent_dialog->selectedPage();
QLineEdit* searchEdit = newPage->m_ui->searchEdit;
auto model = newPage->m_model;
diff --git a/launcher/ui/widgets/PageContainer.cpp b/launcher/ui/widgets/PageContainer.cpp
index 38a228973..c3606b789 100644
--- a/launcher/ui/widgets/PageContainer.cpp
+++ b/launcher/ui/widgets/PageContainer.cpp
@@ -137,6 +137,11 @@ BasePage* PageContainer::getPage(QString pageId)
return m_model->findPageEntryById(pageId);
}
+BasePage* PageContainer::selectedPage()
+{
+ return m_currentPage;
+}
+
const QList PageContainer::getPages() const
{
return m_model->pages();
diff --git a/launcher/ui/widgets/PageContainer.h b/launcher/ui/widgets/PageContainer.h
index ad74d43a2..89c3343ed 100644
--- a/launcher/ui/widgets/PageContainer.h
+++ b/launcher/ui/widgets/PageContainer.h
@@ -78,7 +78,8 @@ public:
return false;
}
- virtual bool selectPage(QString pageId) override;
+ bool selectPage(QString pageId) override;
+ BasePage* selectedPage() override;
BasePage* getPage(QString pageId) override;
const QList getPages() const;