changed a bunch of fucking shit

This commit is contained in:
2025-01-15 19:44:59 +01:00
committed by andreas
parent 3bd020fe0b
commit f3640412bb
11 changed files with 278 additions and 33 deletions
+33
View File
@@ -0,0 +1,33 @@
package game.ui;
import game.ui.CVar;
import game.ui.CVarType;
class ConVar{
static var CVarMap:Map<String, CVar> = [];
public static inline function registerCVar(_name:String, _type:CVarType, _value, _callback:Void->Void,_callOnSet:Bool=false)
{
if(CVarMap[_name]!=null){
return;
}
CVarMap[_name] = {
name : _name,
type : _type,
value : _value,
callback : _callback == null ? ()->{} : _callback
}
}
public static inline function setCVar(_name:String, _value:Dynamic)
{
if(CVarMap[_name] != null){
CVarMap[_name] = _value;
}
else{
Console.consoleIndex.devMsg("trying to set null convar '"+_name+"'");
}
}
}