changed a bunch of fucking shit
This commit is contained in:
@@ -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+"'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user