summaryrefslogtreecommitdiffstats
path: root/api/logic/Env.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-08-01 20:05:18 +0200
committerPetr Mrázek <peterix@gmail.com>2018-08-01 20:05:18 +0200
commit6cee50eac6c25796eb3642239385b0c58860cd58 (patch)
tree61a0d5ff2ee5cae58458630fe815321648f26f54 /api/logic/Env.cpp
parent9cc93ae81db9990594c012529001a069f584ee6c (diff)
downloadMultiMC-6cee50eac6c25796eb3642239385b0c58860cd58.tar
MultiMC-6cee50eac6c25796eb3642239385b0c58860cd58.tar.gz
MultiMC-6cee50eac6c25796eb3642239385b0c58860cd58.tar.lz
MultiMC-6cee50eac6c25796eb3642239385b0c58860cd58.tar.xz
MultiMC-6cee50eac6c25796eb3642239385b0c58860cd58.zip
NOISSUE gate new mods page behind cheat code
Diffstat (limited to 'api/logic/Env.cpp')
-rw-r--r--api/logic/Env.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/api/logic/Env.cpp b/api/logic/Env.cpp
index 73cad2e9..77546bbc 100644
--- a/api/logic/Env.cpp
+++ b/api/logic/Env.cpp
@@ -20,6 +20,7 @@ struct Env::Private
std::shared_ptr<IIconList> m_iconlist;
shared_qobject_ptr<Meta::Index> m_metadataIndex;
QString m_jarsPath;
+ QSet<QString> m_features;
};
static Env * instance;
@@ -179,3 +180,30 @@ void Env::setJarsPath(const QString& path)
{
d->m_jarsPath = path;
}
+
+void Env::enableFeature(const QString& featureName, bool state)
+{
+ if(state)
+ {
+ d->m_features.insert(featureName);
+ }
+ else
+ {
+ d->m_features.remove(featureName);
+ }
+}
+
+bool Env::isFeatureEnabled(const QString& featureName) const
+{
+ return d->m_features.contains(featureName);
+}
+
+void Env::getEnabledFeatures(QSet<QString>& features) const
+{
+ features = d->m_features;
+}
+
+void Env::setEnabledFeatures(const QSet<QString>& features) const
+{
+ d->m_features = features;
+}