PrismLauncher/launcher/InstancePageProvider.h

59 lines
2.6 KiB
C
Raw Normal View History

2015-02-07 09:43:09 +00:00
#pragma once
2015-10-05 00:47:27 +01:00
#include <FileSystem.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/NotesPage.h"
#include "ui/pages/instance/OtherLogsPage.h"
#include "ui/pages/instance/ResourcePackPage.h"
#include "ui/pages/instance/ScreenshotsPage.h"
#include "ui/pages/instance/ServersPage.h"
#include "ui/pages/instance/ShaderPackPage.h"
#include "ui/pages/instance/TexturePackPage.h"
#include "ui/pages/instance/VersionPage.h"
#include "ui/pages/instance/WorldListPage.h"
2015-02-07 09:43:09 +00:00
class InstancePageProvider : protected QObject, public BasePageProvider {
2018-07-15 13:51:05 +01:00
Q_OBJECT
public:
explicit InstancePageProvider(InstancePtr parent) { inst = parent; }
2015-02-07 09:43:09 +00:00
virtual ~InstancePageProvider(){};
virtual QList<BasePage*> getPages() override
2018-07-15 13:51:05 +01:00
{
QList<BasePage*> values;
2018-07-15 13:51:05 +01:00
values.append(new LogPage(inst));
std::shared_ptr<MinecraftInstance> onesix = std::dynamic_pointer_cast<MinecraftInstance>(inst);
2022-02-21 21:30:44 +00:00
values.append(new VersionPage(onesix.get()));
values.append(ManagedPackPage::createPage(onesix.get()));
auto modsPage = new ModFolderPage(onesix.get(), onesix->loaderModList());
modsPage->setFilter("%1 (*.zip *.jar *.litemod *.nilmod)");
2022-02-21 21:30:44 +00:00
values.append(modsPage);
values.append(new CoreModFolderPage(onesix.get(), onesix->coreModList()));
values.append(new NilModFolderPage(onesix.get(), onesix->nilModList()));
values.append(new ResourcePackPage(onesix.get(), onesix->resourcePackList()));
values.append(new TexturePackPage(onesix.get(), onesix->texturePackList()));
values.append(new ShaderPackPage(onesix.get(), onesix->shaderPackList()));
2022-02-21 21:30:44 +00:00
values.append(new NotesPage(onesix.get()));
values.append(new WorldListPage(onesix.get(), onesix->worldList()));
values.append(new ServersPage(onesix));
// values.append(new GameOptionsPage(onesix.get()));
values.append(new ScreenshotsPage(FS::PathCombine(onesix->gameRoot(), "screenshots")));
values.append(new InstanceSettingsPage(onesix.get()));
2018-07-15 13:51:05 +01:00
auto logMatcher = inst->getLogFileMatcher();
if (logMatcher) {
2018-07-15 13:51:05 +01:00
values.append(new OtherLogsPage(inst->getLogFileRoot(), logMatcher));
}
return values;
}
2015-02-07 09:43:09 +00:00
virtual QString dialogTitle() override { return tr("Edit Instance (%1)").arg(inst->name()); }
protected:
2018-07-15 13:51:05 +01:00
InstancePtr inst;
2015-02-07 09:43:09 +00:00
};