summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/VersionFile.h
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/minecraft/VersionFile.h
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/minecraft/VersionFile.h')
-rw-r--r--logic/minecraft/VersionFile.h56
1 files changed, 51 insertions, 5 deletions
diff --git a/logic/minecraft/VersionFile.h b/logic/minecraft/VersionFile.h
index 346a8dcd..dd5c962f 100644
--- a/logic/minecraft/VersionFile.h
+++ b/logic/minecraft/VersionFile.h
@@ -20,7 +20,7 @@ class VersionFile : public ProfilePatch
public: /* methods */
static VersionFilePtr fromJson(const QJsonDocument &doc, const QString &filename,
const bool requireOrder);
- QJsonDocument toJson(bool saveOrder);
+ virtual QJsonDocument toJson(bool saveOrder) override;
virtual void applyTo(MinecraftProfile *version) override;
virtual bool isMinecraftVersion() override;
@@ -53,18 +53,64 @@ public: /* methods */
{
return filename;
}
- virtual bool isCustom()
+ virtual bool isCustom() override
{
- return !isVanilla;
+ return !m_isVanilla;
};
+ virtual bool isCustomizable() override
+ {
+ return m_isCustomizable;
+ }
+ virtual bool isRemovable() override
+ {
+ return m_isRemovable;
+ }
+ virtual bool isRevertible() override
+ {
+ return m_isRevertible;
+ }
+ virtual bool isMoveable() override
+ {
+ return m_isMovable;
+ }
+ virtual bool isEditable() override
+ {
+ return isCustom();
+ }
+ virtual bool isVersionChangeable() override
+ {
+ return false;
+ }
+
void setVanilla (bool state)
{
- isVanilla = state;
+ m_isVanilla = state;
+ }
+ void setRemovable (bool state)
+ {
+ m_isRemovable = state;
+ }
+ void setRevertible (bool state)
+ {
+ m_isRevertible = state;
}
+ void setCustomizable (bool state)
+ {
+ m_isCustomizable = state;
+ }
+ void setMovable (bool state)
+ {
+ m_isMovable = state;
+ }
+
public: /* data */
int order = 0;
- bool isVanilla = false;
+ bool m_isVanilla = false;
+ bool m_isRemovable = false;
+ bool m_isRevertible = false;
+ bool m_isCustomizable = false;
+ bool m_isMovable = false;
QString name;
QString fileId;
QString version;