From 0549b1e5a8a3132005e275d6026db8003cb067d2 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 26 Oct 2021 11:32:46 +0800 Subject: *rename folder --- Data/Scripts/Editor/AssetBrowser.lua | 28 ++++++++++ Data/Scripts/Editor/Properties.lua | 4 ++ Data/Scripts/EditorApplication.lua | 71 ++++++++++++++++++++++++++ Data/Scripts/EditorGUI/EditorImages.lua | 2 + Data/Scripts/EditorGUI/EditorWindowManager.lua | 5 ++ Data/Scripts/Utils/Utils.lua | 4 ++ 6 files changed, 114 insertions(+) create mode 100644 Data/Scripts/Editor/AssetBrowser.lua create mode 100644 Data/Scripts/Editor/Properties.lua create mode 100644 Data/Scripts/EditorApplication.lua create mode 100644 Data/Scripts/EditorGUI/EditorImages.lua create mode 100644 Data/Scripts/EditorGUI/EditorWindowManager.lua create mode 100644 Data/Scripts/Utils/Utils.lua (limited to 'Data/Scripts') diff --git a/Data/Scripts/Editor/AssetBrowser.lua b/Data/Scripts/Editor/AssetBrowser.lua new file mode 100644 index 0000000..e6e4a4a --- /dev/null +++ b/Data/Scripts/Editor/AssetBrowser.lua @@ -0,0 +1,28 @@ +local Debug = GameLab.Debug +local AssetBrowser = GameLab.Editor.GUI.EditorWindow.Extend("GameLab.Editor.AssetBrowser") +local GL = GameLab.Engine.GL +local Matrix44 = GameLab.Engine.Math.Matrix44 +local inspect = require("inspect") + +AssetBrowser.Ctor = function(self) + self.base.Ctor(self, "AssetBrowser") +end + +AssetBrowser.OnGUI = function(self) + Debug.Log("AssetBrowser.OnGUI()") + GL.ClearColor({0,0,0,1}) + GL.Clear(GL.EBufferType.ColorBuffer) + GL.Color({1,1,0,1}) + GL.LoadPixelMatrix(-250, 250, -300, 300) + GL.Begin(GL.EPrimitiveType.Triangles) + GL.Vertex({0,0,-1}) + GL.Vertex({0,300,-1}) + GL.Vertex({250,0,-1}) + GL.End() +end + +AssetBrowser.OnFocus = function(self) + +end + +return AssetBrowser \ No newline at end of file diff --git a/Data/Scripts/Editor/Properties.lua b/Data/Scripts/Editor/Properties.lua new file mode 100644 index 0000000..864f17e --- /dev/null +++ b/Data/Scripts/Editor/Properties.lua @@ -0,0 +1,4 @@ +-- 属性检查器properties + + + diff --git a/Data/Scripts/EditorApplication.lua b/Data/Scripts/EditorApplication.lua new file mode 100644 index 0000000..d9f8b1f --- /dev/null +++ b/Data/Scripts/EditorApplication.lua @@ -0,0 +1,71 @@ +local json = require "LiteJson.json" +local inspect = require "inspect" +local AssetBrowser = require "./Scripts/Editor/AssetBrowser" +local EditorWindowManager = require "./Scripts/EditorGUI/EditorWindowManager" + +local Rendering = GameLab.Engine.Rendering +local Debug = GameLab.Debug +local GUI = GameLab.Editor.GUI +local GL = GameLab.Engine.GL + +local app = GameLab.Editor.EditorApplication.New() + +if app == nil then + Debug.LogError("app is nil") +end + +local mainWindow = GUI.ContainerWindow.New({400, 400, 800, 500}, GUI.EShowMode.MainWindow, {100, 100}, {700, 700}) +mainWindow:SetTitle("GameLab") +mainWindow:SetIcon("./Data/Icon/GameLab.ico") + +app:SetMainWindow(mainWindow) + +local guiWindow = GUI.GUIWindow.New() +guiWindow:SetContainerWindow(mainWindow) +guiWindow:SetPosition({0,0, 500, 400}) + +collectgarbage() + +Debug.Log(GameLab.Path.GetRootDirectory()) + +Debug.Log(inspect{foo=1,2,3,4}) + +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)) + +Debug.Log(EditorWindowManager.name) + +local c = Rendering.Color.New(1,1,1,1) +Debug.Log(inspect(c)) + +Debug.Log(inspect(GL.EBufferType)) + +GL.ClearColor({1,1,1,1}) +GL.Clear(GL.EBufferType.ColorBuffer) + +local files = { + "README.txt", + "README.txt", + "README.txt", + "README.txt", + "README.txt", + "README.txt", + "README.txt", + "README.txt", + "README.txt", +} + +GameLab.IO.ReadFilesAsync(files, function() + Debug.Log("finished") +end) + +while true do + + app:OnStep() + app:PullMessage() + +end \ No newline at end of file diff --git a/Data/Scripts/EditorGUI/EditorImages.lua b/Data/Scripts/EditorGUI/EditorImages.lua new file mode 100644 index 0000000..e98d064 --- /dev/null +++ b/Data/Scripts/EditorGUI/EditorImages.lua @@ -0,0 +1,2 @@ +-- 编辑器图片资源 + diff --git a/Data/Scripts/EditorGUI/EditorWindowManager.lua b/Data/Scripts/EditorGUI/EditorWindowManager.lua new file mode 100644 index 0000000..707038b --- /dev/null +++ b/Data/Scripts/EditorGUI/EditorWindowManager.lua @@ -0,0 +1,5 @@ +local EditorWindowManager = {} + +EditorWindowManager.name = "asd" + +return EditorWindowManager \ No newline at end of file diff --git a/Data/Scripts/Utils/Utils.lua b/Data/Scripts/Utils/Utils.lua new file mode 100644 index 0000000..678217b --- /dev/null +++ b/Data/Scripts/Utils/Utils.lua @@ -0,0 +1,4 @@ +local Utils = GameLab.Editor.Utils or {} +GameLab.Editor.Utils = Utils + + -- cgit v1.1-26-g67d0