Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions launcher/BaseInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ BaseInstance::BaseInstance(SettingsObject* globalSettings, std::unique_ptr<Setti
m_settings->registerSetting("ManagedPackVersionName", "");
m_settings->registerSetting("ManagedPackURL", "");

// Modpack Creator Mode
m_settings->registerSetting("ModpackCreatorEnabled", false);
m_settings->registerSetting("ModpackCreatorName", "");
m_settings->registerSetting("ModpackCreatorAuthor", "");

m_settings->registerSetting("Profiler", "");

auto discordSetting = m_settings->registerSetting("OverrideDiscord", false);
Expand Down Expand Up @@ -208,6 +213,36 @@ void BaseInstance::copyManagedPack(BaseInstance& other)
}
}

bool BaseInstance::isModpackCreatorEnabled() const
{
return m_settings->get("ModpackCreatorEnabled").toBool();
}

void BaseInstance::setModpackCreatorEnabled(bool enabled)
{
m_settings->set("ModpackCreatorEnabled", enabled);
}

QString BaseInstance::getModpackCreatorName() const
{
return m_settings->get("ModpackCreatorName").toString();
}

void BaseInstance::setModpackCreatorName(const QString& name)
{
m_settings->set("ModpackCreatorName", name);
}

QString BaseInstance::getModpackCreatorAuthor() const
{
return m_settings->get("ModpackCreatorAuthor").toString();
}

void BaseInstance::setModpackCreatorAuthor(const QString& author)
{
m_settings->set("ModpackCreatorAuthor", author);
}

QStringList BaseInstance::getLinkedInstances() const
{
auto setting = m_settings->get("linkedInstances").toString();
Expand Down
7 changes: 7 additions & 0 deletions launcher/BaseInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ class BaseInstance : public QObject {
void setManagedPack(const QString& type, const QString& id, const QString& name, const QString& versionId, const QString& version);
void copyManagedPack(BaseInstance& other);

bool isModpackCreatorEnabled() const;
void setModpackCreatorEnabled(bool enabled);
QString getModpackCreatorName() const;
void setModpackCreatorName(const QString& name);
QString getModpackCreatorAuthor() const;
void setModpackCreatorAuthor(const QString& author);

virtual QStringList extraArguments(AuthSessionPtr session);

/// Traits. Normally inside the version, depends on instance implementation.
Expand Down
11 changes: 9 additions & 2 deletions launcher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ set(MINECRAFT_SOURCES
minecraft/mod/tasks/GetModDependenciesTask.h
minecraft/mod/tasks/GetModDependenciesTask.cpp

# Modpack Creator - changelog generator
minecraft/mod/ModpackChangelogGenerator.h
minecraft/mod/ModpackChangelogGenerator.cpp

# Assets
minecraft/AssetsUtils.h
minecraft/AssetsUtils.cpp
Expand Down Expand Up @@ -975,6 +979,8 @@ SET(LAUNCHER_SOURCES
ui/pages/instance/ModFolderPage.h
ui/pages/instance/NotesPage.cpp
ui/pages/instance/NotesPage.h
ui/pages/instance/ModpackCreatorPage.cpp
ui/pages/instance/ModpackCreatorPage.h
ui/pages/instance/LogPage.cpp
ui/pages/instance/LogPage.h
ui/pages/instance/InstanceSettingsPage.h
Expand Down Expand Up @@ -1283,6 +1289,7 @@ qt_wrap_ui(LAUNCHER_UI
ui/pages/instance/OtherLogsPage.ui
ui/pages/instance/VersionPage.ui
ui/pages/instance/ManagedPackPage.ui
ui/pages/instance/ModpackCreatorPage.ui
ui/pages/instance/WorldListPage.ui
ui/pages/instance/ScreenshotsPage.ui
ui/pages/modplatform/atlauncher/AtlOptionalModDialog.ui
Expand Down Expand Up @@ -1632,8 +1639,8 @@ if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
target_compile_options(Launcher_logic PRIVATE /wd4100) # C4100 - unused parameter
target_compile_options(${Launcher_Name} PRIVATE /wd4100) # C4100 - unused parameter
else()
target_compile_options(Launcher_logic PRIVATE -Wno-unused-parameter -Wno-missing-field-initializers)
target_compile_options(${Launcher_Name} PRIVATE -Wno-unused-parameter -Wno-missing-field-initializers)
target_compile_options(Launcher_logic PRIVATE -Wno-unused-parameter -Wno-missing-field-initializers -Wno-error=sfinae-incomplete)
target_compile_options(${Launcher_Name} PRIVATE -Wno-unused-parameter -Wno-missing-field-initializers -Wno-error=sfinae-incomplete)
endif()

#### The bundle mess! ####
Expand Down
7 changes: 5 additions & 2 deletions launcher/InstancePageProvider.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#pragma once
#include "ui/pages/instance/InstanceSettingsPage.h"
#include "ui/pages/instance/LogPage.h"
#include <FileSystem.h>
#include <ui/pages/instance/DataPackPage.h>
#include "minecraft/MinecraftInstance.h"
#include "ui/pages/BasePage.h"
#include "ui/pages/BasePageProvider.h"
#include "ui/pages/instance/InstanceSettingsPage.h"
#include "ui/pages/instance/LogPage.h"
#include "ui/pages/instance/ManagedPackPage.h"
#include "ui/pages/instance/ModFolderPage.h"
#include "ui/pages/instance/ModpackCreatorPage.h"
#include "ui/pages/instance/NotesPage.h"
#include "ui/pages/instance/OtherLogsPage.h"
#include "ui/pages/instance/ResourcePackPage.h"
Expand Down Expand Up @@ -41,6 +42,7 @@ class InstancePageProvider : protected QObject, public BasePageProvider {
values.append(new TexturePackPage(onesix, onesix->texturePackList()));
values.append(new ShaderPackPage(onesix, onesix->shaderPackList()));
values.append(new NotesPage(onesix));
values.append(new ModpackCreatorPage(onesix));
values.append(new WorldListPage(onesix, onesix->worldList()));
values.append(new ServersPage(onesix));
values.append(new ScreenshotsPage(FS::PathCombine(onesix->gameRoot(), "screenshots")));
Expand All @@ -54,3 +56,4 @@ class InstancePageProvider : protected QObject, public BasePageProvider {
protected:
BaseInstance* inst;
};

Loading