-
-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Luabind: Force correct order of loading of CUIScriptWnd depen…
…dencies and remove wrapper that doesn't do anything" This reverts commit 331b084.
- Loading branch information
1 parent
89393a9
commit d8819b0
Showing
3 changed files
with
78 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
template <typename T> | ||
struct CWrapperBase : public T, public luabind::wrap_base | ||
{ | ||
typedef T inherited; | ||
typedef CWrapperBase<T> self_type; | ||
|
||
virtual bool OnKeyboardAction(int dik, EUIMessages keyboard_action) | ||
{ | ||
return luabind::call_member<bool>(this, "OnKeyboard", dik, keyboard_action); | ||
} | ||
static bool OnKeyboard_static(inherited* ptr, int dik, EUIMessages keyboard_action) | ||
{ | ||
return ptr->self_type::inherited::OnKeyboardAction(dik, keyboard_action); | ||
} | ||
|
||
virtual void Update() { luabind::call_member<void>(this, "Update"); } | ||
static void Update_static(inherited* ptr) { ptr->self_type::inherited::Update(); } | ||
virtual bool Dispatch(int cmd, int param) { return luabind::call_member<bool>(this, "Dispatch", cmd, param); } | ||
static bool Dispatch_static(inherited* ptr, int cmd, int param) | ||
{ | ||
return ptr->self_type::inherited::Dispatch(cmd, param); | ||
} | ||
}; | ||
|
||
typedef CWrapperBase<CUIDialogWndEx> WrapType; | ||
typedef CUIDialogWndEx BaseType; | ||
|
||
typedef luabind::class_<CUIDialogWndEx, luabind::bases<CUIDialogWnd, IFactoryObject>, luabind::default_holder, WrapType> | ||
export_class; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "pch_script.h" | ||
|
||
// UI-controls | ||
|
||
#include "UIScriptWnd.h" | ||
#include "xrUICore/Buttons/UIButton.h" | ||
#include "xrUICore/MessageBox/UIMessageBox.h" | ||
#include "xrUICore/PropertiesBox/UIPropertiesBox.h" | ||
#include "xrUICore/Buttons/UICheckButton.h" | ||
#include "xrUICore/Buttons/UIRadioButton.h" | ||
#include "xrUICore/Static/UIStatic.h" | ||
#include "xrUICore/EditBox/UIEditBox.h" | ||
#include "xrUICore/Windows/UIFrameWindow.h" | ||
#include "xrUICore/Windows/UIFrameLineWnd.h" | ||
#include "xrUICore/ProgressBar/UIProgressBar.h" | ||
#include "xrUICore/TabControl/UITabControl.h" | ||
|
||
#include "uiscriptwnd_script.h" | ||
|
||
using namespace luabind; | ||
|
||
#pragma optimize("s", on) | ||
export_class& script_register_ui_window2(export_class& instance) | ||
{ | ||
instance.def("OnKeyboard", &BaseType::OnKeyboardAction, &WrapType::OnKeyboard_static) | ||
.def("Update", &BaseType::Update, &WrapType::Update_static) | ||
.def("Dispatch", &BaseType::Dispatch, &WrapType::Dispatch_static) | ||
|
||
; | ||
return (instance); | ||
} |