Commit 354bf784 authored by Phillip Stephens's avatar Phillip Stephens

Minor fixes

parent bd8021e1
......@@ -8,8 +8,7 @@
#include "hecl/Database.hpp"
namespace hecl::Database
{
namespace hecl::Database {
/* Centralized registry for DataSpec lookup */
std::vector<const struct DataSpecEntry*> DATA_SPEC_REGISTRY;
}
......@@ -17,7 +16,6 @@ std::vector<const struct DataSpecEntry*> DATA_SPEC_REGISTRY;
@HECL_DATASPEC_DECLS@
/* Please Call Me! */
void HECLRegisterDataSpecs()
{
void HECLRegisterDataSpecs() {
@HECL_DATASPEC_PUSHES@
}
......@@ -74,6 +74,7 @@ public:
void getCVar(class Console* con, const std::vector<std::string>& args);
void setDeveloperMode(bool v, bool setDeserialized = false);
void setCheatsEnabled(bool v, bool setDeserialized = false);
bool restartRequired() const;
void parseCommandLine(const std::vector<SystemString>& args);
......
......@@ -24,7 +24,8 @@ CVarManager::CVarManager(hecl::Runtime::FileStoreManager& store, bool useBinary)
com_developer = newCVar("developer", "Enables developer mode", false,
(CVar::EFlags::System | CVar::EFlags::ReadOnly | CVar::EFlags::InternalArchivable));
com_enableCheats =
newCVar("cheats", "Enable cheats", false, (CVar::EFlags::System | CVar::EFlags::ReadOnly | CVar::EFlags::Hidden));
newCVar("cheats", "Enable cheats", false,
(CVar::EFlags::System | CVar::EFlags::ReadOnly | CVar::EFlags::Hidden | CVar::EFlags::InternalArchivable));
}
CVarManager::~CVarManager() {}
......@@ -251,6 +252,15 @@ void CVarManager::setDeveloperMode(bool v, bool setDeserialized) {
com_developer->setModified();
}
void CVarManager::setCheatsEnabled(bool v, bool setDeserialized) {
com_enableCheats->unlock();
com_enableCheats->fromBoolean(v);
if (setDeserialized)
com_enableCheats->m_wasDeserialized = true;
com_enableCheats->lock();
com_enableCheats->setModified();
}
bool CVarManager::restartRequired() const {
for (const auto& cv : m_cvars) {
if (cv.second->isModified() && cv.second->modificationRequiresRestart())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment