summaryrefslogtreecommitdiffstats
path: root/logic/ftb
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-05-17 23:38:28 +0200
committerPetr Mrázek <peterix@gmail.com>2015-05-17 23:38:28 +0200
commit743af4769ee59b5830d79139852dda0679b28a03 (patch)
tree939e150c6127c9bc64926da052fe56e2b483990d /logic/ftb
parent6ab6a450f6831c99ba507436ab15047cfa4d4528 (diff)
downloadMultiMC-743af4769ee59b5830d79139852dda0679b28a03.tar
MultiMC-743af4769ee59b5830d79139852dda0679b28a03.tar.gz
MultiMC-743af4769ee59b5830d79139852dda0679b28a03.tar.lz
MultiMC-743af4769ee59b5830d79139852dda0679b28a03.tar.xz
MultiMC-743af4769ee59b5830d79139852dda0679b28a03.zip
GH-952 Hardcore version page tweakery
Version patches get a lot of new flags that determine which actions are allowed Version page respects the flags Customize, revert and edit for version patches Builting patches can be customized
Diffstat (limited to 'logic/ftb')
-rw-r--r--logic/ftb/FTBProfileStrategy.cpp14
-rw-r--r--logic/ftb/FTBProfileStrategy.h3
2 files changed, 14 insertions, 3 deletions
diff --git a/logic/ftb/FTBProfileStrategy.cpp b/logic/ftb/FTBProfileStrategy.cpp
index cc20b247..ff40b642 100644
--- a/logic/ftb/FTBProfileStrategy.cpp
+++ b/logic/ftb/FTBProfileStrategy.cpp
@@ -26,6 +26,7 @@ void FTBProfileStrategy::loadDefaultBuiltinPatches()
auto file = ProfileUtils::parseJsonFile(QFileInfo(mcJson), false);
file->fileId = "net.minecraft";
file->name = QObject::tr("Minecraft (tracked)");
+ file->setVanilla(true);
if(file->version.isEmpty())
{
file->version = mcVersion;
@@ -59,6 +60,7 @@ void FTBProfileStrategy::loadDefaultBuiltinPatches()
addLib->insertType = RawLibrary::Prepend;
}
file->fileId = "org.multimc.ftb.pack";
+ file->setVanilla(true);
file->name = QObject::tr("%1 (FTB pack)").arg(m_instance->name());
if(file->version.isEmpty())
{
@@ -117,6 +119,8 @@ void FTBProfileStrategy::loadUserPatches()
throw VersionBuildError(
QObject::tr("load id %1 does not match internal id %2").arg(id, file->fileId));
}
+ file->setRemovable(true);
+ file->setMovable(true);
profile->appendPatch(file);
}
// now load the rest by internal preference.
@@ -140,6 +144,8 @@ void FTBProfileStrategy::loadUserPatches()
throw VersionBuildError(QObject::tr("%1 has the same order as %2")
.arg(file->fileId, files[file->order].second->fileId));
}
+ file->setRemovable(true);
+ file->setMovable(true);
files.insert(file->order, qMakePair(info.fileName(), file));
}
for (auto order : files.keys())
@@ -170,13 +176,17 @@ bool FTBProfileStrategy::resetOrder()
return false;
}
-bool FTBProfileStrategy::removePatch(ProfilePatchPtr patch)
+bool FTBProfileStrategy::installJarMods(QStringList filepaths)
{
return false;
}
-bool FTBProfileStrategy::installJarMods(QStringList filepaths)
+bool FTBProfileStrategy::customizePatch(ProfilePatchPtr patch)
{
return false;
}
+bool FTBProfileStrategy::revertPatch(ProfilePatchPtr patch)
+{
+ return false;
+}
diff --git a/logic/ftb/FTBProfileStrategy.h b/logic/ftb/FTBProfileStrategy.h
index 65f07069..5e5c2e73 100644
--- a/logic/ftb/FTBProfileStrategy.h
+++ b/logic/ftb/FTBProfileStrategy.h
@@ -13,7 +13,8 @@ public:
virtual bool resetOrder() override;
virtual bool saveOrder(ProfileUtils::PatchOrder order) override;
virtual bool installJarMods(QStringList filepaths) override;
- virtual bool removePatch(ProfilePatchPtr patch) override;
+ virtual bool customizePatch (ProfilePatchPtr patch) override;
+ virtual bool revertPatch (ProfilePatchPtr patch) override;
protected:
void loadDefaultBuiltinPatches();