Skip to content

Commit 331b084

Browse files
Zegerieagleivg
authored andcommitted
Luabind: Force correct order of loading of CUIScriptWnd dependencies and remove wrapper that doesn't do anything
1 parent 38435f9 commit 331b084

File tree

3 files changed

+10
-78
lines changed

3 files changed

+10
-78
lines changed

src/xrGame/ui/UIScriptWnd_script.cpp

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,20 @@
22

33
// UI-controls
44
#include "UIScriptWnd.h"
5-
#include "uiscriptwnd_script.h"
65
#include "xrScriptEngine/ScriptExporter.hpp"
76
#include "xrScriptEngine/Functor.hpp"
87

98
using namespace luabind;
109

11-
extern export_class& script_register_ui_window1(export_class&);
12-
extern export_class& script_register_ui_window2(export_class&);
13-
14-
SCRIPT_EXPORT(CUIDialogWndEx, (), {
15-
export_class instance("CUIScriptWnd");
16-
17-
module(luaState)[script_register_ui_window2(script_register_ui_window1(instance)).def("Load", &BaseType::Load)];
10+
SCRIPT_EXPORT(CUIDialogWndEx, (CUIDialogWnd, IFactoryObject), {
11+
module(luaState)[class_<CUIDialogWndEx, bases<CUIDialogWnd, IFactoryObject>>("CUIScriptWnd")
12+
.def("OnKeyboard", &CUIDialogWndEx::OnKeyboardAction)
13+
.def("Update", &CUIDialogWndEx::Update)
14+
.def("Dispatch", &CUIDialogWndEx::Dispatch)
15+
.def("AddCallback", (void (CUIDialogWndEx::*)(LPCSTR, s16, const functor<void>&, const object&)) &
16+
CUIDialogWndEx::AddCallback)
17+
.def("Register", (void (CUIDialogWndEx::*)(CUIWindow*, LPCSTR)) &CUIDialogWndEx::Register)
18+
.def("Load", &CUIDialogWndEx::Load)
19+
];
1820
});
1921

20-
export_class& script_register_ui_window1(export_class& instance)
21-
{
22-
instance.def(constructor<>())
23-
.def("AddCallback", (void (BaseType::*)(LPCSTR, s16, const luabind::functor<void>&, const luabind::object&)) &
24-
BaseType::AddCallback)
25-
.def("Register", (void (BaseType::*)(CUIWindow*, LPCSTR)) & BaseType::Register);
26-
return (instance);
27-
}

src/xrGame/ui/uiscriptwnd_script.h

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/xrGame/ui/uiscriptwnd_script2.cpp

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)