diff options
Diffstat (limited to 'src/core/cvar.cc')
-rw-r--r-- | src/core/cvar.cc | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/core/cvar.cc b/src/core/cvar.cc index 518ec5a..4571240 100644 --- a/src/core/cvar.cc +++ b/src/core/cvar.cc @@ -31,8 +31,19 @@ std::map<std::string, Cvar*> Cvar::registry; Cvar::Cvar(const char *name, unsigned int flags) { cvar_flags = flags; + if (name) cvar_name.assign(name); + else + cvar_name.clear(); + + cvar_info.clear(); +} + +void Cvar::set_info(const char *info) +{ + if (info) + cvar_info.assign(info); } Cvar & Cvar::operator=(const std::string &other) @@ -148,6 +159,8 @@ Cvar *Cvar::find(const char *name) void Cvar::list() { + con_print << "Flags: A=Archive G=Game R=ReadOnly" << std::endl; + std::map<std::string, Cvar*>::iterator it; for (it = registry.begin(); it != registry.end(); it++) { std::string typeindicator; @@ -155,17 +168,19 @@ void Cvar::list() typeindicator += 'A'; else typeindicator += ' '; - if (((*it).second->flags() & ReadOnly) == ReadOnly) - typeindicator += 'R'; - else - typeindicator += ' '; + if (((*it).second->flags() & Game) == Game) typeindicator += 'G'; else typeindicator += ' '; + if (((*it).second->flags() & ReadOnly) == ReadOnly) + typeindicator += 'R'; + else + typeindicator += ' '; + con_print << " " << typeindicator << - " " << (*it).first << " " << (*it).second->str() << std::endl; + " " << (*it).first << " " << (*it).second->str() << " " << (*it).second->info() << std::endl; } con_print << registry.size() << " registered variables" << std::endl; } |