Browse Source

Fixed the Lua binding of UIElement::GetParent() to return the proper type.

Lasse Öörni 11 years ago
parent
commit
2e212023fb
1 changed files with 32 additions and 0 deletions
  1. 32 0
      Source/Engine/LuaScript/pkgs/UI/UIElement.pkg

+ 32 - 0
Source/Engine/LuaScript/pkgs/UI/UIElement.pkg

@@ -410,6 +410,38 @@ tolua_lerror:
  return tolua_UILuaAPI_UIElement_GetChild00(tolua_S);
 }
 
+// Disable generated GetParent function */
+#define TOLUA_DISABLE_tolua_UILuaAPI_UIElement_GetParent00
+
+static int tolua_UILuaAPI_UIElement_GetParent00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+ !tolua_isusertype(tolua_S,1,"const UIElement",0,&tolua_err) ||
+ !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+ goto tolua_lerror;
+ else
+#endif
+ {
+  const UIElement* self = (const UIElement*)  tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+ if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetParent'", NULL);
+#endif
+ {
+  UIElement* tolua_ret = (UIElement*)  self->GetParent();
+  tolua_pushusertype(tolua_S,(void*)tolua_ret, tolua_ret ? tolua_ret->GetTypeName().CString() : "UIElement");
+ }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'GetParent'.",&tolua_err);
+ return 0;
+#endif
+}
+
 #define GetStyle GetAppliedStyle
 #define SetColorAttr SetColor
 $}