From 6cee50eac6c25796eb3642239385b0c58860cd58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Wed, 1 Aug 2018 20:05:18 +0200 Subject: NOISSUE gate new mods page behind cheat code --- api/logic/Env.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'api/logic/Env.cpp') 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 m_iconlist; shared_qobject_ptr m_metadataIndex; QString m_jarsPath; + QSet 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& features) const +{ + features = d->m_features; +} + +void Env::setEnabledFeatures(const QSet& features) const +{ + d->m_features = features; +} -- cgit v1.2.3