Commit a8b2d5d6 authored by Phillip Stephens's avatar Phillip Stephens

Minor fixes

parent c430ed66
......@@ -124,8 +124,6 @@ public:
bool isColor() const;
bool wasDeserialized() const;
bool hasDefaultValue() const;
void clearModified();
void setModified();
EType type() const { return m_type; }
EFlags flags() const { return (m_unlocked ? m_oldFlags : m_flags); }
......@@ -153,6 +151,8 @@ public:
private:
CVar(std::string_view name, std::string_view help, EType type) : m_help(help), m_type(type) { m_name = name; }
void dispatch();
void clearModified();
void setModified();
std::string m_help;
EType m_type;
std::string m_defaultValue;
......
......@@ -415,6 +415,7 @@ bool CVar::fromLiteralToType(std::string_view val) {
if (!safeToModify(m_type) || !isValidInput(val))
return false;
m_value = val;
setModified();
return true;
}
......
......@@ -331,6 +331,8 @@ void CVarManager::proc() {
for (const auto& [name, cvar] : m_cvars) {
if (cvar->isModified() && !cvar->modificationRequiresRestart()) {
cvar->dispatch();
// Clear the modified flag now that we've informed everyone we've changed
cvar->clearModified();
}
}
}
......
......@@ -175,12 +175,10 @@ void Console::init(boo::IWindow* window) {
void Console::proc() {
if (m_conHeight->isModified()) {
m_cachedConHeight = m_conHeight->toReal();
m_conHeight->clearModified();
}
if (m_conSpeed->isModified()) {
m_cachedConSpeed = m_conSpeed->toReal();
m_conSpeed->clearModified();
}
if (m_state == State::Opened) {
......
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