Merge pull request #897 from jamierocks/atl-updating-initial
This commit is contained in:
commit
c375e7b4df
@ -764,6 +764,8 @@ SET(LAUNCHER_SOURCES
|
||||
ui/pages/modplatform/atlauncher/AtlOptionalModDialog.h
|
||||
ui/pages/modplatform/atlauncher/AtlPage.cpp
|
||||
ui/pages/modplatform/atlauncher/AtlPage.h
|
||||
ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp
|
||||
ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.h
|
||||
|
||||
ui/pages/modplatform/ftb/FtbFilterModel.cpp
|
||||
ui/pages/modplatform/ftb/FtbFilterModel.h
|
||||
|
@ -60,12 +60,13 @@ namespace ATLauncher {
|
||||
|
||||
static Meta::VersionPtr getComponentVersion(const QString& uid, const QString& version);
|
||||
|
||||
PackInstallTask::PackInstallTask(UserInteractionSupport *support, QString packName, QString version)
|
||||
PackInstallTask::PackInstallTask(UserInteractionSupport *support, QString packName, QString version, InstallMode installMode)
|
||||
{
|
||||
m_support = support;
|
||||
m_pack_name = packName;
|
||||
m_pack_safe_name = packName.replace(QRegularExpression("[^A-Za-z0-9]"), "");
|
||||
m_version_name = version;
|
||||
m_install_mode = installMode;
|
||||
}
|
||||
|
||||
bool PackInstallTask::abort()
|
||||
@ -117,9 +118,30 @@ void PackInstallTask::onDownloadSucceeded()
|
||||
}
|
||||
m_version = version;
|
||||
|
||||
// Display install message if one exists
|
||||
if (!m_version.messages.install.isEmpty())
|
||||
m_support->displayMessage(m_version.messages.install);
|
||||
// Derived from the installation mode
|
||||
QString message;
|
||||
bool resetDirectory;
|
||||
|
||||
switch (m_install_mode) {
|
||||
case InstallMode::Reinstall:
|
||||
case InstallMode::Update:
|
||||
message = m_version.messages.update;
|
||||
resetDirectory = true;
|
||||
break;
|
||||
|
||||
case InstallMode::Install:
|
||||
message = m_version.messages.install;
|
||||
resetDirectory = false;
|
||||
break;
|
||||
|
||||
default:
|
||||
emitFailed(tr("Unsupported installation mode"));
|
||||
break;
|
||||
}
|
||||
|
||||
// Display message if one exists
|
||||
if (!message.isEmpty())
|
||||
m_support->displayMessage(message);
|
||||
|
||||
auto ver = getComponentVersion("net.minecraft", m_version.minecraft);
|
||||
if (!ver) {
|
||||
@ -128,6 +150,10 @@ void PackInstallTask::onDownloadSucceeded()
|
||||
}
|
||||
minecraftVersion = ver;
|
||||
|
||||
if (resetDirectory) {
|
||||
deleteExistingFiles();
|
||||
}
|
||||
|
||||
if(m_version.noConfigs) {
|
||||
downloadMods();
|
||||
}
|
||||
@ -143,6 +169,116 @@ void PackInstallTask::onDownloadFailed(QString reason)
|
||||
emitFailed(reason);
|
||||
}
|
||||
|
||||
void PackInstallTask::deleteExistingFiles()
|
||||
{
|
||||
setStatus(tr("Deleting existing files..."));
|
||||
|
||||
// Setup defaults, as per https://wiki.atlauncher.com/pack-admin/xml/delete
|
||||
VersionDeletes deletes;
|
||||
deletes.folders.append(VersionDelete{ "root", "mods%s%" });
|
||||
deletes.folders.append(VersionDelete{ "root", "configs%s%" });
|
||||
deletes.folders.append(VersionDelete{ "root", "bin%s%" });
|
||||
|
||||
// Setup defaults, as per https://wiki.atlauncher.com/pack-admin/xml/keep
|
||||
VersionKeeps keeps;
|
||||
keeps.files.append(VersionKeep{ "root", "mods%s%PortalGunSounds.pak" });
|
||||
keeps.folders.append(VersionKeep{ "root", "mods%s%rei_minimap%s%" });
|
||||
keeps.folders.append(VersionKeep{ "root", "mods%s%VoxelMods%s%" });
|
||||
keeps.files.append(VersionKeep{ "root", "config%s%NEI.cfg" });
|
||||
keeps.files.append(VersionKeep{ "root", "options.txt" });
|
||||
keeps.files.append(VersionKeep{ "root", "servers.dat" });
|
||||
|
||||
// Merge with version deletes and keeps
|
||||
for (const auto& item : m_version.deletes.files)
|
||||
deletes.files.append(item);
|
||||
for (const auto& item : m_version.deletes.folders)
|
||||
deletes.folders.append(item);
|
||||
for (const auto& item : m_version.keeps.files)
|
||||
keeps.files.append(item);
|
||||
for (const auto& item : m_version.keeps.folders)
|
||||
keeps.folders.append(item);
|
||||
|
||||
auto getPathForBase = [this](const QString& base) {
|
||||
auto minecraftPath = FS::PathCombine(m_stagingPath, "minecraft");
|
||||
|
||||
if (base == "root") {
|
||||
return minecraftPath;
|
||||
}
|
||||
else if (base == "config") {
|
||||
return FS::PathCombine(minecraftPath, "config");
|
||||
}
|
||||
else {
|
||||
qWarning() << "Unrecognised base path" << base;
|
||||
return minecraftPath;
|
||||
}
|
||||
};
|
||||
|
||||
auto convertToSystemPath = [](const QString& path) {
|
||||
auto t = path;
|
||||
t.replace("%s%", QDir::separator());
|
||||
return t;
|
||||
};
|
||||
|
||||
auto shouldKeep = [keeps, getPathForBase, convertToSystemPath](const QString& fullPath) {
|
||||
for (const auto& item : keeps.files) {
|
||||
auto basePath = getPathForBase(item.base);
|
||||
auto targetPath = convertToSystemPath(item.target);
|
||||
auto path = FS::PathCombine(basePath, targetPath);
|
||||
|
||||
if (fullPath == path) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& item : keeps.folders) {
|
||||
auto basePath = getPathForBase(item.base);
|
||||
auto targetPath = convertToSystemPath(item.target);
|
||||
auto path = FS::PathCombine(basePath, targetPath);
|
||||
|
||||
if (fullPath.startsWith(path)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
// Keep track of files to delete
|
||||
QSet<QString> filesToDelete;
|
||||
|
||||
for (const auto& item : deletes.files) {
|
||||
auto basePath = getPathForBase(item.base);
|
||||
auto targetPath = convertToSystemPath(item.target);
|
||||
auto fullPath = FS::PathCombine(basePath, targetPath);
|
||||
|
||||
if (shouldKeep(fullPath))
|
||||
continue;
|
||||
|
||||
filesToDelete.insert(fullPath);
|
||||
}
|
||||
|
||||
for (const auto& item : deletes.folders) {
|
||||
auto basePath = getPathForBase(item.base);
|
||||
auto targetPath = convertToSystemPath(item.target);
|
||||
auto fullPath = FS::PathCombine(basePath, targetPath);
|
||||
|
||||
QDirIterator it(fullPath, QDirIterator::Subdirectories);
|
||||
while (it.hasNext()) {
|
||||
auto path = it.next();
|
||||
|
||||
if (shouldKeep(path))
|
||||
continue;
|
||||
|
||||
filesToDelete.insert(path);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete the files
|
||||
for (const auto& item : filesToDelete) {
|
||||
QFile::remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
QString PackInstallTask::getDirForModType(ModType type, QString raw)
|
||||
{
|
||||
switch (type) {
|
||||
|
@ -50,6 +50,12 @@
|
||||
|
||||
namespace ATLauncher {
|
||||
|
||||
enum class InstallMode {
|
||||
Install,
|
||||
Reinstall,
|
||||
Update,
|
||||
};
|
||||
|
||||
class UserInteractionSupport {
|
||||
|
||||
public:
|
||||
@ -75,7 +81,7 @@ class PackInstallTask : public InstanceTask
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PackInstallTask(UserInteractionSupport *support, QString packName, QString version);
|
||||
explicit PackInstallTask(UserInteractionSupport *support, QString packName, QString version, InstallMode installMode = InstallMode::Install);
|
||||
virtual ~PackInstallTask(){}
|
||||
|
||||
bool canAbort() const override { return true; }
|
||||
@ -99,6 +105,7 @@ private:
|
||||
bool createLibrariesComponent(QString instanceRoot, std::shared_ptr<PackProfile> profile);
|
||||
bool createPackComponent(QString instanceRoot, std::shared_ptr<PackProfile> profile);
|
||||
|
||||
void deleteExistingFiles();
|
||||
void installConfigs();
|
||||
void extractConfigs();
|
||||
void downloadMods();
|
||||
@ -117,6 +124,7 @@ private:
|
||||
NetJob::Ptr jobPtr;
|
||||
QByteArray response;
|
||||
|
||||
InstallMode m_install_mode;
|
||||
QString m_pack_name;
|
||||
QString m_pack_safe_name;
|
||||
QString m_version_name;
|
||||
|
@ -224,6 +224,64 @@ static void loadVersionExtraArguments(ATLauncher::PackVersionExtraArguments& a,
|
||||
a.depends = Json::ensureString(obj, "depends", "");
|
||||
}
|
||||
|
||||
static void loadVersionKeep(ATLauncher::VersionKeep& k, QJsonObject& obj)
|
||||
{
|
||||
k.base = Json::requireString(obj, "base");
|
||||
k.target = Json::requireString(obj, "target");
|
||||
}
|
||||
|
||||
static void loadVersionKeeps(ATLauncher::VersionKeeps& k, QJsonObject& obj)
|
||||
{
|
||||
if (obj.contains("files")) {
|
||||
auto files = Json::requireArray(obj, "files");
|
||||
for (const auto keepRaw : files) {
|
||||
auto keepObj = Json::requireObject(keepRaw);
|
||||
ATLauncher::VersionKeep keep;
|
||||
loadVersionKeep(keep, keepObj);
|
||||
k.files.append(keep);
|
||||
}
|
||||
}
|
||||
|
||||
if (obj.contains("folders")) {
|
||||
auto folders = Json::requireArray(obj, "folders");
|
||||
for (const auto keepRaw : folders) {
|
||||
auto keepObj = Json::requireObject(keepRaw);
|
||||
ATLauncher::VersionKeep keep;
|
||||
loadVersionKeep(keep, keepObj);
|
||||
k.folders.append(keep);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void loadVersionDelete(ATLauncher::VersionDelete& d, QJsonObject& obj)
|
||||
{
|
||||
d.base = Json::requireString(obj, "base");
|
||||
d.target = Json::requireString(obj, "target");
|
||||
}
|
||||
|
||||
static void loadVersionDeletes(ATLauncher::VersionDeletes& d, QJsonObject& obj)
|
||||
{
|
||||
if (obj.contains("files")) {
|
||||
auto files = Json::requireArray(obj, "files");
|
||||
for (const auto deleteRaw : files) {
|
||||
auto deleteObj = Json::requireObject(deleteRaw);
|
||||
ATLauncher::VersionDelete versionDelete;
|
||||
loadVersionDelete(versionDelete, deleteObj);
|
||||
d.files.append(versionDelete);
|
||||
}
|
||||
}
|
||||
|
||||
if (obj.contains("folders")) {
|
||||
auto folders = Json::requireArray(obj, "folders");
|
||||
for (const auto deleteRaw : folders) {
|
||||
auto deleteObj = Json::requireObject(deleteRaw);
|
||||
ATLauncher::VersionDelete versionDelete;
|
||||
loadVersionDelete(versionDelete, deleteObj);
|
||||
d.folders.append(versionDelete);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ATLauncher::loadVersion(PackVersion & v, QJsonObject & obj)
|
||||
{
|
||||
v.version = Json::requireString(obj, "version");
|
||||
@ -284,4 +342,10 @@ void ATLauncher::loadVersion(PackVersion & v, QJsonObject & obj)
|
||||
|
||||
auto messages = Json::ensureObject(obj, "messages");
|
||||
loadVersionMessages(v.messages, messages);
|
||||
|
||||
auto keeps = Json::ensureObject(obj, "keeps");
|
||||
loadVersionKeeps(v.keeps, keeps);
|
||||
|
||||
auto deletes = Json::ensureObject(obj, "deletes");
|
||||
loadVersionDeletes(v.deletes, deletes);
|
||||
}
|
||||
|
@ -150,6 +150,26 @@ struct VersionMessages
|
||||
QString update;
|
||||
};
|
||||
|
||||
struct VersionKeep {
|
||||
QString base;
|
||||
QString target;
|
||||
};
|
||||
|
||||
struct VersionKeeps {
|
||||
QVector<VersionKeep> files;
|
||||
QVector<VersionKeep> folders;
|
||||
};
|
||||
|
||||
struct VersionDelete {
|
||||
QString base;
|
||||
QString target;
|
||||
};
|
||||
|
||||
struct VersionDeletes {
|
||||
QVector<VersionDelete> files;
|
||||
QVector<VersionDelete> folders;
|
||||
};
|
||||
|
||||
struct PackVersionMainClass
|
||||
{
|
||||
QString mainClass;
|
||||
@ -178,6 +198,9 @@ struct PackVersion
|
||||
QMap<QString, QString> colours;
|
||||
QMap<QString, QString> warnings;
|
||||
VersionMessages messages;
|
||||
|
||||
VersionKeeps keeps;
|
||||
VersionDeletes deletes;
|
||||
};
|
||||
|
||||
void loadVersion(PackVersion & v, QJsonObject & obj);
|
||||
|
@ -37,13 +37,12 @@
|
||||
#include "AtlPage.h"
|
||||
#include "ui_AtlPage.h"
|
||||
|
||||
#include "modplatform/atlauncher/ATLPackInstallTask.h"
|
||||
#include "BuildConfig.h"
|
||||
|
||||
#include "AtlOptionalModDialog.h"
|
||||
#include "AtlUserInteractionSupportImpl.h"
|
||||
#include "modplatform/atlauncher/ATLPackInstallTask.h"
|
||||
#include "ui/dialogs/NewInstanceDialog.h"
|
||||
#include "ui/dialogs/VersionSelectDialog.h"
|
||||
|
||||
#include <BuildConfig.h>
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
@ -117,7 +116,9 @@ void AtlPage::suggestCurrent()
|
||||
return;
|
||||
}
|
||||
|
||||
dialog->setSuggestedPack(selected.name + " " + selectedVersion, new ATLauncher::PackInstallTask(this, selected.name, selectedVersion));
|
||||
auto uiSupport = new AtlUserInteractionSupportImpl(this);
|
||||
dialog->setSuggestedPack(selected.name + " " + selectedVersion, new ATLauncher::PackInstallTask(uiSupport, selected.name, selectedVersion));
|
||||
|
||||
auto editedLogoName = selected.safeName;
|
||||
auto url = QString(BuildConfig.ATL_DOWNLOAD_SERVER_URL + "launcher/images/%1.png").arg(selected.safeName.toLower());
|
||||
listModel->getLogo(selected.safeName, url, [this, editedLogoName](QString logo)
|
||||
@ -172,51 +173,3 @@ void AtlPage::onVersionSelectionChanged(QString data)
|
||||
selectedVersion = data;
|
||||
suggestCurrent();
|
||||
}
|
||||
|
||||
QVector<QString> AtlPage::chooseOptionalMods(ATLauncher::PackVersion version, QVector<ATLauncher::VersionMod> mods)
|
||||
{
|
||||
AtlOptionalModDialog optionalModDialog(this, version, mods);
|
||||
optionalModDialog.exec();
|
||||
return optionalModDialog.getResult();
|
||||
}
|
||||
|
||||
QString AtlPage::chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion) {
|
||||
VersionSelectDialog vselect(vlist.get(), "Choose Version", APPLICATION->activeWindow(), false);
|
||||
if (minecraftVersion != Q_NULLPTR) {
|
||||
vselect.setExactFilter(BaseVersionList::ParentVersionRole, minecraftVersion);
|
||||
vselect.setEmptyString(tr("No versions are currently available for Minecraft %1").arg(minecraftVersion));
|
||||
}
|
||||
else {
|
||||
vselect.setEmptyString(tr("No versions are currently available"));
|
||||
}
|
||||
vselect.setEmptyErrorString(tr("Couldn't load or download the version lists!"));
|
||||
|
||||
// select recommended build
|
||||
for (int i = 0; i < vlist->versions().size(); i++) {
|
||||
auto version = vlist->versions().at(i);
|
||||
auto reqs = version->requires();
|
||||
|
||||
// filter by minecraft version, if the loader depends on a certain version.
|
||||
if (minecraftVersion != Q_NULLPTR) {
|
||||
auto iter = std::find_if(reqs.begin(), reqs.end(), [](const Meta::Require &req) {
|
||||
return req.uid == "net.minecraft";
|
||||
});
|
||||
if (iter == reqs.end()) continue;
|
||||
if (iter->equalsVersion != minecraftVersion) continue;
|
||||
}
|
||||
|
||||
// first recommended build we find, we use.
|
||||
if (version->isRecommended()) {
|
||||
vselect.setCurrentVersion(version->descriptor());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
vselect.exec();
|
||||
return vselect.selectedVersion()->descriptor();
|
||||
}
|
||||
|
||||
void AtlPage::displayMessage(QString message)
|
||||
{
|
||||
QMessageBox::information(this, tr("Installing"), message);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ namespace Ui
|
||||
|
||||
class NewInstanceDialog;
|
||||
|
||||
class AtlPage : public QWidget, public BasePage, public ATLauncher::UserInteractionSupport
|
||||
class AtlPage : public QWidget, public BasePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -83,10 +83,6 @@ public:
|
||||
private:
|
||||
void suggestCurrent();
|
||||
|
||||
QString chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion) override;
|
||||
QVector<QString> chooseOptionalMods(ATLauncher::PackVersion version, QVector<ATLauncher::VersionMod> mods) override;
|
||||
void displayMessage(QString message) override;
|
||||
|
||||
private slots:
|
||||
void triggerSearch();
|
||||
|
||||
|
@ -0,0 +1,95 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
/*
|
||||
* PolyMC - Minecraft Launcher
|
||||
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* This file incorporates work covered by the following copyright and
|
||||
* permission notice:
|
||||
*
|
||||
* Copyright 2020-2021 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <QMessageBox>
|
||||
#include "AtlUserInteractionSupportImpl.h"
|
||||
|
||||
#include "AtlOptionalModDialog.h"
|
||||
#include "ui/dialogs/VersionSelectDialog.h"
|
||||
|
||||
AtlUserInteractionSupportImpl::AtlUserInteractionSupportImpl(QWidget *parent) : m_parent(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QVector<QString> AtlUserInteractionSupportImpl::chooseOptionalMods(ATLauncher::PackVersion version, QVector<ATLauncher::VersionMod> mods)
|
||||
{
|
||||
AtlOptionalModDialog optionalModDialog(m_parent, version, mods);
|
||||
optionalModDialog.exec();
|
||||
return optionalModDialog.getResult();
|
||||
}
|
||||
|
||||
QString AtlUserInteractionSupportImpl::chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion)
|
||||
{
|
||||
VersionSelectDialog vselect(vlist.get(), "Choose Version", m_parent, false);
|
||||
if (minecraftVersion != nullptr) {
|
||||
vselect.setExactFilter(BaseVersionList::ParentVersionRole, minecraftVersion);
|
||||
vselect.setEmptyString(tr("No versions are currently available for Minecraft %1").arg(minecraftVersion));
|
||||
}
|
||||
else {
|
||||
vselect.setEmptyString(tr("No versions are currently available"));
|
||||
}
|
||||
vselect.setEmptyErrorString(tr("Couldn't load or download the version lists!"));
|
||||
|
||||
// select recommended build
|
||||
for (int i = 0; i < vlist->versions().size(); i++) {
|
||||
auto version = vlist->versions().at(i);
|
||||
auto reqs = version->requires();
|
||||
|
||||
// filter by minecraft version, if the loader depends on a certain version.
|
||||
if (minecraftVersion != nullptr) {
|
||||
auto iter = std::find_if(reqs.begin(), reqs.end(), [](const Meta::Require& req) {
|
||||
return req.uid == "net.minecraft";
|
||||
});
|
||||
if (iter == reqs.end())
|
||||
continue;
|
||||
if (iter->equalsVersion != minecraftVersion)
|
||||
continue;
|
||||
}
|
||||
|
||||
// first recommended build we find, we use.
|
||||
if (version->isRecommended()) {
|
||||
vselect.setCurrentVersion(version->descriptor());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
vselect.exec();
|
||||
return vselect.selectedVersion()->descriptor();
|
||||
}
|
||||
|
||||
void AtlUserInteractionSupportImpl::displayMessage(QString message)
|
||||
{
|
||||
QMessageBox::information(m_parent, tr("Installing"), message);
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
/*
|
||||
* PolyMC - Minecraft Launcher
|
||||
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* This file incorporates work covered by the following copyright and
|
||||
* permission notice:
|
||||
*
|
||||
* Copyright 2020-2021 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "modplatform/atlauncher/ATLPackInstallTask.h"
|
||||
|
||||
class AtlUserInteractionSupportImpl : public QObject, public ATLauncher::UserInteractionSupport {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AtlUserInteractionSupportImpl(QWidget* parent);
|
||||
|
||||
private:
|
||||
QString chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion) override;
|
||||
QVector<QString> chooseOptionalMods(ATLauncher::PackVersion version, QVector<ATLauncher::VersionMod> mods) override;
|
||||
void displayMessage(QString message) override;
|
||||
|
||||
private:
|
||||
QWidget* m_parent;
|
||||
|
||||
};
|
Loading…
Reference in New Issue
Block a user