diff options
author | chai <chaifix@163.com> | 2021-10-23 18:19:18 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-23 18:19:18 +0800 |
commit | 7bf672fd0c6211909d94078b448032b1bd0916ef (patch) | |
tree | 655b875b81ec8d0559ca905fb7d37a1d88e6a80d /Resources/Scripts | |
parent | df0444f85f9bf623cc886e1632e624ef20cb0f1b (diff) |
*misc
Diffstat (limited to 'Resources/Scripts')
-rw-r--r-- | Resources/Scripts/Editor/AssetBrowser.lua | 16 | ||||
-rw-r--r-- | Resources/Scripts/Editor/ProjectWindow.lua | 20 | ||||
-rw-r--r-- | Resources/Scripts/EditorApplication.lua | 13 | ||||
-rw-r--r-- | Resources/Scripts/EditorGUI/EditorWindowManager.lua | 5 |
4 files changed, 29 insertions, 25 deletions
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 |