mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-10-03 08:41:42 +00:00
NOISSUE Add settings to support managed packs
Managed packs means an installation of a modpack through a modpack provider. Managed packs track their origins (pack platform, name, id), so that in future features can exist around this - such as updating, and reinstalling.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
/* Copyright 2013-2021 MultiMC Contributors
|
/* Copyright 2013-2021 MultiMC Contributors
|
||||||
|
* Copyright 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.
|
||||||
@@ -55,6 +56,14 @@ BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr s
|
|||||||
|
|
||||||
m_settings->registerPassthrough(globalSettings->getSetting("ConsoleMaxLines"), nullptr);
|
m_settings->registerPassthrough(globalSettings->getSetting("ConsoleMaxLines"), nullptr);
|
||||||
m_settings->registerPassthrough(globalSettings->getSetting("ConsoleOverflowStop"), nullptr);
|
m_settings->registerPassthrough(globalSettings->getSetting("ConsoleOverflowStop"), nullptr);
|
||||||
|
|
||||||
|
// Managed Packs
|
||||||
|
m_settings->registerSetting("ManagedPack", false);
|
||||||
|
m_settings->registerSetting("ManagedPackType", "");
|
||||||
|
m_settings->registerSetting("ManagedPackID", "");
|
||||||
|
m_settings->registerSetting("ManagedPackName", "");
|
||||||
|
m_settings->registerSetting("ManagedPackVersionID", "");
|
||||||
|
m_settings->registerSetting("ManagedPackVersionName", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BaseInstance::getPreLaunchCommand()
|
QString BaseInstance::getPreLaunchCommand()
|
||||||
@@ -72,6 +81,46 @@ QString BaseInstance::getPostExitCommand()
|
|||||||
return settings()->get("PostExitCommand").toString();
|
return settings()->get("PostExitCommand").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BaseInstance::isManagedPack()
|
||||||
|
{
|
||||||
|
return settings()->get("ManagedPack").toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString BaseInstance::getManagedPackType()
|
||||||
|
{
|
||||||
|
return settings()->get("ManagedPackType").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString BaseInstance::getManagedPackID()
|
||||||
|
{
|
||||||
|
return settings()->get("ManagedPackID").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString BaseInstance::getManagedPackName()
|
||||||
|
{
|
||||||
|
return settings()->get("ManagedPackName").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString BaseInstance::getManagedPackVersionID()
|
||||||
|
{
|
||||||
|
return settings()->get("ManagedPackVersionID").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString BaseInstance::getManagedPackVersionName()
|
||||||
|
{
|
||||||
|
return settings()->get("ManagedPackVersionName").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BaseInstance::setManagedPack(const QString& type, const QString& id, const QString& name, const QString& versionId, const QString& version)
|
||||||
|
{
|
||||||
|
settings()->set("ManagedPack", true);
|
||||||
|
settings()->set("ManagedPackType", type);
|
||||||
|
settings()->set("ManagedPackID", id);
|
||||||
|
settings()->set("ManagedPackName", name);
|
||||||
|
settings()->set("ManagedPackVersionID", versionId);
|
||||||
|
settings()->set("ManagedPackVersionName", version);
|
||||||
|
}
|
||||||
|
|
||||||
int BaseInstance::getConsoleMaxLines() const
|
int BaseInstance::getConsoleMaxLines() const
|
||||||
{
|
{
|
||||||
auto lineSetting = settings()->getSetting("ConsoleMaxLines");
|
auto lineSetting = settings()->getSetting("ConsoleMaxLines");
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
/* Copyright 2013-2021 MultiMC Contributors
|
/* Copyright 2013-2021 MultiMC Contributors
|
||||||
|
* Copyright 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.
|
||||||
@@ -119,6 +120,14 @@ public:
|
|||||||
QString getPostExitCommand();
|
QString getPostExitCommand();
|
||||||
QString getWrapperCommand();
|
QString getWrapperCommand();
|
||||||
|
|
||||||
|
bool isManagedPack();
|
||||||
|
QString getManagedPackType();
|
||||||
|
QString getManagedPackID();
|
||||||
|
QString getManagedPackName();
|
||||||
|
QString getManagedPackVersionID();
|
||||||
|
QString getManagedPackVersionName();
|
||||||
|
void setManagedPack(const QString& type, const QString& id, const QString& name, const QString& versionId, const QString& version);
|
||||||
|
|
||||||
/// guess log level from a line of game log
|
/// guess log level from a line of game log
|
||||||
virtual MessageLevel::Enum guessLevel(const QString &line, MessageLevel::Enum level)
|
virtual MessageLevel::Enum guessLevel(const QString &line, MessageLevel::Enum level)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user