2015-02-07 15:13:09 +05:30
|
|
|
#pragma once
|
2017-07-24 12:31:37 +05:30
|
|
|
#include "minecraft/MinecraftInstance.h"
|
2017-09-17 02:39:05 +05:30
|
|
|
#include "minecraft/legacy/LegacyInstance.h"
|
2015-10-05 05:17:27 +05:30
|
|
|
#include <FileSystem.h>
|
2015-02-07 15:13:09 +05:30
|
|
|
#include "pages/BasePage.h"
|
|
|
|
#include "pages/BasePageProvider.h"
|
2018-03-19 07:06:12 +05:30
|
|
|
#include "pages/instance/LogPage.h"
|
|
|
|
#include "pages/instance/VersionPage.h"
|
|
|
|
#include "pages/instance/ModFolderPage.h"
|
2018-05-28 01:08:33 +05:30
|
|
|
#include "pages/instance/NewModFolderPage.h"
|
2018-03-19 07:06:12 +05:30
|
|
|
#include "pages/instance/ResourcePackPage.h"
|
|
|
|
#include "pages/instance/TexturePackPage.h"
|
|
|
|
#include "pages/instance/NotesPage.h"
|
|
|
|
#include "pages/instance/ScreenshotsPage.h"
|
|
|
|
#include "pages/instance/InstanceSettingsPage.h"
|
|
|
|
#include "pages/instance/OtherLogsPage.h"
|
|
|
|
#include "pages/instance/LegacyUpgradePage.h"
|
|
|
|
#include "pages/instance/WorldListPage.h"
|
2018-04-12 05:14:51 +05:30
|
|
|
#include "pages/instance/ServersPage.h"
|
2015-02-07 15:13:09 +05:30
|
|
|
|
2015-04-06 01:30:32 +05:30
|
|
|
|
2015-02-07 15:13:09 +05:30
|
|
|
class InstancePageProvider : public QObject, public BasePageProvider
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit InstancePageProvider(InstancePtr parent)
|
|
|
|
{
|
|
|
|
inst = parent;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~InstancePageProvider() {};
|
|
|
|
virtual QList<BasePage *> getPages() override
|
|
|
|
{
|
|
|
|
QList<BasePage *> values;
|
2016-08-06 19:09:29 +05:30
|
|
|
values.append(new LogPage(inst));
|
2017-07-24 12:31:37 +05:30
|
|
|
std::shared_ptr<MinecraftInstance> onesix = std::dynamic_pointer_cast<MinecraftInstance>(inst);
|
2015-02-07 15:13:09 +05:30
|
|
|
if(onesix)
|
|
|
|
{
|
|
|
|
values.append(new VersionPage(onesix.get()));
|
2015-05-13 03:13:11 +05:30
|
|
|
auto modsPage = new ModFolderPage(onesix.get(), onesix->loaderModList(), "mods", "loadermods", tr("Loader mods"), "Loader-mods");
|
2016-03-23 03:58:47 +05:30
|
|
|
modsPage->setFilter("%1 (*.zip *.jar *.litemod)");
|
2015-05-13 03:13:11 +05:30
|
|
|
values.append(modsPage);
|
2018-07-15 17:34:09 +05:30
|
|
|
auto modsPage2 = new NewModFolderPage(onesix.get(), onesix->modsModel(), "newmods", "newloadermods", tr("New loader mods"), "New-loader-mods");
|
2018-05-28 01:08:33 +05:30
|
|
|
modsPage2->setFilter("%1 (*.zip *.jar *.litemod)");
|
|
|
|
values.append(modsPage2);
|
2015-05-13 03:13:11 +05:30
|
|
|
values.append(new CoreModFolderPage(onesix.get(), onesix->coreModList(), "coremods", "coremods", tr("Core mods"), "Core-mods"));
|
2015-02-07 15:13:09 +05:30
|
|
|
values.append(new ResourcePackPage(onesix.get()));
|
|
|
|
values.append(new TexturePackPage(onesix.get()));
|
|
|
|
values.append(new NotesPage(onesix.get()));
|
2015-08-19 04:40:17 +05:30
|
|
|
values.append(new WorldListPage(onesix.get(), onesix->worldList(), "worlds", "worlds", tr("Worlds"), "Worlds"));
|
2018-04-12 05:14:51 +05:30
|
|
|
values.append(new ServersPage(onesix.get()));
|
2015-10-05 05:17:27 +05:30
|
|
|
values.append(new ScreenshotsPage(FS::PathCombine(onesix->minecraftRoot(), "screenshots")));
|
2015-02-07 15:13:09 +05:30
|
|
|
values.append(new InstanceSettingsPage(onesix.get()));
|
|
|
|
}
|
2017-09-17 02:39:05 +05:30
|
|
|
std::shared_ptr<LegacyInstance> legacy = std::dynamic_pointer_cast<LegacyInstance>(inst);
|
|
|
|
if(legacy)
|
|
|
|
{
|
2017-09-26 17:08:34 +05:30
|
|
|
values.append(new LegacyUpgradePage(legacy));
|
2017-09-21 03:08:31 +05:30
|
|
|
values.append(new NotesPage(legacy.get()));
|
|
|
|
values.append(new WorldListPage(legacy.get(), legacy->worldList(), "worlds", "worlds", tr("Worlds"), "Worlds"));
|
|
|
|
values.append(new ScreenshotsPage(FS::PathCombine(legacy->minecraftRoot(), "screenshots")));
|
2017-09-17 02:39:05 +05:30
|
|
|
}
|
2015-08-18 05:55:24 +05:30
|
|
|
auto logMatcher = inst->getLogFileMatcher();
|
|
|
|
if(logMatcher)
|
|
|
|
{
|
2015-08-19 05:34:56 +05:30
|
|
|
values.append(new OtherLogsPage(inst->getLogFileRoot(), logMatcher));
|
2015-04-06 01:30:32 +05:30
|
|
|
}
|
2015-02-07 15:13:09 +05:30
|
|
|
return values;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual QString dialogTitle() override
|
|
|
|
{
|
|
|
|
return tr("Edit Instance (%1)").arg(inst->name());
|
|
|
|
}
|
|
|
|
protected:
|
|
|
|
InstancePtr inst;
|
|
|
|
};
|