32 Commits
Author SHA1 Message Date
andreas 7dc6ccd568 Unchecked commits to resume work on linux 2025-01-15 19:35:22 +01:00
andreas ac5008c285 fixed inconsistency with var naming scheme 2025-01-15 19:35:22 +01:00
andreas c24fd09550 minor changes 2025-01-15 19:35:22 +01:00
andreas 094c673269 changed the tool window impolementation 2025-01-15 19:35:22 +01:00
andreas 02b978ca90 ya 2025-01-15 19:35:22 +01:00
andreas 4e08f0de62 Moved and added a bunch of stuff 2025-01-15 19:35:21 +01:00
andreas 21b0b63e89 various changes 2025-01-15 19:35:11 +01:00
andreas 7508670dbe Implemented UIPane 2025-01-15 19:35:11 +01:00
andreas d55f4d4cab Moved ConVar related files to engine 2025-01-15 19:35:11 +01:00
andreas 6b3e7ca558 removed unneeded class 2025-01-15 19:34:51 +01:00
andreas 6e07b9411b implemented keybinds 2025-01-15 19:34:50 +01:00
andreas 48600ebe78 refactoring console ui 2025-01-15 19:34:29 +01:00
andreas abbfcc08e6 preprocessor definitions to prevent complaining 2025-01-15 19:33:11 +01:00
andreas f07f337bb3 target hashlink 2025-01-15 19:33:11 +01:00
andreas 8aad10a0da some minor changes 2025-01-15 19:33:11 +01:00
andreas a007e4b8cc fixed import of deleted file 2025-01-15 19:32:26 +01:00
andreas 366ad1201c changed a bunch of fucking shit 2025-01-15 19:31:49 +01:00
andreas daa684b29c implemented cvar, ccmd and parsing console input 2025-01-15 19:29:34 +01:00
andreas d39ee2a754 changed a bunch of fucking shit 2025-01-15 19:29:34 +01:00
andreas 1bf26db583 added Bind class 2025-01-15 19:29:34 +01:00
andreas e9e1cb6898 bunch of shit 2025-01-15 19:29:34 +01:00
andreas fd004e2bb0 added keyboard input 2025-01-15 19:29:34 +01:00
andreas 299b3e0e6f moved and changed Game.hx 2025-01-15 19:29:34 +01:00
andreas 201c66071a added entity support 2025-01-15 19:29:34 +01:00
andreas 40dfdbe29f changed tilesets 2025-01-15 19:29:34 +01:00
andreas 060087c527 implemented atlas loading 2025-01-15 19:29:34 +01:00
andreas 6201369a0a I don't even know what I changed at this point 2025-01-15 19:29:34 +01:00
andreas b992e3f3a2 removed more ignore files 2025-01-15 19:29:34 +01:00
andreas 16191537f1 removed ignored files 2025-01-15 19:29:31 +01:00
andreas 5f86f1677c updated gitignore 2025-01-15 19:29:31 +01:00
andreas 76d71c3275 added gitignore 2025-01-15 19:29:31 +01:00
andreas 5d4c4a054e First commit 2025-01-15 19:28:55 +01:00
3 changed files with 9 additions and 38 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
<title>nigger</title>
<title>test</title>
<link rel="shortcut icon" type="image/png" href="./favicon.png">
</head>
<body>
+7 -34
View File
@@ -10,47 +10,20 @@ import game.ui.console.Console;
class ConVar{
static var CVarMap:Map<String, CVar> = [];
static var CCmdMap:Map<String, CCmd> = [];
/**
* Registers a new CVar
* @param _name The name of the CVar. This is the way it is called in the console or referred to in code.
* @param _type CVar type as defined in the CVarType enum.
* @param _value The default value for this CVar. This needs to be in line with its CVarType.
* @param _flags CVar flags as defined in the CVarFlags enum.
* @param _helpString Help string that gets printed out in console when no value is specified.
* @param _callback The function that gets called when the CVar is set. Calls empty Void when left undefined.
* @param _callOnCreate Whether the callback function gets called or not after registering.
* @param _bMin Specifies if the CVar has a minimum numeric value.
* @param _fMin Specifies the minimum numeric value.
* @param _fMax Specifies the maximum numeric value.
* @param _bMax Specifies if the CVar has a maximum numeric value.
*/
public static inline function registerCVar(_name:String, _type:CVarType, _value:Dynamic, ?_flags:CVarFlag, ?_helpString:String = "", ?_callback:Void->Void, ?_callOnCreate:Bool=false, _bMin:Bool=false, _fMin:Float=0, _fMax:Float=0, _bMax:Bool = false):CVar
public static inline function registerCVar(_name:String, _type:CVarType, _value, _callback:Void->Void,_callOnSet:Bool=false)
{
if(CVarMap[_name]!=null || CCmdMap[_name]!=null){
Console.devMsg("Tried setting already defined convar: " + _name + ", returning null instead");
return null;
if(CVarMap[_name]!=null){
return;
}
if(_bMin && _value < _fMin) _value = _fMin;
if(_bMax && _value > _fMax) _value = _fMax;
var cvar:CVar = CVarMap[_name] = {
CVarMap[_name] = {
name : _name,
type : _type,
value : _value,
flags: _flags,
helpString: _helpString,
bMin : _bMin,
fMin : _fMin,
fMax : _fMax,
bMax : _bMax,
callback : _callback == null ? ()->{} : _callback
}
if(_callback != null && _callOnCreate){
_callback();
}
return cvar;
}
public static inline function registerCCmd(_name:String, ?_callback:Array<String>->Void):CCmd
public static inline function setCVar(_name:String, _value:Dynamic)
{
if(CVarMap[_name]!=null || CCmdMap[_name]!=null){
Console.devMsg("Tried setting already defined command: " + _name + ", returning null instead");
@@ -104,7 +77,7 @@ class ConVar{
}
else{
Console.devMsg("trying to set null convar '"+_name+"'");
Console.consoleIndex.devMsg("trying to set null convar '"+_name+"'");
}
}
+1 -3
View File
@@ -11,11 +11,9 @@ 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:CCmd = ConVar.registerCCmd("mat_setvideomode",(args:Array<String>)->{
setVideoMode(Std.parseInt(args[0]), Std.parseInt(args[1]), Std.parseInt(args[2]));