Merge pull request #675 from flowln/generalize_mod_model
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2022 flow <flowlnlnln@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2022 flowln <flowlnlnln@gmail.com>
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: 2022 flow <flowlnlnln@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2022 flowln <flowlnlnln@gmail.com>
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
#include "modplatform/flame/FlameAPI.h"
|
||||
#include "modplatform/flame/FlamePackIndex.h"
|
||||
|
||||
#include "net/NetJob.h"
|
||||
|
||||
#include "ui/pages/BasePage.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
@ -49,8 +49,8 @@
|
||||
|
||||
#include "ui/GuiUtil.h"
|
||||
#include "ui/dialogs/CustomMessageBox.h"
|
||||
#include "ui/dialogs/ModDownloadDialog.h"
|
||||
#include "ui/dialogs/ModUpdateDialog.h"
|
||||
#include "ui/dialogs/ResourceDownloadDialog.h"
|
||||
|
||||
#include "DesktopServices.h"
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
#include "minecraft/mod/Mod.h"
|
||||
#include "minecraft/mod/ModFolderModel.h"
|
||||
|
||||
#include "modplatform/ModAPI.h"
|
||||
#include "modplatform/ResourceAPI.h"
|
||||
|
||||
#include "Version.h"
|
||||
#include "tasks/ConcurrentTask.h"
|
||||
@ -153,12 +153,12 @@ void ModFolderPage::installMods()
|
||||
return; // this is a null instance or a legacy instance
|
||||
|
||||
auto profile = static_cast<MinecraftInstance*>(m_instance)->getPackProfile();
|
||||
if (profile->getModLoaders() == ModAPI::Unspecified) {
|
||||
if (!profile->getModLoaders().has_value()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Please install a mod loader first!"));
|
||||
return;
|
||||
}
|
||||
|
||||
ModDownloadDialog mdownload(m_model, this, m_instance);
|
||||
ResourceDownload::ModDownloadDialog mdownload(this, m_model, m_instance);
|
||||
if (mdownload.exec()) {
|
||||
ConcurrentTask* tasks = new ConcurrentTask(this);
|
||||
connect(tasks, &Task::failed, [this, tasks](QString reason) {
|
||||
|
@ -73,3 +73,4 @@ public:
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user