2015-02-07 09:43:09 +00:00
|
|
|
#pragma once
|
2017-07-24 07:01:37 +00:00
|
|
|
#include "minecraft/MinecraftInstance.h"
|
2017-09-16 21:09:05 +00:00
|
|
|
#include "minecraft/legacy/LegacyInstance.h"
|
2015-10-04 23:47:27 +00:00
|
|
|
#include <FileSystem.h>
|
2021-11-22 02:55:16 +00:00
|
|
|
#include "ui/pages/BasePage.h"
|
|
|
|
#include "ui/pages/BasePageProvider.h"
|
|
|
|
#include "ui/pages/instance/LogPage.h"
|
|
|
|
#include "ui/pages/instance/VersionPage.h"
|
|
|
|
#include "ui/pages/instance/ModFolderPage.h"
|
|
|
|
#include "ui/pages/instance/ResourcePackPage.h"
|
|
|
|
#include "ui/pages/instance/TexturePackPage.h"
|
|
|
|
#include "ui/pages/instance/ShaderPackPage.h"
|
|
|
|
#include "ui/pages/instance/NotesPage.h"
|
|
|
|
#include "ui/pages/instance/ScreenshotsPage.h"
|
|
|
|
#include "ui/pages/instance/InstanceSettingsPage.h"
|
|
|
|
#include "ui/pages/instance/OtherLogsPage.h"
|
|
|
|
#include "ui/pages/instance/LegacyUpgradePage.h"
|
|
|
|
#include "ui/pages/instance/WorldListPage.h"
|
|
|
|
#include "ui/pages/instance/ServersPage.h"
|
|
|
|
#include "ui/pages/instance/GameOptionsPage.h"
|
2015-02-07 09:43:09 +00:00
|
|
|
|
|
|
|
class InstancePageProvider : public QObject, public BasePageProvider
|
|
|
|
{
|
2018-07-15 12:51:05 +00:00
|
|
|
Q_OBJECT
|
2015-02-07 09:43:09 +00:00
|
|
|
public:
|
2018-07-15 12:51:05 +00:00
|
|
|
explicit InstancePageProvider(InstancePtr parent)
|
|
|
|
{
|
|
|
|
inst = parent;
|
|
|
|
}
|
2015-02-07 09:43:09 +00:00
|
|
|
|
2018-07-15 12:51:05 +00:00
|
|
|
virtual ~InstancePageProvider() {};
|
|
|
|
virtual QList<BasePage *> getPages() override
|
|
|
|
{
|
|
|
|
QList<BasePage *> values;
|
|
|
|
values.append(new LogPage(inst));
|
|
|
|
std::shared_ptr<MinecraftInstance> onesix = std::dynamic_pointer_cast<MinecraftInstance>(inst);
|
|
|
|
if(onesix)
|
|
|
|
{
|
|
|
|
values.append(new VersionPage(onesix.get()));
|
2018-11-14 23:36:47 +00:00
|
|
|
auto modsPage = new ModFolderPage(onesix.get(), onesix->loaderModList(), "mods", "loadermods", tr("Loader mods"), "Loader-mods");
|
|
|
|
modsPage->setFilter("%1 (*.zip *.jar *.litemod)");
|
|
|
|
values.append(modsPage);
|
2018-07-15 12:51:05 +00:00
|
|
|
values.append(new CoreModFolderPage(onesix.get(), onesix->coreModList(), "coremods", "coremods", tr("Core mods"), "Core-mods"));
|
|
|
|
values.append(new ResourcePackPage(onesix.get()));
|
|
|
|
values.append(new TexturePackPage(onesix.get()));
|
2021-09-23 19:26:56 +00:00
|
|
|
values.append(new ShaderPackPage(onesix.get()));
|
2018-07-15 12:51:05 +00:00
|
|
|
values.append(new NotesPage(onesix.get()));
|
2023-04-08 17:03:20 +00:00
|
|
|
values.append(new WorldListPage(onesix, onesix->worldList()));
|
2021-05-22 16:07:08 +00:00
|
|
|
values.append(new ServersPage(onesix));
|
2019-02-20 23:44:36 +00:00
|
|
|
// values.append(new GameOptionsPage(onesix.get()));
|
2018-07-27 21:57:09 +00:00
|
|
|
values.append(new ScreenshotsPage(FS::PathCombine(onesix->gameRoot(), "screenshots")));
|
2018-07-15 12:51:05 +00:00
|
|
|
values.append(new InstanceSettingsPage(onesix.get()));
|
|
|
|
}
|
|
|
|
std::shared_ptr<LegacyInstance> legacy = std::dynamic_pointer_cast<LegacyInstance>(inst);
|
|
|
|
if(legacy)
|
|
|
|
{
|
|
|
|
values.append(new LegacyUpgradePage(legacy));
|
|
|
|
values.append(new NotesPage(legacy.get()));
|
2023-04-08 17:03:20 +00:00
|
|
|
values.append(new WorldListPage(legacy, legacy->worldList()));
|
2018-07-27 21:57:09 +00:00
|
|
|
values.append(new ScreenshotsPage(FS::PathCombine(legacy->gameRoot(), "screenshots")));
|
2018-07-15 12:51:05 +00:00
|
|
|
}
|
|
|
|
auto logMatcher = inst->getLogFileMatcher();
|
|
|
|
if(logMatcher)
|
|
|
|
{
|
|
|
|
values.append(new OtherLogsPage(inst->getLogFileRoot(), logMatcher));
|
|
|
|
}
|
|
|
|
return values;
|
|
|
|
}
|
2015-02-07 09:43:09 +00:00
|
|
|
|
2018-07-15 12:51:05 +00:00
|
|
|
virtual QString dialogTitle() override
|
|
|
|
{
|
|
|
|
return tr("Edit Instance (%1)").arg(inst->name());
|
|
|
|
}
|
2015-02-07 09:43:09 +00:00
|
|
|
protected:
|
2018-07-15 12:51:05 +00:00
|
|
|
InstancePtr inst;
|
2015-02-07 09:43:09 +00:00
|
|
|
};
|