|
|
- require("game.proto.111.Require111")
- require("game.luaState.LuaState")
- require("game.cheat.CheatInputView")
- require("game.cheat.CheatModel")
- require("game.cheat.CheatCameraView")
- require("game.cheat.CheatUICameraView")
- require("game.cheat.CheatPropertyView")
- require("game.cheat.CheatAccelerationView")
- require("game.cheat.CheatBloomView")
- require("game.cheat.CheatFXAAView")
- require("game.cheat.CheatFreeCameraView")
- require("game.cheat.CheatGreenScreenClickView")
- require("game.cheat.CheatHideSelectRoleViewClickView")
-
-
- CheatController = CheatController or BaseClass(BaseController)
- CheatController.FUNC_BTNS = {
- [1] = {name = "战士"},
- [2] = {name = "女枪"},
- [3] = {name = "刺客"},
- [4] = {name = "主教"},
- [5] = {name = "伙伴"},
- [6] = {name = "特效"},
- [7] = {name = "技能"},
- [8] = {name = "切换场景"},
- [9] = {name = "游戏状态"},
- }
-
- CheatController.SKILL_RES = {
- [1] = "zs_effect",
- [3] = "ck_effect",
- [4] = "fs_effect",
- }
-
- SceneIdTest =
- {
- [0] = 1001,
- [1] = 1002,
- }
-
- --场景测试资源
- SceneTest =
- {
- ZhanShiRole = "101010100",
- NvQiangRole = "101040100",
- ChiKeRole = "101030100",
- ZhuJiaoRole = "101050100",
- HuoBanRole = "20300200",
-
- HuoBanRWeapon = "model_weapon_r_2030020",
-
- ZhanShiLWeapon = "model_weapon_l_102010100",
- ZhanShiRWeapon = "model_weapon_r_102010100",
-
- NvQiangLWeapon = "model_weapon_l_102040100",
- NvQiangRWeapon = "model_weapon_r_102040100",
- NvQiangBWeapon = "model_weapon_b_102040100",
-
- CiKeRWeapon = "model_weapon_r_102030100",
- CiKeLWeapon = "model_weapon_l_102030100",
-
- ZhuJiaoRWeapon = "model_weapon_r_102050100",
- }
-
- CheatController.ZHANSHI_BTNS = {
- [1] = {name = "带盾连击",action = {"attack","attack2","attack3","attack4","attack5"},dun = true},
- [2] = {name = "不带盾连击",action = {"attack6","attack7","attack8","attack20"}},
- [3] = {name = "冲撞不带盾",action = {"attack9","attack10","attack11"}},
- [4] = {name = "冲撞带盾",action = {"attack12","attack13","attack14"},dun = true},
- [5] = {name = "砸地",action = {"attack15"}},
- [6] = {name = "反刺盾",action = {"attack16"}},
- [7] = {name = "嘲讽",action = {"attack17"}},
- [8] = {name = "跳跃带盾",action = {"jump","jump2","jump3"},dun = true},
- [9] = {name = "跳跃不带盾",action = {"jump4","jump5","jump6"}},
- [10] = {name = "战斗待机带盾",action = {"idle"},dun = true},
- [11] = {name = "战斗待机没盾",action = {"idle2"}},
- [12] = {name = "休闲带盾",action = {"casual"},dun = true},
- [13] = {name = "跑带盾",action = {"run"},dun = true},
- [14] = {name = "跑不带盾",action = {"run2"}},
- [15] = {name = "受击带盾",action = {"hited"},dun = true},
- [16] = {name = "受击不带盾",action = {"hited2"}},
- [17] = {name = "走路带盾",action = {"walk"},dun = true},
- [18] = {name = "死亡带盾",action = {"death"},dun = true},
- [19] = {name = "死亡不带盾",action = {"death2"}},
- [20] = {name = "眩晕带盾",action = {"dizzy"},dun = true},
- [21] = {name = "眩晕不带盾",action = {"dizzy2"}},
- [22] = {name = "倒地带盾",action = {"down"},dun = true},
- [23] = {name = "倒地不带盾",action = {"down2"}},
- [24] = {name = "起身带盾",action = {"rise"},dun = true},
- [25] = {name = "起身不带盾",action = {"rise2"}},
- [26] = {name = "打坐不带盾",action = {"sit4","sit5","sit6"}},
- [27] = {name = "打坐带盾",action = {"sit","sit2","sit3"},dun = true},
- [28] = {name = "休闲不带盾",action = {"casual2"}},
- }
-
- CheatController.CHANGE_SCENE_BTNS = {
- [1] = {id = 1000,name = "小酒馆"},
- [2] = {id = 1001,name = "罗赛岛"},
- [3] = {id = 1002,name = "洛兰王国"},
- [4] = {id = 1003,name = "珊瑚树海"},
- [5] = {id = 1004,name = "暮雪平原"},
- }
-
- CheatController.ZHUJIAO_BTNS = {
- [1] = {name = "待机",action = {"idle"}},
- [2] = {name = "休闲",action = {"casual"}},
- [3] = {name = "跑",action = {"run"}},
- [4] = {name = "跳跃",action = {"jump","jump2","jump3"}},
- [5] = {name = "受击",action = {"hited"}},
- [16] = {name = "走路",action = {"walk"}},
- [6] = {name = "死亡",action = {"death"}},
- [7] = {name = "打坐",action = {"sit"},noweapon = true},
- [8] = {name = "眩晕",action = {"dizzy"}},
- [9] = {name = "倒地",action = {"down"}},
- [10] = {name = "起身",action = {"rise"}},
- [11] = {name = "连击",action = {"attack","attack2","attack3","attack4"}},
- [12] = {name = "治愈法阵",action = {"attack5"}},
- [13] = {name = "治愈",action = {"attack6"}},
- [14] = {name = "火球术",action = {"attack7"}},
- [15] = {name = "天堂审判",action = {"attack8"}},
- }
-
- CheatController.CHIKE_BTNS = {
- [1] = {name = "待机",action = {"idle"},weapon = true},
- [2] = {name = "休闲",action = {"casual"},weapon = true},
- [3] = {name = "跑",action = {"run"},weapon = true},
- [4] = {name = "跳跃",action = {"jump","jump2","jump3"},weapon = true},
- [5] = {name = "受击",action = {"hited"},weapon = true},
- [16] = {name = "走路",action = {"walk"}},
- [6] = {name = "死亡",action = {"death"},weapon = true},
- [7] = {name = "打坐",action = {"sit","sit2","sit3"}},
- [8] = {name = "眩晕",action = {"dizzy"},weapon = true},
- [9] = {name = "倒地",action = {"down"},weapon = true},
- [10] = {name = "起身",action = {"rise"},weapon = true},
- [11] = {name = "连击技能",action = {"attack","attack2","attack3","attack4","attack5","attack6"},weapon = true},
- [12] = {name = "隐身技能",action = {"attack7"},weapon = true},
- [13] = {name = "黑球缠绕技能",action = {"attack8"},weapon = true},
- [14] = {name = "分身技能",action = {"attack9","attack10","attack11"},weapon = true},
- [15] = {name = "飞镖",action = {"attack12"}},
- }
-
- CheatController.NVQIANG_BTNS = {
- [1] = {name = "待机",action = {"idle"}},
- [2] = {name = "跑",action = {"run"}},
- [3] = {name = "跳跃",action = {"jump","jump2","jump3"}},
- [4] = {name = "受击",action = {"hited"}},
- [5] = {name = "走路",action = {"walk"}},
- [6] = {name = "死亡",action = {"death"}},
- [7] = {name = "打坐",action = {"sit","sit2","sit3"}},
- [8] = {name = "眩晕",action = {"dizzy"}},
- [9] = {name = "倒地",action = {"down"}},
- [10] = {name = "起身",action = {"rise"}},
- [11] = {name = "连击",action = {"attack","attack2","attack3","attack4","attack5"},pao = true},
- [12] = {name = "朝天技能",action = {"attack6"},pao = true},
- [13] = {name = "连射技能",action = {"attack7"}},
- [14] = {name = "buff状态",action = {"attack8"}},
- [15] = {name = "击退",action = {"attack9"},pao = true},
- }
-
- CheatController.HUOBAN_BTNS = {
- [1] = {name = "待机",action = {"idle"}},
- [2] = {name = "跑",action = {"run"}},
- [3] = {name = "受击",action = {"hited"}},
- [4] = {name = "走路",action = {"walk"}},
- [5] = {name = "死亡",action = {"death"}},
- [6] = {name = "眩晕",action = {"dizzy"}},
- [7] = {name = "倒地",action = {"down"}},
- [8] = {name = "起身",action = {"rise"}},
- [9] = {name = "攻击",action = {"attack"}},
- }
-
- CheatController.SKILL_BTNS = {
- [1] = {
- [1] = {name = "冲撞不带盾",action = {"attack9","attack10","attack11"},effect = {1}},
- [2] = {name = "冲撞带盾",action = {"attack12","attack13","attack14"},effect = {2},dun = true},
- [3] = {name = "带盾连击",action = {"attack","attack2","attack3","attack4","attack5"},single_effect = true,effect = {{9},{10},{},{11},{12}},lweffect = {},dun = true},--lweffect 13
- [4] = {name = "不带盾连击",action = {"attack6","attack7","attack8","attack20"},single_effect = true,effect = {{14,15},{16},{17,18}}},
- [5] = {name = "砸地",action = {"attack15"},effect = {4,6},rweffect = {5}},
- [6] = {name = "不带盾砸地",action = {"attack18"},effect = {4,3,6}},
- [7] = {name = "反刺盾",action = {"attack16"},effect = {7}},
- [8] = {name = "嘲讽",action = {"attack17"},effect = {8}},
- },
- [3] = {
- [1] = {name = "连击技能",action = {"attack","attack2","attack3","attack4","attack5","attack6"},single_effect = true,effect = {{28},{29},{30,27},{31},{32}}},
- [2] = {name = "隐身技能",action = {"attack7"},effect = {19}},
- [3] = {name = "黑球缠绕技能",action = {"attack8"},effect = {20,21,22}},
- [4] = {name = "分身技能",action = {"attack9","attack10","attack11"},effect = {23,24}},
- [5] = {name = "飞镖",action = {"attack12"},effect = {25}},--26
- },
- [4] = {
- [1] = {name = "连击",action = {"attack","attack2","attack3","attack4"},single_effect = true,effect = {{47,49},{50},{50},{46,48,52}}},
- [2] = {name = "治愈法阵",action = {"attack5"},single_effect = true,effect = {{36,37}}},
- [3] = {name = "治愈",action = {"attack6"},single_effect = true,effect = {{38,39}}},
- [4] = {name = "火球术",action = {"attack7"},single_effect = true,effect = {{40,42}}},
- [5] = {name = "天堂审判",action = {"attack8"},single_effect = true,effect = {{43,44,45}}},
- }
- }
-
- CheatController.PARTICLE_RES =
- {
- [1] = "zs_effect_skill_jineng1_chongji_1",
- [2] = "zs_effect_skill_jineng1_chongji_2",
- [3] = "zs_effect_skill_jineng2_chentu",
- [4] = "zs_effect_skill_jineng2_daoguang",
- [5] = "zs_effect_skill_jineng2_xuanzhuanjian",
- [6] = "zs_effect_skill_jineng2_zadibaozha",
- [7] = "zs_effect_skill_jineng3_fanshang",
- [8] = "zs_effect_skill_jineng4_chaofeng",
- [9] = "zs_effect_skill_pugong1_daoguang1",
- [10] = "zs_effect_skill_pugong1_daoguang2",
- [11] = "zs_effect_skill_pugong1_daoguang3",
- [12] = "zs_effect_skill_pugong1_dunpaiguang",
- [13] = "zs_effect_skill_pugong1_xuanzhuandun",
- [14] = "zs_effect_skill_pugong2_chentu",
- [15] = "zs_effect_skill_pugong2_daoguang1",
- [16] = "zs_effect_skill_pugong2_daoguang2",
- [17] = "zs_effect_skill_pugong2_daoguang3",
- [18] = "zs_effect_skill_pugong2_zadibaozha",
-
- [19] = "ck_effect_skill_jineng1_buff",
- [20] = "ck_effect_skill_jineng2_buff1",
- [21] = "ck_effect_skill_jineng2_buff2",
- [22] = "ck_effect_skill_jineng2_fly_qiu",
- [23] = "ck_effect_skill_jineng3_gongjixian",
- [24] = "ck_effect_skill_jineng3_quanquan",
- [25] = "ck_effect_skill_jineng4_buff",
- [26] = "ck_effect_skill_jineng4_feibiao",
- [27] = "ck_effect_skill_pugong1_chentu",
- [28] = "ck_effect_skill_pugong1_daoguang1",
- [29] = "ck_effect_skill_pugong1_daoguang2",
- [30] = "ck_effect_skill_pugong1_daoguang3",
- [31] = "ck_effect_skill_pugong1_daoguang4",
- [32] = "ck_effect_skill_pugong1_daoguang5",
- [33] = "ck_effect_skill_shouji1",
- [34] = "ck_effect_skill_shouji2",
- [35] = "ck_effect_skill_shouji3",
-
- [36] = "fs_effect_skill_jineng1_buff",
- [37] = "fs_effect_skill_jineng1_fazhen1",
- [38] = "fs_effect_skill_jineng2_jiaxue",
- [39] = "fs_effect_skill_jineng2_shengguang",
- [40] = "fs_effect_skill_jineng3_guangqiu",
- [41] = "fs_effect_skill_jineng3_quanquan",
- [42] = "fs_effect_skill_jineng3_shoujiguang",
- [43] = "fs_effect_skill_jineng4_buff",
- [44] = "fs_effect_skill_jineng4_dimianquan",
- [45] = "fs_effect_skill_jineng4_shandian",
- [46] = "fs_effect_skill_pugong_chentu",
- [47] = "fs_effect_skill_pugong_dandao1",
- [48] = "fs_effect_skill_pugong_dandao2",
- [49] = "fs_effect_skill_pugong_shoujiguang1",
- [50] = "fs_effect_skill_pugong_shoujiguang2",
- [51] = "fs_effect_skill_pugong_shoujiguang3",
- [52] = "fs_effect_skill_pugong_shoujiguang4",
- [53] = "fs_effect_skill_shoujiguang",
- }
-
- CheatController.PARTICLE_BTNS = {
- [1] = {
- [1] = {name = "jn1_chongji_1",ps = 1},
- [2] = {name = "jn1_chongji_2",ps = 2},
- [3] = {name = "jn2_chentu",ps = 3},
- [4] = {name = "jn2_daoguang",ps = 4},
- [5] = {name = "jn2_xuanzhuanjian",ps = 5},
- [6] = {name = "jn2_zadibaozha",ps = 6},
- [7] = {name = "jn3_fanshang",ps = 7},
- [8] = {name = "jn4_chaofeng",ps = 8},
- [9] = {name = "pg1_daoguang1",ps = 9},
- [10] = {name = "pg1_daoguang2",ps = 10},
- [11] = {name = "pg1_daoguang3",ps = 11},
- [12] = {name = "pg1_dunpaiguang",ps = 12},
- [13] = {name = "pg1_xuanzhuandun",ps = 13},
- [14] = {name = "pg2_chentu",ps = 14},
- [15] = {name = "pg2_daoguang1",ps = 15},
- [16] = {name = "pg2_daoguang2",ps = 16},
- [17] = {name = "pg2_daoguang3",ps = 17},
- [18] = {name = "pg2_zadibaozha",ps = 18},
- },
- [3] = {
- [1] = {name = "jineng1_buff",ps = 19},
- [2] = {name = "jineng2_buff1",ps = 20},
- [3] = {name = "jineng2_buff2",ps = 21},
- [4] = {name = "jineng2_fly_qiu",ps = 22},
- [5] = {name = "jineng3_gongjixian",ps = 23},
- [6] = {name = "jineng3_quanquan",ps = 24},
- [7] = {name = "jineng4_buff",ps = 25},
- [8] = {name = "jineng4_feibiao",ps = 26},
- [9] = {name = "pugong1_chentu",ps = 27},
- [10] = {name = "pugong1_daoguang1",ps =28},
- [11] = {name = "pugong1_daoguang2",ps = 29},
- [12] = {name = "pugong1_daoguang3",ps = 30},
- [13] = {name = "pugong1_daoguang4",ps = 31},
- [14] = {name = "pugong1_daoguang5",ps = 32},
- [15] = {name = "shouji1",ps = 33},
- [16] = {name = "shouji2",ps = 34},
- [17] = {name = "shouji3",ps = 35},
- },
- [4] = {
- [1] = {name = "jineng1_buff",ps = 36},
- [2] = {name = "jineng1_fazhen1",ps = 37},
- [3] = {name = "jineng2_jiaxue",ps = 38},
- [4] = {name = "jineng2_shengguang",ps = 39},
- [5] = {name = "jineng3_guangqiu",ps = 40},
- [6] = {name = "jineng3_quanquan",ps = 41},
- [7] = {name = "jineng3_shoujiguang",ps = 42},
- [8] = {name = "jineng4_buff",ps = 43},
- [9] = {name = "jineng4_dimianquan",ps = 44},
- [10] = {name = "jineng4_shandian",ps = 45},
- [11] = {name = "pugong_chentu",ps = 46},
- [12] = {name = "pugong_dandao1",ps = 47},
- [13] = {name = "pugong_dandao2",ps = 48},
- [14] = {name = "pugong_shoujiguang1",ps = 49},
- [15] = {name = "pugong_shoujiguang2",ps = 50},
- [16] = {name = "pugong_shoujiguang3",ps = 51},
- [17] = {name = "pugong_shoujiguang4",ps = 52},
- [18] = {name = "shoujiguang",ps = 53},
- }
- }
-
- CheatController.ShowView = {
- -- ["show_view_1"] = {command = "show_view_1",command_name = "打开副本",args_list = {},openModel = "BaseDungeonModel", openEvent = BaseDungeonModel.OPEN_HALL_VIEW,parm = {}},
- -- ["show_view_2"] = {command = "show_view_2",command_name = "打开神殿",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_GUILD_GOVERN_VIEW,parm = {true}},
- -- ["show_view_3"] = {command = "show_view_3",command_name = "打开世界服",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_WORLD_VIEW,parm = {}},
- -- ["show_view_4"] = {command = "show_view_4",command_name = "打开VIP",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_VIP_VIEW,parm = {1}},
- -- ["show_view_5"] = {command = "show_view_5",command_name = "打开首冲",args_list = {},openModel = "RechargeActivityModel", openEvent = RechargeActivityModel.OPEN_FIRST_RECHARGE_VIEW,parm = {}},
- -- ["show_view_6"] = {command = "show_view_6",command_name = "打开寻宝",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_TREASUREHUNT_VIEW,parm = {}},
- -- -- ["show_view_7"] = {command = "show_view_7",command_name = "打开祈愿",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_PRAY_VIEW,parm = {}},
- -- ["show_view_8"] = {command = "show_view_8",command_name = "打开婚姻",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_MARRIAGE_VIEW,parm = {}},
- -- ["show_view_9"] = {command = "show_view_9",command_name = "打开幻兽",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_BEAST_VIEW,parm = {}},
- -- ["show_view_10"] = {command = "show_view_10",command_name = "打开星图",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_STAR_MAP_VIEW,parm = {}},
- -- ["show_view_11"] = {command = "show_view_11",command_name = "打开角色",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_MAIN_ROLE_VIEW,parm = {}},
- -- ["show_view_12"] = {command = "show_view_12",command_name = "打开魂珠",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_RUNE_BASE_VIEW,parm = {}},
- -- ["show_view_14"] = {command = "show_view_14",command_name = "打开神器",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_ARTIFACT_VIEW,parm = {}},
- -- ["show_view_15"] = {command = "show_view_15",command_name = "打开精灵",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_PET_VIEW,parm = {1}},
- -- ["show_view_16"] = {command = "show_view_16",command_name = "荣耀战神",args_list = {},openModel = "GlobalEventSystem", openEvent = EventName.OPEN_HONOUR_VIEW,parm = {true}},
- }
-
-
- function CheatController:__init()
- CheatController.Instance = self
- self.btn_list = {}
- self.child_btn_list = {}
- self.is_pop = false
- self.model_index = 1
- self.model = CheatModel:getInstance()
- self:RegisterAllProtocals()
- self:InitView()
- self:InitEvent()
- self.scene_index = 0
- end
-
- --[[
- * 注册socket
- *
- ]]
- function CheatController:RegisterAllProtocals()
- self:RegisterProtocal(11100, "handler11100")--秘籍列表
- self:RegisterProtocal(11101, "handler11101")--执行秘籍
- self:RegisterProtocal(11105, "handler11105")--后台触发客户端信息
- end
-
- function CheatController:InitView()
- local function onClickMainBtn()
- self.is_pop = not self.is_pop
-
- if IsTableEmpty(self.btn_list) then
- self:CreateBtns()
- end
-
- if self.is_pop then
- local len = #self.btn_list
- local item = nil
- for i = 1,len do
- item = self.btn_list[i]
- item:SetActive(true)
- end
- else
- local len = #self.btn_list
- local item = nil
- for i = 1,len do
- item = self.btn_list[i]
- item:SetActive(false)
- end
- len = #self.child_btn_list
- for i = 1,len do
- item = self.child_btn_list[i]
- item:SetActive(false)
- end
- end
- end
- GlobalEventSystem:Bind(EventName.SHOW_CHEAT,onClickMainBtn)
-
- local function onOpenLuaStateView()
- if self.LuaState == nil then
- self.LuaState = LuaState.New()
- end
- if self.LuaState:HasOpen() then
- self.LuaState:Close()
- else
- self.LuaState:Open()
- end
- end
- if ClientConfig.plat_name == "mrzj_develop" then
- -- onOpenLuaStateView()
- end
- GlobalEventSystem:Bind(EventName.OPEN_LUA_STATE_VIEW,onOpenLuaStateView)
- end
-
- function CheatController:CreateBtns()
- local function onClickBtnHandler(target)
- for i,v in ipairs(self.child_btn_list) do
- panelMgr:DestroyGameObject(v)
- end
- self.child_btn_list = {}
- if self.last_index then
- self.btn_list[self.last_index].transform:GetComponent("Image").color = Color(0.208, 1, 0.451, 1)
- end
-
- Scene.Instance:GetMainRole():SetType(SceneBaseType.MainRole)
-
- local change_btn_state = true
- local index = tonumber(target.name)
- if index == 1 then
- self:TestZhanShi(index)
- elseif index == 2 then
- self:TestNvQiang(index)
- elseif index == 6 then
- local func = function(target)
- self:TestEffect(target)
- end
- local ps_btn = CheatController.PARTICLE_BTNS[self.model_index]
- if ps_btn then
- self:TestFunc(ps_btn,func)
- end
- elseif index == 7 then
- local func = function(target)
- self:TestSkill(target)
- end
-
- local skill_btn = CheatController.SKILL_BTNS[self.model_index]
- if skill_btn then
- self:TestFunc(skill_btn,func)
- end
- elseif index == 8 then
- local func = function(target)
- local index = tonumber(target.name)
- local scene_info = CheatController.CHANGE_SCENE_BTNS[index]
- if scene_info.id ~= SceneManager.Instance:GetSceneId() then
- GlobalEventSystem:Fire(SceneEventType.REQUEST_CHANGE_SCENE, scene_info.id)
- end
- end
-
- self:TestFunc(CheatController.CHANGE_SCENE_BTNS,func)
-
- elseif index == 9 then
- if self.LuaState == nil then
- self.LuaState = LuaState.New()
- end
- if self.LuaState:HasOpen() then
- self.LuaState:Close()
- else
- self.LuaState:Open()
- end
- elseif index == 3 then
- self:TestChiKe(index)
- elseif index == 4 then
- self:TestZhuJiao(index)
- elseif index == 5 then
- Scene.Instance:GetMainRole():SetType(SceneBaseType.Partner)
- self:TestHuoBan(index)
- end
- self.last_index = index
- if change_btn_state then
- self.btn_list[index].transform:GetComponent("Image").color = Color(0.208, 0.31, 0.451, 1)
- end
- end
-
- local len = 0--#CheatController.FUNC_BTNS
- local vo = nil
- local btn = nil
-
- for i = 1,len do
- vo = CheatController.FUNC_BTNS[i]
- btn = UiFactory.createChild(panelMgr:GetParent("Top"),UIType.SmallButton1,i)
- btn.transform.localPosition = Vector3((i - 1) * 150 - ScreenWidth/3 - 100,ScreenHeight - 400,0)
- btn.transform:Find("Text"):GetComponent("Text").text = vo.name
- btn.transform:GetComponent("Image").color = Color(0.208, 1, 0.451, 1)
- AddClickEvent(btn,onClickBtnHandler)
- table.insert(self.btn_list,btn)
-
- end
- end
-
- function CheatController:TestFunc(data,callback)
- local vo = nil
- local btn = nil
- local len = #data
- for i=1,len do
- local addx = 0
- local addy = 0
- local add = (i - 0.001)/13
- if add > 1 then
- addy = addy + 650*math.floor(add)
- addx = math.floor(add) * 180
- end
- local x = - ScreenWidth/2 + 100 + addx
- local y = ScreenHeight - (i - 1) * 50 - 450 + addy
-
- vo = data[i]
- btn = UiFactory.createChild(panelMgr:GetParent("Top"),UIType.SmallButton2,i)
- btn.transform.localPosition = Vector3(x,y,0)
- btn.transform:Find("Text"):GetComponent("Text").text = vo.name
- AddClickEvent(btn,callback)
- table.insert(self.child_btn_list,btn)
- end
-
- local _play_action = function()
- Scene.Instance:GetMainRole():RemoveAttackAllWeapon()
- end
- GlobalTimerQuest:AddDelayQuest(_play_action,0.0001)
- end
-
- function CheatController:TestSkill(target)
- local index = tonumber(target.name)
- local skill_info = CheatController.SKILL_BTNS[self.model_index][index]
- self:PlayAction(skill_info)
-
- Scene.Instance:GetMainRole():RemoveAttackAllWeapon()
-
- if self.model_index == 1 then
- if skill_info.dun then
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.ZhanShiLWeapon,AttachNode.LHand,Vector3(0,0,180))
- end
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.ZhanShiRWeapon,AttachNode.RHand)
- elseif self.model_index == 3 then
-
- end
-
- if not skill_info.single_effect then
- if skill_info.effect then
- for index,particle_index in pairs(skill_info.effect) do
- local func = function()
- end
- local function call_back_func()
- end
- ParticleManager:getInstance():AddTargetEffect( CheatController.PARTICLE_RES[particle_index], Scene.Instance:GetMainRole().compress_id, false, nil, nil, nil,call_back_func,nil,1)
- end
- end
-
- local func = function()
- end
-
- if skill_info.lweffect then
- for index,particle_index in pairs(skill_info.lweffect) do
- Scene.Instance:GetMainRole():AttachWeaponParticle(CheatController.PARTICLE_RES[particle_index],AttachNode.LHand,func,CheatController.SKILL_RES[self.model_index])
- end
- end
-
- if skill_info.rweffect then
- for index,particle_index in pairs(skill_info.rweffect) do
- Scene.Instance:GetMainRole():AttachWeaponParticle(CheatController.PARTICLE_RES[particle_index],AttachNode.RHand,func,CheatController.SKILL_RES[self.model_index])
- end
- end
- end
- end
-
- function CheatController:TestEffect(target)
- local index = tonumber(target.name)
- local effect_info = CheatController.PARTICLE_BTNS[self.model_index][index]
-
- local func = function( obj )
- self.effect_obj = obj
- end
-
- ParticleManager:getInstance():AddTargetEffect( CheatController.PARTICLE_RES[effect_info.ps], Scene.Instance:GetMainRole().compress_id)
-
- end
-
- function CheatController:TestHuoBan(index)
- if self.model_index ~= 5 then
- Scene.Instance:GetMainRole():UpdateModel(SceneTest.HuoBanRole)
- end
- self.model_index = index
-
- local func = function(target)
- Scene.Instance:GetMainRole():RemoveAttackAllWeapon()
-
- local index = tonumber(target.name)
- local action_info = CheatController.HUOBAN_BTNS[index]
- self:PlayAction(action_info)
-
- if action_info.weapon then
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.HuoBanRWeapon,AttachNode.RHand)
- end
- end
- self:TestFunc(CheatController.HUOBAN_BTNS,func)
- end
-
- function CheatController:TestZhuJiao(index)
- if self.model_index ~= 4 then
- Scene.Instance:GetMainRole():UpdateModel(SceneTest.ZhuJiaoRole)
-
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.ZhuJiaoRWeapon,AttachNode.RHand)
-
- Scene.Instance:SetCurTestRole(SceneTest.ZhuJiaoRole)
- end
- self.model_index = index
-
- local func = function(target)
- Scene.Instance:GetMainRole():RemoveAttackAllWeapon()
-
- local index = tonumber(target.name)
- local action_info = CheatController.ZHUJIAO_BTNS[index]
- self:PlayAction(action_info)
-
- if not action_info.noweapon then
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.ZhuJiaoRWeapon,AttachNode.RHand)
- end
- end
- self:TestFunc(CheatController.ZHUJIAO_BTNS,func)
- end
-
- function CheatController:TestChiKe(index)
- if self.model_index ~= 3 then
- Scene.Instance:GetMainRole():UpdateModel(SceneTest.ChiKeRole)
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.CiKeRWeapon,AttachNode.RHand)
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.CiKeLWeapon,AttachNode.LHand)
-
- Scene.Instance:SetCurTestRole(SceneTest.ChiKeRole)
- end
- self.model_index = index
-
- local func = function(target)
- Scene.Instance:GetMainRole():RemoveAttackAllWeapon()
- local index = tonumber(target.name)
- local action_info = CheatController.CHIKE_BTNS[index]
- self:PlayAction(action_info)
-
- if action_info.weapon then
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.CiKeRWeapon,AttachNode.RHand)
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.CiKeLWeapon,AttachNode.LHand)
- end
- end
- self:TestFunc(CheatController.CHIKE_BTNS,func)
- end
-
- function CheatController:TestZhanShi(index)
- if self.model_index ~= 1 then
- Scene.Instance:SetCurTestRole(SceneTest.ZhanShiRole)
- Scene.Instance:GetMainRole():UpdateModel(SceneTest.ZhanShiRole)
- end
- self.model_index = index
- local func = function(target)
- Scene.Instance:GetMainRole():RemoveAttackAllWeapon()
- local index = tonumber(target.name)
- local action_info = CheatController.ZHANSHI_BTNS[index]
- self:PlayAction(action_info)
-
- if action_info.dun then
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.ZhanShiLWeapon,AttachNode.LHand)
- end
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.ZhanShiRWeapon,AttachNode.RHand)
- end
- self:TestFunc(CheatController.ZHANSHI_BTNS,func)
- end
-
- function CheatController:TestNvQiang(index)
- local add_def_weapon = function()
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.NvQiangLWeapon,AttachNode.LHand)
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.NvQiangRWeapon,AttachNode.RHand)
- end
- if self.model_index ~= 2 then
- Scene.Instance:SetCurTestRole(SceneTest.NvQiangRole)
- Scene.Instance:GetMainRole():UpdateModel(SceneTest.NvQiangRole)
- end
- self.model_index = index
-
- local func = function(target)
- Scene.Instance:GetMainRole():RemoveAttackAllWeapon()
-
- local index = tonumber(target.name)
- local action_info = CheatController.NVQIANG_BTNS[index]
- self:PlayAction(action_info)
-
- if action_info.pao then
- Scene.Instance:GetMainRole():AttackWeapon(SceneTest.NvQiangBWeapon,AttachNode.BHand)
- end
- add_def_weapon()
- end
- self:TestFunc(CheatController.NVQIANG_BTNS,func)
- end
-
- function CheatController:PlayAction(action_info)
- local to_idle = function()
- Scene.Instance:GetMainRole():PlayAction("idle")
- end
-
- local play_action
- local action_index = 1
- play_action = function()
- Scene.Instance:GetMainRole():PlayAction(action_info.action[action_index])
-
- if action_info.single_effect then
- local effets = action_info.effect[action_index]
- if effets and #effets > 0 then
- local call_back_func = function()
- end
- for i,particle_index in ipairs(effets) do
- ParticleManager:getInstance():AddTargetEffect(CheatController.PARTICLE_RES[particle_index], Scene.Instance:GetMainRole().compress_id, false, nil, nil, nil,call_back_func,nil,1)
- end
- end
- end
-
- local _play_action = function()
- local last_time = Scene.Instance:GetMainRole():GetCurActionTime()
- if #action_info.action > action_index then
- action_index = action_index + 1
- GlobalTimerQuest:AddDelayQuest(play_action,last_time)
- else
- GlobalTimerQuest:AddDelayQuest(to_idle,last_time)
- end
- end
-
- GlobalTimerQuest:AddDelayQuest(_play_action,0.001)
- end
- play_action()
- end
-
- function CheatController:InitEvent()
- local game_start = function ()
- self:SendFmtToGame(11100)
- end
- GlobalEventSystem:Bind(EventName.GAME_START, game_start)
- GlobalEventSystem:Bind(EventName.REQUEST_MIJI_DATA, game_start)
-
- local open_input_view = function ()
- if not PlatformMgr:getInstance():IsInternalPalt() then
- Message.show("no Internal Palt")
- return
- end
- -- self.model:SetCheatsData()
- if self.cheatInputView == nil then
- self.cheatInputView = CheatInputView.New()
- end
- if self.cheatInputView:HasOpen() then
- self.cheatInputView:Close()
- else
- self.cheatInputView:Open()
- end
- end
- GlobalEventSystem:Bind(EventName.OPEN_CHEAT_INPUT_VIEW, open_input_view)
-
- local open_client_view = function ()
- end
- GlobalEventSystem:Bind(EventName.OPEN_CHEAT_CLIENT_VIEW, open_client_view)
-
- local send_cheat = function(text)
- if text then
- self:SendFmtToGame(11101, "s", text)
- end
- end
- self.model:Bind(CheatModel.SEND_CHEAT_TO_SERVER, send_cheat)
-
- local open_show_view = function (key)
- local cfg = CheatController.ShowView[key]
- if not cfg then
- return
- end
-
- --兼容用Model发事件的同学
- if string.find(cfg.openModel,"Model",-5,true) then
- local instance = _G[cfg.openModel].Instance
- instance._class_type.Fire(instance,cfg.openEvent,unpack(cfg.parm))
- else
- _G[cfg.openModel]:Fire(cfg.openEvent,unpack(cfg.parm))
- end
- end
- self.model:Bind(CheatModel.OPEN_CHEAT_SHOW_VIEW, open_show_view)
-
- local function on_camera_view( )
- if not self.camera_edit_view then
- self.camera_edit_view = CheatCameraView.New()
- end
- self.camera_edit_view:Open()
- end
- self.model:Bind(CheatModel.OPEN_CAMERA_EDIt_VIEW, on_camera_view)
-
- local function on_ui_camera_view( )
- if not self.ui_camera_edit_view then
- self.ui_camera_edit_view = CheatUICameraView.New()
- end
- self.ui_camera_edit_view:Open()
- end
- self.model:Bind(CheatModel.OPEN_UI_CAMERA_EDIT_VIEW, on_ui_camera_view)
-
- local function on_bloom_view( )
- if not self.bloom_edit_view then
- self.bloom_edit_view = CheatBloomView.New()
- end
- self.bloom_edit_view:Open()
- end
- self.model:Bind(CheatModel.OPEN_BLOOM_EDIt_VIEW, on_bloom_view)
-
- local function on_property_view( )
- if not self.property_view then
- self.property_view = CheatPropertyView.New()
- end
- self.property_view:Open()
- end
- self.model:Bind(CheatModel.OPEN_CLIENT_PROPERTY_VIEW, on_property_view)
-
-
- local function on_acceleration_view( )
- if not self.acceleration_view then
- self.acceleration_view = CheatAccelerationView.New()
- end
- self.acceleration_view:Open()
- end
- self.model:Bind(CheatModel.OPEN_CLIENT_ACCELERATION_VIEW, on_acceleration_view)
-
- local function QuickRunCode( code_str )
- if not code_str then return end
- -- 范例local str = "@RunCode:local a = BossModel:GetInstance().world_boss_status; Message.show(a)"
- code_str = string.gsub(code_str,"@RunCode:","")
- code_str = string.gsub(code_str,"RunCode:","")
- if pcall(loadstring(code_str)) then
- print('执行成功')
- else
- print('执行失败')
- end
- end
- self.model:Bind(CheatModel.Quick_Run_Code, QuickRunCode)
-
- local function open_fxaa_test_view(show)
- self:OpenView("CheatFXAAView", show)
- end
- self.model:Bind(CheatModel.OPEN_FXAA_TEST_VIEW, open_fxaa_test_view)
-
- local function open_free_camera_view(show)
- self:OpenView("CheatFreeCameraView", show)
- end
- self.model:Bind(CheatModel.OPEN_FREE_CAMERA_VIEW, open_free_camera_view)
-
- local function open_green_screen_click_view(show, green_click_size)
- if show then
- if not self.CheatGreenScreenClickView then
- self.CheatGreenScreenClickView = CheatGreenScreenClickView.New()
- end
- if not self.CheatGreenScreenClickView:HasOpen() then
- self.CheatGreenScreenClickView:Open(green_click_size)
- else
- self.CheatGreenScreenClickView:ReOpen(green_click_size)
- end
- else
- if self.CheatGreenScreenClickView then
- self.CheatGreenScreenClickView:Close()
- end
- end
- -- self:OpenView("CheatGreenScreenClickView", show, green_click_size)
- end
- self.model:Bind(CheatModel.OPEN_GREEN_SCREEN_CLICK_VIEW, open_green_screen_click_view)
-
- local function open_selectRoleView_show_click_view(show, click_callback)
- self:OpenView("CheatHideSelectRoleViewClickView", show, click_callback)
- end
- self.model:Bind(CheatModel.OPEN_SELECTROLEVIEW_SHOW_CLICK_VIEW, open_selectRoleView_show_click_view)
- end
-
- function CheatController:handler11100()
- local vo = SCMD11100.New(true)
- if not IsTableEmpty(vo.command_list) then
- PlatformMgr.is_internal_palt = true
- end
-
- local data = {command = "pt_61001_[1002]", command_name = "切1002", args_list = {}}
- table.insert(vo.command_list, 1, data)
-
- data = {command = "perform", command_name = "perform", args_list = {}}
- table.insert(vo.command_list, 1, data)
- data = {command = "framecount_50", command_name = "设置帧数", args_list = {}}
- table.insert(vo.command_list, 2, data)
-
- data = {command = "auto_upgrade", command_name = "自动提升", args_list = {}}
- table.insert(vo.command_list, 3, data)
-
- data = {command = "open_story_id_index_0", command_name = "打开剧情", args_list = {}}
- table.insert(vo.command_list, 4, data)
- data = {command = "search_goods_物品名字", command_name = "查询物品ID", args_list = {}}
- table.insert(vo.command_list, 1, data)
- data = {command = "camera_edit", command_name = "摄像机参数", args_list = {}}
- table.insert(vo.command_list, data)
-
- data = {command = "Position", command_name = "Position", args_list = {}}
- table.insert(vo.command_list, 1, data)
-
- data = {command = "client_property", command_name = "属性预览", args_list = {}}
- table.insert(vo.command_list, 1, data)
-
- -- data = {command = "client_gyro", command_name = "gyro测试", args_list = {}}
- -- table.insert(vo.command_list, 1, data)
-
- data = {command = "open_fun_10030", command_name = "功能开放测试", args_list = {}}
- table.insert(vo.command_list, 1, data)
-
- data = {command = "RunCode:", command_name = "代码执行", args_list = {}}
- table.insert(vo.command_list, 1, data)
-
- data = {command = "TVB_100", command_name = "跑马弹幕测试", args_list = {}}
- table.insert(vo.command_list, 1, data)
-
- data = {command = "change_bloom", command_name = "摄像机泛光参数", args_list = {}}
- table.insert(vo.command_list, 1, data)
-
- data = {command = "ui_camera_edit", command_name = "摄像机UI模型参数", args_list = {}}
- table.insert(vo.command_list, 1, data)
-
- data = {command = "ban_auto_connect", command_name = "禁止自动重连", args_list = {}}
- table.insert(vo.command_list, data)
-
- data = {command = "use_model_render", command_name = "模型UI挂载", args_list = {}}
- table.insert(vo.command_list, data)
-
- data = {command = "fxaa_edit", command_name = "FXAA调试", args_list = {}}
- table.insert(vo.command_list, data)
-
- data = {command = "free_camera", command_name = "全自由相机", args_list = {}}
- table.insert(vo.command_list, data)
-
- data = {command = "enablegs", command_name = "启用绿屏", args_list = {}}
- table.insert(vo.command_list, data)
-
- data = {command = "hide_ui", command_name = "隐藏主界面", args_list = {}}
- table.insert(vo.command_list, data)
-
- data = {command = "show_ui", command_name = "显示主界面", args_list = {}}
- table.insert(vo.command_list, data)
-
- data = {command = "jipsaw", command_name = "拼图游戏", args_list = {}}
- table.insert(vo.command_list, data)
-
- data = {command = "play_story_", command_name = "播放剧情", args_list = {}}
- table.insert(vo.command_list, data)
-
- data = {command = "guaguale", command_name = "刮刮乐", args_list = {}}
- table.insert(vo.command_list, data)
-
- for index,data in pairs(CheatController.ShowView) do
- table.insert(vo.command_list,#vo.command_list + 1,data)
- end
-
- data = {command = "load_base_scene", command_name = "加载基础场景", args_list = {}}
- table.insert(vo.command_list, data)
-
- self.model:SetCheatsData(vo)
- end
-
- function CheatController:handler11101()
-
- end
-
- function CheatController:handler11105()
- local scmd = SCMD11105.New(true)
-
- local str = string.format("当前主界面隐藏情况 %d",lua_viewM.main_cancas_last_visible and 1 or 2)
- str = str .. "\n"
-
- local view_path = "root/Canvas/"
- local go = GameObject.Find(view_path)
- str = str..string.format("root/Canvas active情况 %d,position.x = %s,position.y = %s,,position.z = %s",go.activeSelf and 1 or 2,go.transform.localPosition.x,go.transform.localPosition.y,go.transform.localPosition.z)
- str = str .. "\n"
-
-
- local node = panelMgr:GetParent("UI")
- str = str..string.format("UI_ROOT active情况 %d,anchoredPosition.x = %s,anchoredPosition.y = %s,position.x = %s,position.y = %s,,position.z = %s",node.gameObject.activeSelf and 1 or 2,node.anchoredPosition.x,node.anchoredPosition.y,node.localPosition.x,node.localPosition.y,node.localPosition.z)
- str = str .. "\n"
-
- for i = 0, node.childCount-1 do
- local child = node:GetChild(i).gameObject
- str = str ..string.format("UI 子节点 name = %s,隐藏情况 = %d,anchoredPosition.x = %s,anchoredPosition.y = %s,position.x = %s,position.y = %s,,position.z = %s",child.name,child.activeSelf and 1 or 2,
- child.transform.anchoredPosition.x,child.transform.anchoredPosition.y,child.transform.localPosition.x,child.transform.localPosition.y,child.transform.localPosition.z)
- str = str .. "\n"
- end
-
- local node = panelMgr:GetParent("Activity")
- str = str..string.format("Activity_ROOT active情况 %d,anchoredPosition.x = %s,anchoredPosition.y = %s,position.x = %s,position.y = %s,,position.z = %s",node.gameObject.activeSelf and 1 or 2,node.anchoredPosition.x,node.anchoredPosition.y,node.localPosition.x,node.localPosition.y,node.localPosition.z)
- str = str .. "\n"
-
- for i = 0, node.childCount-1 do
- local child = node:GetChild(i).gameObject
- str = str ..string.format("Activity 子节点 name = %s,隐藏情况 = %d,anchoredPosition.x = %s,anchoredPosition.y = %s,position.x = %s,position.y = %s,,position.z = %s",child.name,child.activeSelf and 1 or 2,
- child.transform.anchoredPosition.x,child.transform.anchoredPosition.y,child.transform.localPosition.x,child.transform.localPosition.y,child.transform.localPosition.z)
- str = str .. "\n"
- end
-
- local node = panelMgr:GetParent("Top")
- str = str..string.format("Top_ROOT active情况 %d,anchoredPosition.x = %s,anchoredPosition.y = %s,position.x = %s,position.y = %s,,position.z = %s",node.gameObject.activeSelf and 1 or 2,node.anchoredPosition.x,node.anchoredPosition.y,node.localPosition.x,node.localPosition.y,node.localPosition.z)
- str = str .. "\n"
-
- for i = 0, node.childCount-1 do
- local child = node:GetChild(i).gameObject
- if not string.find(child.name,"miniMessage") then
- str = str ..string.format("Top 子节点 name = %s,隐藏情况 = %d,anchoredPosition.x = %s,anchoredPosition.y = %s,position.x = %s,position.y = %s,,position.z = %s",child.name,child.activeSelf and 1 or 2,
- child.transform.anchoredPosition.x,child.transform.anchoredPosition.y,child.transform.localPosition.x,child.transform.localPosition.y,child.transform.localPosition.z)
- str = str .. "\n"
- end
- end
-
- str = str .. string.format("main_canvas_hideView_list = \n")
-
- for view,_ in pairs(lua_viewM.main_canvas_hideView_list) do
- str = str .. view.layout_file .. "\n"
- end
- print("str = ",str)
- GameError.Instance:SendErrorToPHP("当前界面隐藏情况 = "..str)
- end
|