From 743af4769ee59b5830d79139852dda0679b28a03 Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Sun, 17 May 2015 23:38:28 +0200 Subject: 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 --- logic/ftb/FTBProfileStrategy.cpp | 14 ++++++++++++-- logic/ftb/FTBProfileStrategy.h | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'logic/ftb') 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(); -- cgit