34 Commits
Author SHA1 Message Date
andreas 180b0f4b3f Unchecked commits to resume work on linux 2021-11-27 08:34:42 +01:00
andreas d7bd0d02ee Merge branch 'ui_unchecked' of git-subsonics-andreas:andreas/hGameTest into ui_unchecked 2021-10-09 21:37:52 +02:00
andreas 720b4d45f2 minor changes 2021-10-09 21:37:42 +02:00
andreas 8951795e9b fixed inconsistency with var naming scheme 2021-10-07 01:52:03 +02:00
andreas 4208265d21 changed the tool window impolementation 2021-09-27 21:02:11 +02:00
andreas 5422b854e0 ya 2021-06-28 10:29:12 +02:00
andreas 4f9469ead5 Moved and added a bunch of stuff 2021-06-22 20:02:02 +02:00
andreas a07bdb6b99 various changes 2021-06-19 18:12:24 +02:00
andreas 24432f1b91 Implemented UIPane 2021-06-11 13:17:49 +02:00
andreas 07fa2e7868 Moved ConVar related files to engine 2021-04-28 09:32:47 +02:00
andreas 4fe14e341c removed unneeded class 2021-04-28 08:34:19 +02:00
andreas c3ac30208b implemented keybinds 2021-04-28 08:29:55 +02:00
andreas 7fa7ece574 refactoring console ui 2021-04-27 00:25:42 +02:00
andreas be0c83e766 preprocessor definitions to prevent complaining 2021-04-27 00:25:07 +02:00
andreas 4f4cca4109 target hashlink 2021-04-27 00:24:30 +02:00
andreas 7e3369d128 some minor changes 2021-03-31 16:13:23 +02:00
andreas 33e5a67e4d fixed import of deleted file 2021-03-31 15:13:52 +02:00
andreas 75d8032b5d Merge branch 'aids' of git-subsonics-andreas:andreas/hGameTest into aids 2021-03-31 15:10:49 +02:00
andreas 013a27d0b3 implemented cvar, ccmd and parsing console input 2021-03-31 15:03:58 +02:00
andreas 8adb6bbaef changed a bunch of fucking shit 2021-03-31 14:58:07 +02:00
andreas 5723371944 changed a bunch of fucking shit 2021-03-24 21:59:05 +01:00
andreas 4272c12ec1 added Bind class 2021-03-15 10:12:12 +01:00
andreas 923ac33302 bunch of shit 2021-03-14 18:39:55 +01:00
andreas bc1a251842 added keyboard input 2021-03-13 04:11:21 +01:00
andreas 8973b65954 moved and changed Game.hx 2021-03-13 04:11:09 +01:00
andreas 132a9d63c0 added entity support 2021-03-13 04:10:27 +01:00
andreas fbc3be26e4 changed tilesets 2021-03-13 04:10:02 +01:00
andreas 56d4651228 implemented atlas loading 2021-03-13 00:11:14 +01:00
andreas 570816c0b5 I don't even know what I changed at this point 2021-03-10 23:28:05 +01:00
andreas 90d44a1376 removed more ignore files 2021-03-07 06:28:46 +01:00
andreas 9a585cf24b removed ignored files 2021-03-07 06:28:07 +01:00
andreas 728ab76571 updated gitignore 2021-03-07 06:26:24 +01:00
andreas a96e97f2a0 added gitignore 2021-03-07 06:21:21 +01:00
andreas 8204c6b556 First commit 2021-03-07 05:58:59 +01:00
5 changed files with 40 additions and 11 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>test</title> <title>nigger</title>
<link rel="shortcut icon" type="image/png" href="./favicon.png"> <link rel="shortcut icon" type="image/png" href="./favicon.png">
</head> </head>
<body> <body>
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"name": "test", "name": "nigger",
"version": "1.0.0", "version": "1.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"name": "test", "name": "nigger",
"version": "1.0.0", "version": "1.0.0",
"private": true, "private": true,
"config": { "config": {
+34 -7
View File
@@ -10,20 +10,47 @@ import game.ui.console.Console;
class ConVar{ class ConVar{
static var CVarMap:Map<String, CVar> = []; static var CVarMap:Map<String, CVar> = [];
public static inline function registerCVar(_name:String, _type:CVarType, _value, _callback:Void->Void,_callOnSet:Bool=false) 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
{ {
if(CVarMap[_name]!=null){ if(CVarMap[_name]!=null || CCmdMap[_name]!=null){
Console.devMsg("Tried setting already defined convar: " + _name + ", returning null instead");
return; return null;
} }
CVarMap[_name] = { if(_bMin && _value < _fMin) _value = _fMin;
if(_bMax && _value > _fMax) _value = _fMax;
var cvar:CVar = CVarMap[_name] = {
name : _name, name : _name,
type : _type, type : _type,
value : _value, value : _value,
flags: _flags,
helpString: _helpString,
bMin : _bMin,
fMin : _fMin,
fMax : _fMax,
bMax : _bMax,
callback : _callback == null ? ()->{} : _callback callback : _callback == null ? ()->{} : _callback
} }
if(_callback != null && _callOnCreate){
_callback();
} }
public static inline function setCVar(_name:String, _value:Dynamic) return cvar;
}
public static inline function registerCCmd(_name:String, ?_callback:Array<String>->Void):CCmd
{ {
if(CVarMap[_name]!=null || CCmdMap[_name]!=null){ if(CVarMap[_name]!=null || CCmdMap[_name]!=null){
Console.devMsg("Tried setting already defined command: " + _name + ", returning null instead"); Console.devMsg("Tried setting already defined command: " + _name + ", returning null instead");
@@ -77,7 +104,7 @@ class ConVar{
} }
else{ else{
Console.consoleIndex.devMsg("trying to set null convar '"+_name+"'"); Console.devMsg("trying to set null convar '"+_name+"'");
} }
} }
+3 -1
View File
@@ -11,9 +11,11 @@ class Mode
{ {
return Lib.application.window; return Lib.application.window;
} }
public static function setVideoMode(width:Int, height:Int, fs:Int = null){ public static function setVideoMode(width:Int, height:Int, fs:Int = null){
getWindow().resize(width,height); getWindow().resize(width,height);
if(fs != null){
switchFsMode(fs);
}
} }
public static var cvMatSetVideoMode:CCmd = ConVar.registerCCmd("mat_setvideomode",(args:Array<String>)->{ 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])); setVideoMode(Std.parseInt(args[0]), Std.parseInt(args[1]), Std.parseInt(args[2]));