mirror of
https://github.com/edubart/otclient.git
synced 2025-10-21 23:05:54 +02:00
remake ui event system and reimplement line edit
This commit is contained in:
@@ -29,6 +29,7 @@ void LuaInterface::registerFunctions()
|
||||
g_lua.bindClassMemberFunction<UIWidget>("addAnchor", &UIWidget::addAnchor);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("getChild", &UIWidget::getChildById);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("addChild", &UIWidget::addChild);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("lock", &UIWidget::lock);
|
||||
|
||||
// UILabel
|
||||
g_lua.registerClass<UILabel, UIWidget>();
|
||||
|
@@ -53,17 +53,20 @@ private:
|
||||
|
||||
template<typename... T>
|
||||
int LuaObject::callLuaField(const std::string& field, const T&... args) {
|
||||
// note that the field must be retrieved from this object lua value
|
||||
// to force using the __index metamethod of it's metatable
|
||||
// so cannot use LuaObject::getField here
|
||||
// push field
|
||||
g_lua.pushObject(asLuaObject());
|
||||
g_lua.getField(field);
|
||||
if(m_fieldsTableRef != -1) {
|
||||
// note that the field must be retrieved from this object lua value
|
||||
// to force using the __index metamethod of it's metatable
|
||||
// so cannot use LuaObject::getField here
|
||||
// push field
|
||||
g_lua.pushObject(asLuaObject());
|
||||
g_lua.getField(field);
|
||||
|
||||
// the first argument is always this object (self)
|
||||
g_lua.insert(-2);
|
||||
g_lua.polymorphicPush(args...);
|
||||
return g_lua.protectedCall(1 + sizeof...(args));
|
||||
// the first argument is always this object (self)
|
||||
g_lua.insert(-2);
|
||||
g_lua.polymorphicPush(args...);
|
||||
return g_lua.protectedCall(1 + sizeof...(args));
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
Reference in New Issue
Block a user