mirror of https://github.com/AxioDL/metaforce.git
Console: Make State enum an enum class
Makes the enum strongly typed and impervious to implicit conversions.
This commit is contained in:
parent
12d6a5ce05
commit
a0e6ec0de7
|
@ -55,7 +55,7 @@ public:
|
|||
Fatal /**< Non-recoverable error message (Kept for compatibility with logvisor) */
|
||||
};
|
||||
|
||||
enum State { Closed, Closing, Opened, Opening };
|
||||
enum class State { Closed, Closing, Opened, Opening };
|
||||
|
||||
private:
|
||||
CVarManager* m_cvarMgr = nullptr;
|
||||
|
|
|
@ -242,8 +242,9 @@ void Console::handleCharCode(unsigned long chr, boo::EModifierKey /*mod*/, bool
|
|||
}
|
||||
|
||||
void Console::handleSpecialKeyDown(boo::ESpecialKey sp, boo::EModifierKey mod, bool /*repeat*/) {
|
||||
if (m_state != Opened)
|
||||
if (m_state != State::Opened) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (sp) {
|
||||
case boo::ESpecialKey::Insert:
|
||||
|
|
Loading…
Reference in New Issue