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
15 changed files with 35 additions and 129 deletions
-4
View File
@@ -1,4 +0,0 @@
{
"version": "4.3.6",
"resolveLibs": "scoped"
}
+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>
-3
View File
@@ -1,3 +0,0 @@
# @install: lix --silent download "haxelib:/actuate#1.9.0" into actuate/1.9.0/haxelib
-cp ${HAXE_LIBCACHE}/actuate/1.9.0/haxelib/src
-D actuate=1.9.0
@@ -1,4 +0,0 @@
# @install: lix --silent download "haxelib:/hxcpp-debug-server#1.2.4" into hxcpp-debug-server/1.2.4/haxelib
-cp ${HAXE_LIBCACHE}/hxcpp-debug-server/1.2.4/haxelib/
-D hxcpp-debug-server=1.2.4
--macro hxcpp.debug.jsonrpc.Macro.injectServer()
-6
View File
@@ -1,6 +0,0 @@
# @install: lix --silent download "haxelib:/lime#8.2.2" into lime/8.2.2/haxelib
# @run: haxelib run-dir lime "${HAXE_LIBCACHE}/lime/8.2.2/haxelib"
-cp ${HAXE_LIBCACHE}/lime/8.2.2/haxelib/src
-D lime=8.2.2
--macro lime._internal.macros.DefineMacro.run()
-lib ndll:${HAXE_LIBCACHE}/lime/8.2.2/haxelib/ndll/
-5
View File
@@ -1,5 +0,0 @@
# @install: lix --silent download "haxelib:/openfl#9.4.1" into openfl/9.4.1/haxelib
# @run: haxelib run-dir openfl "${HAXE_LIBCACHE}/openfl/9.4.1/haxelib"
-cp ${HAXE_LIBCACHE}/openfl/9.4.1/haxelib/src
-D openfl=9.4.1
--macro openfl.utils._internal.ExtraParamsMacro.include()
+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": {
+2 -6
View File
@@ -15,10 +15,6 @@
<!-- classpath, haxe libs --> <!-- classpath, haxe libs -->
<source path="src" /> <source path="src" />
<!-- Macro configuration -->
<haxeflag name="--macro" value="addGlobalMetadata('', '@:build(engine.macros.CCmdDecorator.build())')" />
<assets path="./res/textures" rename="textures" /> <assets path="./res/textures" rename="textures" />
<assets path="./res/fonts" rename="fonts" /> <assets path="./res/fonts" rename="fonts" />
<assets path="./res/data" rename="data"/> <assets path="./res/data" rename="data"/>
@@ -28,6 +24,6 @@
<!--<icon path="assets/openfl.svg" /> --> <!--<icon path="assets/openfl.svg" /> -->
<!-- <assets path="assets/img" rename="img" /> --> <!-- <assets path="assets/img" rename="img" /> -->
<!-- optimize output --> <!-- optimize output
<haxeflag name="-dce full" /> <haxeflag name="-dce full" /> -->
</project> </project>
+9
View File
@@ -0,0 +1,9 @@
package engine;
typedef CVar = {
var name:String;
var type:CVarType;
var value:Dynamic;
@:optional var callback:Void -> Void;
};
+14 -10
View File
@@ -1,17 +1,14 @@
package engine; package engine;
import haxe.Constraints.Function;
import engine.typedefs.console.CVar; import engine.typedefs.console.CVar;
import engine.typedefs.console.CCmd; import engine.typedefs.console.CCmd;
import engine.enums.console.CVarType; import engine.enums.console.CVarType;
import engine.enums.console.CVarFlag; import engine.enums.console.CVarFlag;
import game.ui.console.Console; import game.ui.console.Console;
import engine.ConVars_Engine;
class ConVar{ class ConVar{
// Hush the compiler about unused import
// static var ConVars_Engine:Class<ConVars_Engine> = ConVars_Engine;
static var CVarMap:Map<String, CVar> = []; static var CVarMap:Map<String, CVar> = [];
static var CCmdMap:Map<String, CCmd> = []; static var CCmdMap:Map<String, CCmd> = [];
/** /**
@@ -30,7 +27,7 @@ class ConVar{
*/ */
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: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 || CCmdMap[_name]!= null){ if(CVarMap[_name]!=null || CCmdMap[_name]!=null){
Console.devMsg("Tried setting already defined convar: " + _name + ", returning null instead"); Console.devMsg("Tried setting already defined convar: " + _name + ", returning null instead");
return null; return null;
} }
@@ -146,13 +143,20 @@ class ConVar{
}); });
return keys; return keys;
} }
public static var cmdList:CCmd = ConVar.registerCCmd("list", (cArgs:Array<String>)->{
var keys:Array<String> = getCVarNames();
for(key in keys){
if(CVarMap[key] != null){
Console.devMsg(key+" "+CVarMap[key].value);
}
else{
Console.devMsg(key);
}
}
});
public static inline function getCVar(_name:String):CVar public static inline function getCVar(_name:String):CVar
{ {
return CVarMap[_name]; return CVarMap[_name];
} }
public static inline function getCVarMap():Map<String, CVar>
{
return CVarMap;
}
} }
-36
View File
@@ -1,36 +0,0 @@
package engine;
import game.video.Mode;
import haxe.macro.Expr.Field;
import engine.typedefs.console.CVar;
import engine.typedefs.console.CCmd;
import engine.enums.console.CVarType;
import engine.enums.console.CVarFlag;
import engine.macros.CCmdDecorator;
import game.ui.console.Console;
@:keep
// @:build(engine.macros.CCmdDecorator.build()) // No longer needed because we added the build macro to the project.xml
class ConVars_Engine {
@:command("list")
public static function listCommands(args:Array<String>) {
var CVarMap:Map<String, CVar> = ConVar.getCVarMap();
var keys:Array<String> = ConVar.getCVarNames();
for(key in keys){
if(CVarMap[key] != null){
Console.devMsg(key+" "+ CVarMap[key].value);
}
else{
Console.devMsg(key);
}
}
}
@:command("test")
public static function testCommand() {
// Command implementation
trace("Test Output");
}
}
@@ -1,46 +0,0 @@
package engine.macros;
import haxe.macro.Expr;
import haxe.macro.Context;
class CCmdDecorator {
public static macro function build():Array<Field> {
var fields = Context.getBuildFields();
var pos = Context.currentPos();
for (field in fields) {
var meta = field.meta != null ? Lambda.find(field.meta, function(m) return m.name == ":command") : null;
if (meta != null) {
trace(meta);
switch field.kind {
case FFun(f):
var name = meta.params.length > 0
? switch(meta.params[0].expr) {
case EConst(CString(s)): s;
case _: field.name;
}
: field.name;
// Create a static initializer field
var initField = {
name: "__init__" + name,
access: [AStatic, APrivate],
kind: FVar(null, macro {
engine.ConVar.registerCCmd($v{name}, function(args:Array<String>) {
${f.expr};
});
}),
pos: pos,
doc: null,
meta: []
};
// Add the initializer field
fields.push(initField);
case _:
}
}
}
return fields;
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ import openfl.text.TextField;
import engine.ConVar; import engine.ConVar;
import engine.geom.Geom.P2d; import engine.geom.Geom.P2d;
enum abstract PaneLayout(Int) { @:enum abstract PaneLayout(Int) {
var HORIZONTAL = 0; var HORIZONTAL = 0;
var VERTICAL = 1; var VERTICAL = 1;
} }
+5 -4
View File
@@ -11,14 +11,15 @@ 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);
} }
@:command("mat_setvideomode")
public static function cCmdMatSetVideoMode(args:Array<String>){
Mode.setVideoMode(Std.parseInt(args[0]), Std.parseInt(args[1]), Std.parseInt(args[2]));
} }
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]));
});
public static function switchFsMode(toState:Int = 0){ public static function switchFsMode(toState:Int = 0){
if(toState == 0){ if(toState == 0){
if(Lib.current.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){ if(Lib.current.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){