summaryrefslogtreecommitdiff
path: root/Data
diff options
context:
space:
mode:
Diffstat (limited to 'Data')
-rw-r--r--Data/DefaultContent/Libraries/GameLab/Events/Event.lua8
-rw-r--r--Data/DefaultContent/Libraries/GameLab/GlobalTable.lua15
-rw-r--r--Data/DefaultContent/Libraries/GameLab/init.lua2
-rw-r--r--Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua4
-rw-r--r--Data/boot.lua1
5 files changed, 24 insertions, 6 deletions
diff --git a/Data/DefaultContent/Libraries/GameLab/Events/Event.lua b/Data/DefaultContent/Libraries/GameLab/Events/Event.lua
index 214d61e..f2940bc 100644
--- a/Data/DefaultContent/Libraries/GameLab/Events/Event.lua
+++ b/Data/DefaultContent/Libraries/GameLab/Events/Event.lua
@@ -1,7 +1,9 @@
-local Event = {}
-GameLab.Events.Event = Event
+local Debug = GameLab.Debug
+local inspect = require("inspect")
-Event.current = {}
+local Event = GameLab.GlobalTable("GameLab.Events.Event")
+
+Event.current = nil
Event.SetCurrentEvent = function(evt)
Event.current = evt
diff --git a/Data/DefaultContent/Libraries/GameLab/GlobalTable.lua b/Data/DefaultContent/Libraries/GameLab/GlobalTable.lua
new file mode 100644
index 0000000..10e3811
--- /dev/null
+++ b/Data/DefaultContent/Libraries/GameLab/GlobalTable.lua
@@ -0,0 +1,15 @@
+local GlobalTable = function(tbName)
+ local tb = {}
+
+ local shortName = string.match(tbName, "%.*(%w+)$")
+ local t = _G
+ for pkg in string.gmatch(tbName, "%.*(%w+)%.") do
+ t[pkg] = t[pkg] or {}
+ t = t[pkg]
+ end
+ t[shortName] = tb
+
+ return tb
+end
+
+return GlobalTable \ No newline at end of file
diff --git a/Data/DefaultContent/Libraries/GameLab/init.lua b/Data/DefaultContent/Libraries/GameLab/init.lua
index 8f61b05..df0e19a 100644
--- a/Data/DefaultContent/Libraries/GameLab/init.lua
+++ b/Data/DefaultContent/Libraries/GameLab/init.lua
@@ -29,4 +29,6 @@ GameLab.GlobalClass = require("GameLab.GlobalClass")
GameLab.Enum = require("GameLab.Enum")
GameLab.GlobalEnum = require("GameLab.GlobalEnum")
+GameLab.GlobalTable = require("GameLab.GlobalTable")
+
return GameLab \ No newline at end of file
diff --git a/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua b/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua
index 6fc2628..8165faa 100644
--- a/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua
+++ b/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua
@@ -44,10 +44,8 @@ end
GUIWindow.OnGUI = function(self)
self:ClearBackground()
-end
-GUIWindow.OnEvent = function(self, evt)
- Debug.Log("mousePos=" .. evt.mousePosition.x .. "," .. evt.mousePosition.y)
+
end
GUIWindow.GetContainerWindow = function(self)
diff --git a/Data/boot.lua b/Data/boot.lua
index 7b9dda0..6f583bc 100644
--- a/Data/boot.lua
+++ b/Data/boot.lua
@@ -24,6 +24,7 @@ end
-- load gamelab modules
require "GameLab"
+require "GameLab.Events"
require "GameLab.Engine"
require "GameLab.Engine.Math"
require "GameLab.Engine.Rendering"