mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2025-02-11 18:41:03 +00:00
NOISSUE Display ATLauncher install messages
This commit is contained in:
parent
518568b803
commit
af36e5c43f
@ -96,6 +96,10 @@ void PackInstallTask::onDownloadSucceeded()
|
|||||||
}
|
}
|
||||||
m_version = version;
|
m_version = version;
|
||||||
|
|
||||||
|
// Display install message if one exists
|
||||||
|
if (!m_version.messages.install.isEmpty())
|
||||||
|
m_support->displayMessage(m_version.messages.install);
|
||||||
|
|
||||||
auto vlist = APPLICATION->metadataIndex()->get("net.minecraft");
|
auto vlist = APPLICATION->metadataIndex()->get("net.minecraft");
|
||||||
if(!vlist)
|
if(!vlist)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2021 Jamie Mansfield <jmansfield@cadixdev.org>
|
* Copyright 2020-2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||||
* Copyright 2021 Petr Mrazek <peterix@gmail.com>
|
* Copyright 2021 Petr Mrazek <peterix@gmail.com>
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -45,6 +45,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual QString chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion) = 0;
|
virtual QString chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Requests a user interaction to display a message.
|
||||||
|
*/
|
||||||
|
virtual void displayMessage(QString message) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class PackInstallTask : public InstanceTask
|
class PackInstallTask : public InstanceTask
|
||||||
|
@ -197,6 +197,12 @@ static void loadVersionExtraArguments(ATLauncher::PackVersionExtraArguments & a,
|
|||||||
a.depends = Json::ensureString(obj, "depends", "");
|
a.depends = Json::ensureString(obj, "depends", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void loadVersionMessages(ATLauncher::VersionMessages & m, QJsonObject & obj)
|
||||||
|
{
|
||||||
|
m.install = Json::ensureString(obj, "install", "");
|
||||||
|
m.update = Json::ensureString(obj, "update", "");
|
||||||
|
}
|
||||||
|
|
||||||
void ATLauncher::loadVersion(PackVersion & v, QJsonObject & obj)
|
void ATLauncher::loadVersion(PackVersion & v, QJsonObject & obj)
|
||||||
{
|
{
|
||||||
v.version = Json::requireString(obj, "version");
|
v.version = Json::requireString(obj, "version");
|
||||||
@ -244,4 +250,9 @@ void ATLauncher::loadVersion(PackVersion & v, QJsonObject & obj)
|
|||||||
auto configsObj = Json::requireObject(obj, "configs");
|
auto configsObj = Json::requireObject(obj, "configs");
|
||||||
loadVersionConfigs(v.configs, configsObj);
|
loadVersionConfigs(v.configs, configsObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(obj.contains("messages")) {
|
||||||
|
auto messages = Json::requireObject(obj, "messages");
|
||||||
|
loadVersionMessages(v.messages, messages);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,6 +134,12 @@ struct PackVersionExtraArguments
|
|||||||
QString depends;
|
QString depends;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct VersionMessages
|
||||||
|
{
|
||||||
|
QString install;
|
||||||
|
QString update;
|
||||||
|
};
|
||||||
|
|
||||||
struct PackVersion
|
struct PackVersion
|
||||||
{
|
{
|
||||||
QString version;
|
QString version;
|
||||||
@ -146,6 +152,8 @@ struct PackVersion
|
|||||||
QVector<VersionLibrary> libraries;
|
QVector<VersionLibrary> libraries;
|
||||||
QVector<VersionMod> mods;
|
QVector<VersionMod> mods;
|
||||||
VersionConfigs configs;
|
VersionConfigs configs;
|
||||||
|
|
||||||
|
VersionMessages messages;
|
||||||
};
|
};
|
||||||
|
|
||||||
void loadVersion(PackVersion & v, QJsonObject & obj);
|
void loadVersion(PackVersion & v, QJsonObject & obj);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2021 Jamie Mansfield <jmansfield@cadixdev.org>
|
* Copyright 2020-2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||||
* Copyright 2021 Philip T <me@phit.link>
|
* Copyright 2021 Philip T <me@phit.link>
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#include <BuildConfig.h>
|
#include <BuildConfig.h>
|
||||||
|
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
AtlPage::AtlPage(NewInstanceDialog* dialog, QWidget *parent)
|
AtlPage::AtlPage(NewInstanceDialog* dialog, QWidget *parent)
|
||||||
: QWidget(parent), ui(new Ui::AtlPage), dialog(dialog)
|
: QWidget(parent), ui(new Ui::AtlPage), dialog(dialog)
|
||||||
{
|
{
|
||||||
@ -186,3 +188,8 @@ QString AtlPage::chooseVersion(Meta::VersionListPtr vlist, QString minecraftVers
|
|||||||
vselect.exec();
|
vselect.exec();
|
||||||
return vselect.selectedVersion()->descriptor();
|
return vselect.selectedVersion()->descriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AtlPage::displayMessage(QString message)
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, tr("Installing"), message);
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2020-2021 Jamie Mansfield <jmansfield@cadixdev.org>
|
* Copyright 2020-2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -65,6 +65,7 @@ private:
|
|||||||
|
|
||||||
QString chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion) override;
|
QString chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion) override;
|
||||||
QVector<QString> chooseOptionalMods(QVector<ATLauncher::VersionMod> mods) override;
|
QVector<QString> chooseOptionalMods(QVector<ATLauncher::VersionMod> mods) override;
|
||||||
|
void displayMessage(QString message) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void triggerSearch();
|
void triggerSearch();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user