Exemplo n.º 1
0
        static int _m_show(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                GameAlert gen_to_be_invoked = (GameAlert)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <System.Action>(L, 3) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4))
                {
                    string        _content    = LuaAPI.lua_tostring(L, 2);
                    System.Action _act        = translator.GetDelegate <System.Action>(L, 3);
                    bool          _needCancel = LuaAPI.lua_toboolean(L, 4);

                    gen_to_be_invoked.show(_content, _act, _needCancel);



                    return(0);
                }
                if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <System.Action>(L, 3))
                {
                    string        _content = LuaAPI.lua_tostring(L, 2);
                    System.Action _act     = translator.GetDelegate <System.Action>(L, 3);

                    gen_to_be_invoked.show(_content, _act);



                    return(0);
                }
                if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string _content = LuaAPI.lua_tostring(L, 2);

                    gen_to_be_invoked.show(_content);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to GameAlert.show!"));
        }