massively updated decorator code to support convar and implement

This commit is contained in:
2025-03-11 12:37:43 +01:00
parent 99dc07cd64
commit 2383b5f026
8 changed files with 159 additions and 52 deletions

View File

@@ -18,7 +18,19 @@ class Input{
public static var keys:Map<Int,Bool> = [];
public static var keysLast:Map<Int,Bool> = [];
public static var bindMap:Map<String, String> = ["~" => "toggleconsole", "\\" => "toggleconsole", "1" => "echo kak", "2" => "+attack"];
public static var cv_debugKeys = ConVar.registerCVar("cl_debuginput", CInt, 0, null, "print debug messages related to input to console", null, false, true, 0, 0, false);
@:convar({
name: "cl_debuginput",
type: CVarType.CInt,
value: 0,
flags: CVarFlag.None,
help: "print debug messages related to input to console",
callback: function() {
trace("Debug input changed");
}
})
public static var cv_debugKeys:CVar;
// public static var cv_debugKeys = ConVar.registerCVar("cl_debuginput", CInt, 0, null, "print debug messages related to input to console", null, false, true, 0, 0, false);
public static var keyNameMap:Map<Int, String> = [
Kb.HOME => "HOME", Kb.END => "END", Kb.INSERT => "INSERT", Kb.DELETE => "DELETE", Kb.PAGE_UP => "PGUP", Kb.PAGE_DOWN => "PGDN",
Kb.ESCAPE => "ESC", Kb.F1 => "F1", Kb.F2 => "F2", Kb.F3 => "F3", Kb.F4 => "F4", Kb.F5 => "F5",

View File

@@ -15,7 +15,7 @@ class Mode
public static function setVideoMode(width:Int, height:Int, fs:Int = null){
getWindow().resize(width,height);
}
@:ConCmd("mat_setvideomode")
@:concmd("mat_setvideomode")
public static function cCmdMatSetVideoMode(args:Array<String>){
Mode.setVideoMode(Std.parseInt(args[0]), Std.parseInt(args[1]), Std.parseInt(args[2]));
}