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 --- Runtime/Events/InputEvent.cpp | 4 ++++ Runtime/Lua/LuaBind/LuaBindInvoker.cpp | 2 ++ Runtime/Scripting/RuntimeScriptGlobals.cpp | 5 +++++ Runtime/Scripting/RuntimeScriptGlobals.h | 5 +++++ 4 files changed, 16 insertions(+) (limited to 'Runtime') diff --git a/Runtime/Events/InputEvent.cpp b/Runtime/Events/InputEvent.cpp index c5994ef..07d8778 100644 --- a/Runtime/Events/InputEvent.cpp +++ b/Runtime/Events/InputEvent.cpp @@ -249,6 +249,10 @@ void InputEvent::CastToTable(LuaBind::State& state) const lua_pushnumber(state, type); lua_setfield(state, table, "type"); + // "used" + lua_pushboolean(state, use); + lua_setfield(state, table, "use"); + // "mousePosition" state.PushLuaObject(mousePosition); lua_setfield(state, table, "mousePosition"); diff --git a/Runtime/Lua/LuaBind/LuaBindInvoker.cpp b/Runtime/Lua/LuaBind/LuaBindInvoker.cpp index d6780d7..90ab078 100644 --- a/Runtime/Lua/LuaBind/LuaBindInvoker.cpp +++ b/Runtime/Lua/LuaBind/LuaBindInvoker.cpp @@ -106,6 +106,8 @@ namespace LuaBind lua_replace(state, -2); lua_insert(state, -1 - argc); state.Call(argc, nReturns); + + argc = 0; } } \ No newline at end of file diff --git a/Runtime/Scripting/RuntimeScriptGlobals.cpp b/Runtime/Scripting/RuntimeScriptGlobals.cpp index 5f140a1..bb3139c 100644 --- a/Runtime/Scripting/RuntimeScriptGlobals.cpp +++ b/Runtime/Scripting/RuntimeScriptGlobals.cpp @@ -6,5 +6,10 @@ namespace Scripting void FillRuntimeScriptGlobals(RuntimeScriptGlobals& globals) { globals.setCurrentEvent = "GameLab.Events.Event.SetCurrentEvent"; + + globals.guiBeginFrame = "GameLab.Engine.GUI.BeginFrame"; + globals.guiEndFrame = "GameLab.Engine.GUI.EndFrame"; + globals.guiBeginOnGUI = "GameLab.Engine.GUI.BeginOnGUI"; + globals.guiEndOnGUI = "GameLab.Engine.GUI.EndOnGUI"; } } \ No newline at end of file diff --git a/Runtime/Scripting/RuntimeScriptGlobals.h b/Runtime/Scripting/RuntimeScriptGlobals.h index 76448a9..e6e6347 100644 --- a/Runtime/Scripting/RuntimeScriptGlobals.h +++ b/Runtime/Scripting/RuntimeScriptGlobals.h @@ -13,6 +13,11 @@ struct RuntimeScriptGlobals { DECL_LUA_FUNC(setCurrentEvent); + + DECL_LUA_FUNC(guiBeginFrame); + DECL_LUA_FUNC(guiEndFrame); + DECL_LUA_FUNC(guiBeginOnGUI); + DECL_LUA_FUNC(guiEndOnGUI); }; namespace Scripting -- cgit v1.1-26-g67d0