implemented cvar, ccmd and parsing console input

This commit is contained in:
2025-01-15 19:29:34 +01:00
committed by andreas
parent d39ee2a754
commit daa684b29c
10 changed files with 324 additions and 42 deletions
+7 -1
View File
@@ -1,5 +1,6 @@
package game.video;
import game.ui.ConVar;
import openfl.Lib;
import openfl.display.StageDisplayState;
@@ -9,10 +10,15 @@ class Mode
{
return Lib.application.window;
}
public static function setVideoMode(width:Int, height:Int, fs:Int = null){
getWindow().resize(width,height);
if(fs != null){
switchFsMode(fs);
}
}
public static var cvMatSetVideoMode:engine.typedefs.CCmd = ConVar.registerCCmd("mat_setvideomode",(args:Array<String>)->{
setVideoMode(Std.parseInt(args[0]), Std.parseInt(args[1]), Std.parseInt(args[2]));
});
public static function switchFsMode(toState:Int = 0){
if(toState == 0){
if(Lib.current.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){