diff options
author | chai <chaifix@163.com> | 2021-10-23 00:31:25 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-23 00:31:25 +0800 |
commit | df0444f85f9bf623cc886e1632e624ef20cb0f1b (patch) | |
tree | 4aff1454312540f137bb318349b48e58d9b06d80 /Editor | |
parent | 4dafefe46a72ba47468b13d011f8299055081b0f (diff) |
-member table
Diffstat (limited to 'Editor')
-rw-r--r-- | Editor/EditorApplication.h | 2 | ||||
-rw-r--r-- | Editor/EditorMain.cpp | 4 | ||||
-rw-r--r-- | Editor/GUI/EditorWindows.h | 7 | ||||
-rw-r--r-- | Editor/GUI/GUIWindow.cpp | 2 | ||||
-rw-r--r-- | Editor/Scripting/Editor/Editor.bind.cpp | 2 | ||||
-rw-r--r-- | Editor/Scripting/EditorGUI/EditorGUI.bind.cpp | 4 |
6 files changed, 10 insertions, 11 deletions
diff --git a/Editor/EditorApplication.h b/Editor/EditorApplication.h index 25661a1..1b464e8 100644 --- a/Editor/EditorApplication.h +++ b/Editor/EditorApplication.h @@ -20,7 +20,7 @@ public: private :
- LUA_BIND_DECL_FACTORY(EditorApplication);
+ LUA_BIND_DECL_CLASS(EditorApplication);
LUA_BIND_DECL_METHOD(_New);
LUA_BIND_DECL_METHOD(_SetMainWindow);
diff --git a/Editor/EditorMain.cpp b/Editor/EditorMain.cpp index 95937a7..7ca90ad 100644 --- a/Editor/EditorMain.cpp +++ b/Editor/EditorMain.cpp @@ -15,7 +15,7 @@ void ErrorHandle(cc8* msg) log_error(std::string("[Lua] ") + msg);
}
-void OnRegisterFactoryClass(LuaBind::State& state, int cls, std::string clsName, std::string pkgName)
+void OnRegisterNativeClass(LuaBind::State& state, int cls, std::string clsName, std::string pkgName)
{
// 填充类型的元数据
lua_newtable(state);
@@ -35,7 +35,7 @@ void InitLuaState() vm.Setup();
vm.OpenLibs();
- LuaBind::onRegisterFactoryClass = OnRegisterFactoryClass;
+ LuaBind::onRegisterNativeClass = OnRegisterNativeClass;
if (!SetupGameLabEditorScripting(vm.GetMainThread()))
{
diff --git a/Editor/GUI/EditorWindows.h b/Editor/GUI/EditorWindows.h index d9805a0..a25b612 100644 --- a/Editor/GUI/EditorWindows.h +++ b/Editor/GUI/EditorWindows.h @@ -89,7 +89,7 @@ private: POINT m_MinSize; POINT m_MaxSize; - LUA_BIND_DECL_FACTORY(ContainerWindow); + LUA_BIND_DECL_CLASS(ContainerWindow); LUA_BIND_DECL_METHOD(_New); LUA_BIND_DECL_METHOD(_SetTitle); @@ -161,12 +161,11 @@ private: HDC m_DC; HGLRC m_RC; - LuaBind::Ref m_Instance; // EditorWindow脚本 + LuaBind::MemberRef m_Instance; // EditorWindow脚本 - LUA_BIND_DECL_FACTORY(GUIWindow); + LUA_BIND_DECL_CLASS(GUIWindow); LUA_BIND_DECL_METHOD(_New); - LUA_BIND_DECL_METHOD(_GC); LUA_BIND_DECL_METHOD(_DoPaint); LUA_BIND_DECL_METHOD(_Focus); LUA_BIND_DECL_METHOD(_SetContainerWindow); diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp index 8918ad3..2127232 100644 --- a/Editor/GUI/GUIWindow.cpp +++ b/Editor/GUI/GUIWindow.cpp @@ -176,7 +176,7 @@ void GUIWindow::RepaintAll() GUIWindow::GUIWindow(LuaBind::VM* vm) : LuaBind::NativeClass<GUIWindow>(vm) - , m_Instance(vm, Ref::STRONG_REF) + , m_Instance() { } diff --git a/Editor/Scripting/Editor/Editor.bind.cpp b/Editor/Scripting/Editor/Editor.bind.cpp index 2300d2f..9808141 100644 --- a/Editor/Scripting/Editor/Editor.bind.cpp +++ b/Editor/Scripting/Editor/Editor.bind.cpp @@ -11,7 +11,7 @@ int luaopen_GameLab_Editor(lua_State* L) state.PushNamespace("GameLab"); state.PushNamespace("Editor"); - state.RegisterFactory<EditorApplication>(); + state.RegisterNativeClass<EditorApplication>(); return 1; }
\ No newline at end of file diff --git a/Editor/Scripting/EditorGUI/EditorGUI.bind.cpp b/Editor/Scripting/EditorGUI/EditorGUI.bind.cpp index 0f30276..2fea6be 100644 --- a/Editor/Scripting/EditorGUI/EditorGUI.bind.cpp +++ b/Editor/Scripting/EditorGUI/EditorGUI.bind.cpp @@ -12,8 +12,8 @@ int luaopen_GameLab_Editor_GUI(lua_State* L) state.PushNamespace("Editor"); state.PushNamespace("GUI"); - state.RegisterFactory<ContainerWindow>(); - state.RegisterFactory<GUIWindow>(); + state.RegisterNativeClass<ContainerWindow>(); + state.RegisterNativeClass<GUIWindow>(); return 1; }
\ No newline at end of file |