implemented keybinds
This commit is contained in:
@@ -26,6 +26,9 @@ class Console extends Sprite{
|
||||
public var cAutoComp:TextField;
|
||||
public static var consoleInstance:Console;
|
||||
public var cvar_mat_consolebg:CVar;
|
||||
public var cCmd_visible:CCmd = ConVar.registerCCmd("toggleconsole",(cArgs:Array<String>)->{
|
||||
toggle();
|
||||
});
|
||||
public function new(){
|
||||
super();
|
||||
|
||||
@@ -88,8 +91,10 @@ class Console extends Sprite{
|
||||
ConVar.registerCCmd("echo", (args:Array<String>) -> { Console.devMsg(args.join(" ").split('"').join(""));});
|
||||
ConVar.registerCCmd("quit", (args:Array<String>) -> { Lib.application.window.close();});
|
||||
}
|
||||
public function parseCmd(cmd:String){
|
||||
history.push(cmd);
|
||||
public function parseCmd(cmd:String, bNoHist:Bool = false){
|
||||
if(!bNoHist)
|
||||
history.push(cmd);
|
||||
|
||||
cmd = cmd.split(";").join(" ; ");
|
||||
var subStrings = [];
|
||||
var startQuoteIndex:Int = cmd.indexOf('"');
|
||||
@@ -218,6 +223,14 @@ class Console extends Sprite{
|
||||
public static function toggle():Void
|
||||
{
|
||||
consoleInstance.visible = !consoleInstance.visible;
|
||||
if(!consoleInstance.visible){
|
||||
if(Lib.current.stage.focus == consoleInstance.cIn){
|
||||
Lib.current.stage.focus = null;
|
||||
}
|
||||
}
|
||||
else{
|
||||
Lib.current.stage.focus = consoleInstance.cIn;
|
||||
}
|
||||
}
|
||||
public static function devMsg(msg:String):Void
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user