#include "progname.qh"
#include "static.qh"
+[[eraseable]]
void RegisterCvars(void(string name, string def, string desc, bool archive, string file) f) {}
+[[eraseable]]
bool cvar_value_issafe(string s)
{
if (strstrofs(s, "\"", 0) >= 0) return false;
}
/** escape the string to make it safe for consoles */
+[[eraseable]]
string MakeConsoleSafe(string input)
{
input = strreplace("\n", "", input);
return input;
}
+[[eraseable]]
void cvar_describe(string name, string desc)
{
localcmd(sprintf("\nset %1$s \"$%1$s\" \"%2$s\"\n", name, MakeConsoleSafe(desc)));
}
+[[eraseable]]
void cvar_archive(string name)
{
localcmd(sprintf("\nseta %1$s \"$%1$s\"\n", name));
}
+[[eraseable]]
void RegisterCvars_Set(string name, string def, string desc, bool archive, string file)
{
cvar_describe(name, desc);
}
int RegisterCvars_Save_fd;
+[[eraseable]]
void RegisterCvars_Save(string name, string def, string desc, bool archive, string file)
{
if (!archive) return;