public static Delegate UILabel_ModifierFunc(LuaFunction func) { UILabel.ModifierFunc d = (param0) => { int top = func.BeginPCall(); IntPtr L = func.GetLuaState(); LuaScriptMgr.Push(L, param0); func.PCall(top, 1); object[] objs = func.PopValues(top); func.EndPCall(top); return((string)objs[0]); }; return(d); }
static internal int checkDelegate(IntPtr l, int p, out UILabel.ModifierFunc ua) { int op = extractFunction(l, p); if (LuaDLL.lua_isnil(l, p)) { ua = null; return(op); } else if (LuaDLL.lua_isuserdata(l, p) == 1) { ua = (UILabel.ModifierFunc)checkObj(l, p); return(op); } LuaDelegate ld; checkType(l, -1, out ld); LuaDLL.lua_pop(l, 1); if (ld.d != null) { ua = (UILabel.ModifierFunc)ld.d; return(op); } l = LuaState.get(l).L; ua = (string a1) => { int error = pushTry(l); pushValue(l, a1); ld.pcall(1, error); string ret; checkType(l, error + 1, out ret); LuaDLL.lua_settop(l, error - 1); return(ret); }; ld.d = ua; return(op); }