diff options
Diffstat (limited to 'application')
-rw-r--r-- | application/InstancePageProvider.h | 4 | ||||
-rw-r--r-- | application/pages/ModFolderPage.cpp | 3 | ||||
-rw-r--r-- | application/pages/ModFolderPage.h | 2 | ||||
-rw-r--r-- | application/pages/VersionPage.cpp | 17 | ||||
-rw-r--r-- | application/pages/VersionPage.h | 7 | ||||
-rw-r--r-- | application/pages/WorldListPage.h | 2 |
6 files changed, 19 insertions, 16 deletions
diff --git a/application/InstancePageProvider.h b/application/InstancePageProvider.h index 2f1dcced..ac5306c0 100644 --- a/application/InstancePageProvider.h +++ b/application/InstancePageProvider.h @@ -1,5 +1,5 @@ #pragma once -#include "minecraft/onesix/OneSixInstance.h" +#include "minecraft/MinecraftInstance.h" #include <FileSystem.h> #include "pages/BasePage.h" #include "pages/LogPage.h" @@ -29,7 +29,7 @@ public: { QList<BasePage *> values; values.append(new LogPage(inst)); - std::shared_ptr<OneSixInstance> onesix = std::dynamic_pointer_cast<OneSixInstance>(inst); + std::shared_ptr<MinecraftInstance> onesix = std::dynamic_pointer_cast<MinecraftInstance>(inst); if(onesix) { values.append(new VersionPage(onesix.get())); diff --git a/application/pages/ModFolderPage.cpp b/application/pages/ModFolderPage.cpp index 5c60cc7f..422e1eb4 100644 --- a/application/pages/ModFolderPage.cpp +++ b/application/pages/ModFolderPage.cpp @@ -28,6 +28,7 @@ #include "minecraft/ModList.h" #include "minecraft/Mod.h" #include "minecraft/VersionFilterData.h" +#include "minecraft/MinecraftProfile.h" #include <DesktopServices.h> ModFolderPage::ModFolderPage(BaseInstance *inst, std::shared_ptr<ModList> mods, QString id, @@ -99,7 +100,7 @@ bool CoreModFolderPage::shouldDisplay() const { if (ModFolderPage::shouldDisplay()) { - auto inst = dynamic_cast<OneSixInstance *>(m_inst); + auto inst = dynamic_cast<MinecraftInstance *>(m_inst); if (!inst) return true; auto version = inst->getMinecraftProfile(); diff --git a/application/pages/ModFolderPage.h b/application/pages/ModFolderPage.h index 191fa9dc..1328d2dd 100644 --- a/application/pages/ModFolderPage.h +++ b/application/pages/ModFolderPage.h @@ -17,7 +17,7 @@ #include <QWidget> -#include "minecraft/onesix/OneSixInstance.h" +#include "minecraft/MinecraftInstance.h" #include "BasePage.h" #include <MultiMC.h> diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index c280f98f..343e1d2a 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -50,13 +50,13 @@ class IconProxy : public QIdentityProxyModel { Q_OBJECT public: - + IconProxy(QWidget *parentWidget) : QIdentityProxyModel(parentWidget) { connect(parentWidget, &QObject::destroyed, this, &IconProxy::widgetGone); m_parentWidget = parentWidget; } - + virtual QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const override { QVariant var = QIdentityProxyModel::data(mapToSource(proxyIndex), role); @@ -103,7 +103,7 @@ void VersionPage::setParentContainer(BasePageContainer * container) m_container = container; } -VersionPage::VersionPage(OneSixInstance *inst, QWidget *parent) +VersionPage::VersionPage(MinecraftInstance *inst, QWidget *parent) : QWidget(parent), ui(new Ui::VersionPage), m_inst(inst) { ui->setupUi(this); @@ -130,7 +130,7 @@ VersionPage::VersionPage(OneSixInstance *inst, QWidget *parent) { disableVersionControls(); } - connect(m_inst, &OneSixInstance::versionReloaded, this, + connect(m_inst, &MinecraftInstance::versionReloaded, this, &VersionPage::updateVersionControls); } @@ -381,8 +381,8 @@ void VersionPage::on_forgeBtn_clicked() return; } VersionSelectDialog vselect(vlist.get(), tr("Select Forge version"), this); - vselect.setExactFilter(BaseVersionList::ParentVersionRole, m_inst->currentVersionId()); - vselect.setEmptyString(tr("No Forge versions are currently available for Minecraft ") + m_inst->currentVersionId()); + vselect.setExactFilter(BaseVersionList::ParentVersionRole, m_inst->getComponentVersion("net.minecraft")); + vselect.setEmptyString(tr("No Forge versions are currently available for Minecraft ") + m_inst->getComponentVersion("net.minecraft")); vselect.setEmptyErrorString(tr("Couldn't load or download the Forge version lists!")); if (vselect.exec() && vselect.selectedVersion()) { @@ -403,8 +403,8 @@ void VersionPage::on_liteloaderBtn_clicked() return; } VersionSelectDialog vselect(vlist.get(), tr("Select LiteLoader version"), this); - vselect.setExactFilter(BaseVersionList::ParentVersionRole, m_inst->currentVersionId()); - vselect.setEmptyString(tr("No LiteLoader versions are currently available for Minecraft ") + m_inst->currentVersionId()); + vselect.setExactFilter(BaseVersionList::ParentVersionRole, m_inst->getComponentVersion("net.minecraft")); + vselect.setEmptyString(tr("No LiteLoader versions are currently available for Minecraft ") + m_inst->getComponentVersion("net.minecraft")); vselect.setEmptyErrorString(tr("Couldn't load or download the LiteLoader version lists!")); if (vselect.exec() && vselect.selectedVersion()) { @@ -548,3 +548,4 @@ void VersionPage::on_revertBtn_clicked() } #include "VersionPage.moc" + diff --git a/application/pages/VersionPage.h b/application/pages/VersionPage.h index 11852d37..dff3abd6 100644 --- a/application/pages/VersionPage.h +++ b/application/pages/VersionPage.h @@ -17,7 +17,8 @@ #include <QWidget> -#include "minecraft/onesix/OneSixInstance.h" +#include "minecraft/MinecraftInstance.h" +#include "minecraft/MinecraftProfile.h" #include "BasePage.h" namespace Ui @@ -30,7 +31,7 @@ class VersionPage : public QWidget, public BasePage Q_OBJECT public: - explicit VersionPage(OneSixInstance *inst, QWidget *parent = 0); + explicit VersionPage(MinecraftInstance *inst, QWidget *parent = 0); virtual ~VersionPage(); virtual QString displayName() const override { @@ -82,7 +83,7 @@ protected: private: Ui::VersionPage *ui; std::shared_ptr<MinecraftProfile> m_profile; - OneSixInstance *m_inst; + MinecraftInstance *m_inst; int currentIdx = 0; BasePageContainer * m_container = nullptr; diff --git a/application/pages/WorldListPage.h b/application/pages/WorldListPage.h index 89d86158..b70cd795 100644 --- a/application/pages/WorldListPage.h +++ b/application/pages/WorldListPage.h @@ -17,7 +17,7 @@ #include <QWidget> -#include "minecraft/onesix/OneSixInstance.h" +#include "minecraft/MinecraftInstance.h" #include "BasePage.h" #include <MultiMC.h> #include <LoggedProcess.h> |