Bladeren bron

add clear console command

deepnight 9 jaren geleden
bovenliggende
commit
24630ce91b
1 gewijzigde bestanden met toevoegingen van 4 en 0 verwijderingen
  1. 4 0
      h2d/Console.hx

+ 4 - 0
h2d/Console.hx

@@ -49,6 +49,10 @@ class Console extends h2d.Sprite {
 		commands = new Map();
 		commands = new Map();
 		aliases = new Map();
 		aliases = new Map();
 		addCommand("help", "Show help", [ { name : "command", t : AString, opt : true } ], showHelp);
 		addCommand("help", "Show help", [ { name : "command", t : AString, opt : true } ], showHelp);
+		addCommand("cls", "Clear console", [], function() {
+			logs = [];
+			logTxt.text = "";
+		});
 		addAlias("?", "help");
 		addAlias("?", "help");
 	}
 	}