From 73dc62da054cbc18afc694f803ebff7fe24f4eca Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 13 Nov 2021 17:29:45 +0800 Subject: * split --- Editor/Scripting/Window/ContainerWindow.bind.cpp | 39 ++++++++++++------------ 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'Editor/Scripting/Window/ContainerWindow.bind.cpp') diff --git a/Editor/Scripting/Window/ContainerWindow.bind.cpp b/Editor/Scripting/Window/ContainerWindow.bind.cpp index 5e7319b..f459c85 100644 --- a/Editor/Scripting/Window/ContainerWindow.bind.cpp +++ b/Editor/Scripting/Window/ContainerWindow.bind.cpp @@ -18,6 +18,26 @@ LUA_BIND_POSTPROCESS(ContainerWindow) { } +// self, position, showMode, min, max +LUA_BIND_IMPL_METHOD(ContainerWindow, ContainerWindow::_New) +{ + LUA_BIND_STATE(L, ContainerWindow); + LUA_BIND_CHECK(L, "TTNTT"); + + ContainerWindow* wnd = new ContainerWindow(state.GetVM()); + + wnd->SetMemberRef(state, wnd->m_Script, 1); + Rect rect = state.GetValue(2, Rect()); + int showMode = state.GetValue(3, 0); + Vector2 min = state.GetValue(4, Vector2(50, 50)); + Vector2 max = state.GetValue(5, Vector2(10000, 10000)); + + wnd->Init(rect, showMode, min, max); + wnd->PushUserdata(state); + + return 1; +} + LUA_BIND_IMPL_METHOD(ContainerWindow, _SetTitle) { LUA_BIND_PREPARE(L, ContainerWindow); @@ -53,22 +73,3 @@ LUA_BIND_IMPL_METHOD(ContainerWindow, _DoPaint) self->DoPaint(); return 0; } - -LUA_BIND_IMPL_METHOD(ContainerWindow, ContainerWindow::_New) -{ - LUA_BIND_STATE(L, ContainerWindow); - LUA_BIND_CHECK(L, "TNTT"); - - ContainerWindow* wnd = new ContainerWindow(state.GetVM()); - - Rect rect = state.GetValue(state, Rect()); - int showMode = state.GetValue(2, 0); - Vector2 min = state.GetValue(state, Vector2()); - Vector2 max = state.GetValue(state, Vector2()); - - wnd->Init(rect, showMode, min, max); - - wnd->PushUserdata(state); - - return 1; -} -- cgit v1.1-26-g67d0