summaryrefslogtreecommitdiff
path: root/Resources
diff options
context:
space:
mode:
Diffstat (limited to 'Resources')
-rw-r--r--Resources/DefaultContent/Libraries/GameLab/Class.lua2
-rw-r--r--Resources/Libraries/GameLab/Editor/GUI/EditorWindow.lua7
-rw-r--r--Resources/Scripts/Editor/AssetBrowser.lua16
-rw-r--r--Resources/Scripts/Editor/ProjectWindow.lua20
-rw-r--r--Resources/Scripts/EditorApplication.lua13
-rw-r--r--Resources/Scripts/EditorGUI/EditorWindowManager.lua5
6 files changed, 36 insertions, 27 deletions
diff --git a/Resources/DefaultContent/Libraries/GameLab/Class.lua b/Resources/DefaultContent/Libraries/GameLab/Class.lua
index 8f74d10..cb08449 100644
--- a/Resources/DefaultContent/Libraries/GameLab/Class.lua
+++ b/Resources/DefaultContent/Libraries/GameLab/Class.lua
@@ -21,7 +21,7 @@ local Class = function(className, pkg)
local child = _class(childName, childPkg)
if cls then
setmetatable(child, cls)
- child._base = cls
+ child.base = cls
end
return child
end
diff --git a/Resources/Libraries/GameLab/Editor/GUI/EditorWindow.lua b/Resources/Libraries/GameLab/Editor/GUI/EditorWindow.lua
index 2ec7f95..5b1b140 100644
--- a/Resources/Libraries/GameLab/Editor/GUI/EditorWindow.lua
+++ b/Resources/Libraries/GameLab/Editor/GUI/EditorWindow.lua
@@ -1,6 +1,8 @@
local EditorWindow = GameLab.Class("EditorWindow", "GameLab.Editor.GUI")
-EditorWindow.Ctor = function(self)
+EditorWindow.Ctor = function(self, title)
+ self.title = title
+ self.guiWindow = nil
end
EditorWindow.OnGUI = function(self)
@@ -15,4 +17,7 @@ end
EditorWindow.OnStop = function(self)
end
+EditorWindow.OnFocus = function(self)
+end
+
return EditorWindow \ No newline at end of file
diff --git a/Resources/Scripts/Editor/AssetBrowser.lua b/Resources/Scripts/Editor/AssetBrowser.lua
new file mode 100644
index 0000000..07cead4
--- /dev/null
+++ b/Resources/Scripts/Editor/AssetBrowser.lua
@@ -0,0 +1,16 @@
+local Debug = GameLab.Debug
+local AssetBrowser = GameLab.Editor.GUI.EditorWindow.Extend("AssetBrowser", "GameLab.Editor")
+
+AssetBrowser.Ctor = function(self)
+ self.base.Ctor(self, "AssetBrowser")
+end
+
+AssetBrowser.OnGUI = function(self)
+ Debug.Log("AssetBrowser.OnGUI()" .. self.title)
+end
+
+AssetBrowser.OnFocus = function(self)
+ Debug.Log("AssetBrowser.OnFocus()" .. self.title)
+end
+
+return AssetBrowser \ No newline at end of file
diff --git a/Resources/Scripts/Editor/ProjectWindow.lua b/Resources/Scripts/Editor/ProjectWindow.lua
deleted file mode 100644
index ffa9ef8..0000000
--- a/Resources/Scripts/Editor/ProjectWindow.lua
+++ /dev/null
@@ -1,20 +0,0 @@
-local GUI = GameLab.Editor.GUI
-local GUILayout = GameLab.Editor.GUILayout
-
-local ProjectWindow = {
- ["name"] = "Project",
-}
-
-ProjectWindow.OnGUI = function(self)
- if GUILayout.Button("click") then
-
- end
-end
-
-ProjectWindow.OnUpdate = function(self)
-
-end
-
-GUI.RegisterEditorWindow("Project", ProjectWindow, "Custom/Project")
-
-
diff --git a/Resources/Scripts/EditorApplication.lua b/Resources/Scripts/EditorApplication.lua
index f09a197..8a175db 100644
--- a/Resources/Scripts/EditorApplication.lua
+++ b/Resources/Scripts/EditorApplication.lua
@@ -1,5 +1,7 @@
local json = require "LiteJson.json"
local inspect = require "inspect"
+local AssetBrowser = require "./Scripts/Editor/AssetBrowser"
+local EditorWindowManager = require "./Scripts/EditorGUI/EditorWindowManager"
local Debug = GameLab.Debug
local GUI = GameLab.Editor.GUI
@@ -17,10 +19,8 @@ mainWindow:SetIcon("./Icon/GameLab.ico")
app:SetMainWindow(mainWindow)
local guiWindow = GUI.GUIWindow.New()
---guiWindow:SetContainerWindow(mainWindow)
---guiWindow:SetPosition({0,0, 500, 400})
-guiWindow.a = 10
-guiWindow = nil
+guiWindow:SetContainerWindow(mainWindow)
+guiWindow:SetPosition({0,0, 500, 400})
collectgarbage()
@@ -28,14 +28,17 @@ Debug.Log(GameLab.Path.GetRootDirectory())
Debug.Log(inspect{foo=1,2,3,4})
-local wnd = GUI.EditorWindow.New()
+local wnd = AssetBrowser.New()
Debug.Log(inspect(mainWindow._type))
+guiWindow:SetInstance(wnd)
local v = GameLab.Engine.Math.Vector4.New(1,2,3,4)
Debug.Log(inspect(v))
local V4 = GameLab.Engine.Math.Vector4.Extend("V4", "GameLab.Engine.Math")
+Debug.Log(EditorWindowManager.name)
+
while true do
app:PullMessage()
diff --git a/Resources/Scripts/EditorGUI/EditorWindowManager.lua b/Resources/Scripts/EditorGUI/EditorWindowManager.lua
new file mode 100644
index 0000000..707038b
--- /dev/null
+++ b/Resources/Scripts/EditorGUI/EditorWindowManager.lua
@@ -0,0 +1,5 @@
+local EditorWindowManager = {}
+
+EditorWindowManager.name = "asd"
+
+return EditorWindowManager \ No newline at end of file