From 0e0aa82ab2ebc9f15519cea710a52c5895690152 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 11 Nov 2021 18:27:36 +0800 Subject: * rename Editor.GUI to Editor.Window --- .../GameLab/Editor/GUI/ContainerWindow.lua | 20 ------- Data/Libraries/GameLab/Editor/GUI/FontManager.lua | 0 Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua | 65 -------------------- Data/Libraries/GameLab/Editor/GUI/IMGUI.lua | 10 ---- Data/Libraries/GameLab/Editor/GUI/SplitWindow.lua | 32 ---------- Data/Libraries/GameLab/Editor/GUI/init.lua | 9 --- .../GameLab/Editor/Window/ContainerWindow.lua | 20 +++++++ .../GameLab/Editor/Window/FontManager.lua | 0 Data/Libraries/GameLab/Editor/Window/GUIWindow.lua | 70 ++++++++++++++++++++++ .../GameLab/Editor/Window/SplitWindow.lua | 32 ++++++++++ Data/Libraries/GameLab/Editor/Window/init.lua | 9 +++ 11 files changed, 131 insertions(+), 136 deletions(-) delete mode 100644 Data/Libraries/GameLab/Editor/GUI/ContainerWindow.lua delete mode 100644 Data/Libraries/GameLab/Editor/GUI/FontManager.lua delete mode 100644 Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua delete mode 100644 Data/Libraries/GameLab/Editor/GUI/IMGUI.lua delete mode 100644 Data/Libraries/GameLab/Editor/GUI/SplitWindow.lua delete mode 100644 Data/Libraries/GameLab/Editor/GUI/init.lua create mode 100644 Data/Libraries/GameLab/Editor/Window/ContainerWindow.lua create mode 100644 Data/Libraries/GameLab/Editor/Window/FontManager.lua create mode 100644 Data/Libraries/GameLab/Editor/Window/GUIWindow.lua create mode 100644 Data/Libraries/GameLab/Editor/Window/SplitWindow.lua create mode 100644 Data/Libraries/GameLab/Editor/Window/init.lua (limited to 'Data/Libraries') diff --git a/Data/Libraries/GameLab/Editor/GUI/ContainerWindow.lua b/Data/Libraries/GameLab/Editor/GUI/ContainerWindow.lua deleted file mode 100644 index b270110..0000000 --- a/Data/Libraries/GameLab/Editor/GUI/ContainerWindow.lua +++ /dev/null @@ -1,20 +0,0 @@ -local NativeContainWidow = GameLab.Editor.GUI.Internal.ContainerWindow -local ContainerWindow = GameLab.GlobalClass("GameLab.Editor.GUI.ContainerWindow") - -ContainerWindow.Ctor = function(self, position, showMode, min, max) - self.m_Native = NativeContainWidow.New(position, showMode, min, max) -end - -ContainerWindow.SetTitle = function(self) - self.m_Native:SetTitle(self) -end - -ContainerWindow.SetIcon = function(self) - self.m_Native:SetIcon(self) -end - -ContainerWindow.GetNative = function(self) - return self.m_Native -end - -return ContainerWindow \ No newline at end of file diff --git a/Data/Libraries/GameLab/Editor/GUI/FontManager.lua b/Data/Libraries/GameLab/Editor/GUI/FontManager.lua deleted file mode 100644 index e69de29..0000000 diff --git a/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua b/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua deleted file mode 100644 index 8165faa..0000000 --- a/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua +++ /dev/null @@ -1,65 +0,0 @@ -local GUIWindow = GameLab.GlobalClass("GameLab.Editor.GUI.GUIWindow") -local NativeGUIWindow = GameLab.Editor.GUI.Internal.GUIWindow - -local inspect = require("inspect") - -local Debug = GameLab.Debug -local GL = GameLab.Engine.GL -local Math = GameLab.Engine.Math -local Rendering = GameLab.Engine.Rendering - -local Rect = Math.Rect - -local i = 0 -local col = { - {1, 0, 0, 1}, - {1, 1, 0, 1}, - {1, 0, 1, 1}, -} - -GUIWindow.Ctor = function(self) - self.m_Native = NativeGUIWindow.New(self) - self.m_ContainerWindow = nil - self.m_SplitWindow = nil -- parent window - self.m_Position = Rect.New(0,0,0,0) -- 在父窗口中的位置和大小 - self.m_EditorWindows = {} -- 编辑器脚本 - - i = i + 1 - self.m_ClearColor = col[i] -end - -GUIWindow.SetContainerWindow = function(self, containerWindow) - self.m_ContainerWindow = containerWindow - self.m_Native:SetContainerWindow(containerWindow:GetNative()) -end - -GUIWindow.SetPosition = function(self, pos) - self.m_Position:Set(pos) - self.m_Native:SetPosition(pos) -end - -GUIWindow.GetNative = function(self) - return self.m_Native -end - -GUIWindow.OnGUI = function(self) - self:ClearBackground() - - -end - -GUIWindow.GetContainerWindow = function(self) - return self.m_ContainerWindow -end - -GUIWindow.OnFocus = function(self) - Debug.Log("GUIWindow.OnFocus") -end - -GUIWindow.ClearBackground = function(self) - GL.ClearColor(self.m_ClearColor) - GL.Clear(GL.EBufferType.ColorBuffer) - -end - -return GUIWindow \ No newline at end of file diff --git a/Data/Libraries/GameLab/Editor/GUI/IMGUI.lua b/Data/Libraries/GameLab/Editor/GUI/IMGUI.lua deleted file mode 100644 index 334b569..0000000 --- a/Data/Libraries/GameLab/Editor/GUI/IMGUI.lua +++ /dev/null @@ -1,10 +0,0 @@ -local imgui = GameLab.Editor.GUI or {} -GameLab.Editor.GUI = imgui - -local Event = GameLab.Events.Event - -imgui.Button = function() - -end - -return imgui \ No newline at end of file diff --git a/Data/Libraries/GameLab/Editor/GUI/SplitWindow.lua b/Data/Libraries/GameLab/Editor/GUI/SplitWindow.lua deleted file mode 100644 index 214eed6..0000000 --- a/Data/Libraries/GameLab/Editor/GUI/SplitWindow.lua +++ /dev/null @@ -1,32 +0,0 @@ -local Splitter = GameLab.Class("GameLab.Editor.GUI.Internal.Splitter") - -Splitter.Ctor = function(self) - self.width = 10 -end - --- 抽象的窗口,用来处理布局 -local SplitWindow = GameLab.GlobalClass("GameLab.Editor.GUI.SplitWindow") - -local ESplitMode = GameLab.GlobalEnum("GameLab.Editor.GUI.ESplitMode", { - "Vertical", - "Horizontal" -}) - -SplitWindow.Ctor = function(self) - self.m_Splitter = {} - self.m_SplitMode = ESplitMode.Horizontal - self.m_GUIWindows = {} - self.m_Parent = nil -- 父节点也是一个split window - self.m_SubSplit = {} -- 子节点也是split windows -end - -SplitWindow.DoSplit = function(self) - -end - --- 返回guiWnd -SplitWindow.IndexOfGUIWindow = function(self, guiWnd) - -end - -return SplitWindow \ No newline at end of file diff --git a/Data/Libraries/GameLab/Editor/GUI/init.lua b/Data/Libraries/GameLab/Editor/GUI/init.lua deleted file mode 100644 index 5507a16..0000000 --- a/Data/Libraries/GameLab/Editor/GUI/init.lua +++ /dev/null @@ -1,9 +0,0 @@ -GameLab.Editor.GUI = GameLab.Editor.GUI or {} -local m = GameLab.Editor.GUI - -local import = GameLab.import(...) - -import("ContainerWindow") -import("GUIWindow") - -return m \ No newline at end of file diff --git a/Data/Libraries/GameLab/Editor/Window/ContainerWindow.lua b/Data/Libraries/GameLab/Editor/Window/ContainerWindow.lua new file mode 100644 index 0000000..2936101 --- /dev/null +++ b/Data/Libraries/GameLab/Editor/Window/ContainerWindow.lua @@ -0,0 +1,20 @@ +local NativeContainWidow = GameLab.Editor.Window.Internal.ContainerWindow +local ContainerWindow = GameLab.GlobalClass("GameLab.Editor.Window.ContainerWindow") + +ContainerWindow.Ctor = function(self, position, showMode, min, max) + self.m_Native = NativeContainWidow.New(position, showMode, min, max) +end + +ContainerWindow.SetTitle = function(self) + self.m_Native:SetTitle(self) +end + +ContainerWindow.SetIcon = function(self) + self.m_Native:SetIcon(self) +end + +ContainerWindow.GetNative = function(self) + return self.m_Native +end + +return ContainerWindow \ No newline at end of file diff --git a/Data/Libraries/GameLab/Editor/Window/FontManager.lua b/Data/Libraries/GameLab/Editor/Window/FontManager.lua new file mode 100644 index 0000000..e69de29 diff --git a/Data/Libraries/GameLab/Editor/Window/GUIWindow.lua b/Data/Libraries/GameLab/Editor/Window/GUIWindow.lua new file mode 100644 index 0000000..cb05518 --- /dev/null +++ b/Data/Libraries/GameLab/Editor/Window/GUIWindow.lua @@ -0,0 +1,70 @@ +local GUIWindow = GameLab.GlobalClass("GameLab.Editor.Window.GUIWindow") +local NativeGUIWindow = GameLab.Editor.Window.Internal.GUIWindow + +local inspect = require("inspect") + +local Debug = GameLab.Debug +local GL = GameLab.Engine.GL +local Math = GameLab.Engine.Math +local Rendering = GameLab.Engine.Rendering + +local Rect = Math.Rect +local Event = GameLab.Events.Event + +local i = 0 +local col = { + {1, 0, 0, 1}, + {1, 1, 0, 1}, + {1, 0, 1, 1}, +} + +GUIWindow.Ctor = function(self) + self.m_Native = NativeGUIWindow.New(self) + self.m_ContainerWindow = nil + self.m_SplitWindow = nil -- parent window + self.m_Position = Rect.New(0,0,0,0) -- 在父窗口中的位置和大小 + self.m_EditorWindows = {} -- 编辑器脚本 + + i = i + 1 + self.m_ClearColor = col[i] +end + +GUIWindow.SetContainerWindow = function(self, containerWindow) + self.m_ContainerWindow = containerWindow + self.m_Native:SetContainerWindow(containerWindow:GetNative()) +end + +GUIWindow.SetPosition = function(self, pos) + self.m_Position:Set(pos) + self.m_Native:SetPosition(pos) +end + +GUIWindow.GetNative = function(self) + return self.m_Native +end + +GUIWindow.OnGUI = function(self) + self:ClearBackground() + + local event = Event.current + + if self.m_SplitWindow then + self.m_SplitWindow:DoSplit(event) + end +end + +GUIWindow.GetContainerWindow = function(self) + return self.m_ContainerWindow +end + +GUIWindow.OnFocus = function(self) + Debug.Log("GUIWindow.OnFocus") +end + +GUIWindow.ClearBackground = function(self) + GL.ClearColor(self.m_ClearColor) + GL.Clear(GL.EBufferType.ColorBuffer) + +end + +return GUIWindow \ No newline at end of file diff --git a/Data/Libraries/GameLab/Editor/Window/SplitWindow.lua b/Data/Libraries/GameLab/Editor/Window/SplitWindow.lua new file mode 100644 index 0000000..f5d410c --- /dev/null +++ b/Data/Libraries/GameLab/Editor/Window/SplitWindow.lua @@ -0,0 +1,32 @@ +local Splitter = GameLab.Class("GameLab.Editor.Window.Internal.Splitter") + +Splitter.Ctor = function(self) + self.width = 10 +end + +-- 抽象的窗口,用来处理布局 +local SplitWindow = GameLab.GlobalClass("GameLab.Editor.Window.SplitWindow") + +local ESplitMode = GameLab.GlobalEnum("GameLab.Editor.Window.ESplitMode", { + "Vertical", + "Horizontal" +}) + +SplitWindow.Ctor = function(self) + self.m_Splitter = {} + self.m_SplitMode = ESplitMode.Horizontal + self.m_GUIWindows = {} + self.m_Parent = nil -- 父节点也是一个split window + self.m_SubSplit = {} -- 子节点也是split windows +end + +SplitWindow.DoSplit = function(self, event) + +end + +-- 返回guiWnd +SplitWindow.IndexOfGUIWindow = function(self, guiWnd) + +end + +return SplitWindow \ No newline at end of file diff --git a/Data/Libraries/GameLab/Editor/Window/init.lua b/Data/Libraries/GameLab/Editor/Window/init.lua new file mode 100644 index 0000000..07f2a92 --- /dev/null +++ b/Data/Libraries/GameLab/Editor/Window/init.lua @@ -0,0 +1,9 @@ +GameLab.Editor.Window = GameLab.Editor.Window or {} +local m = GameLab.Editor.Window + +local import = GameLab.import(...) + +import("ContainerWindow") +import("GUIWindow") + +return m \ No newline at end of file -- cgit v1.1-26-g67d0