【GM】gm工具优化

dev_chengFeng
zhangqiang 2020-11-03 19:19:13 +08:00 committed by gaoxin
parent ab757a2543
commit 3ae2d1048e
3 changed files with 1518 additions and 13199 deletions

File diff suppressed because it is too large Load Diff

View File

@ -177,7 +177,7 @@ function this.UpdateHeroUpStarData(_curUpStarData)
local go = needHeros[i + 1]
go:SetActive(true)
upStarConsumeMaterial[i]={}
upStarMaterialIsAll[i]=false
upStarMaterialIsAll[i]=2
local proImage = Util.GetGameObject(go.transform, "iconbg/proImage")
local iconDefault = Util.GetGameObject(go.transform,"iconDefault")
local icon = Util.GetGameObject(go.transform,"icon")

View File

@ -1,7 +1,47 @@
require("Base/BasePanel")
-- int ADD_ITEM = 1;//添加道具
-- int ADD_CARD = 2; //添加卡牌
-- int SEND_MAIIL = 3;// 发送邮件
-- int HERO_STAR = 4;// 添加指定星级英雄
-- int OPEN_MAP = 5; // 开启到指定关卡
-- int ONE_KEY_ITEM_OR_HERO = 6;
-- int USER_UP_LEVE = 7; // 玩家升级
-- int ADOPT_ALL_DIFFICULTY = 8; // 通过所有关卡
-- int ADOPT_FIGHT_BY_VALUE = 9; //开启对应的关卡
-- int TIME_INFO = 10; // 根据等级开启对应的关卡
-- int VIP_LEVEL = 11; // 根据等级开启对应的关卡
-- int RESET_USER_NAME = 12;
-- int CREATE_INVADE = 13; //生成外敌
-- int SET_TOWER_NUMBER = 14;//设置试炼副本进入层数
-- int TREASURE_SCORE = 15;//生成孙龙宝藏积分
-- int MONSTER_JUMP = 16;//跳到兽潮层
-- int OUT_BLOODY_BATTLE = 17;//退出血战
-- int MISSION_LEAD = 18;//任务指引
-- int ESPECIAL_EQUIP = 19;//增加法宝,星级
-- int TREASURE_FINISH = 20;//戒灵秘宝一键完成
-- int FULL_OF = 21; //一键全满
-- int EXPEDITION_SCORE = 23;//天宫秘宝积分
-- int JOURNEY_GM = 24;//逍遥游GM操作
-- // int TECNOLOGY_MAX = 21;//科技树一键满级
-- // int POKEMAN_MAX = 22;//一键获得所有满级异妖
local GMType = {
Player = 1,
Function = 2,
Battle = 3,
}
local GMSubType = {
Server = 1,
Func = 2,
}
local _GMConfig = {}
require("Base/BasePanel")
GMPanel = Inherit(BasePanel)
local this = MainPanel
local chooseID
local this = GMPanel
-- local heroList = { "4#10003#12", "4#10006#12", "4#10008#12", "4#10009#12", "4#10013#12", "4#10014#12",
-- "4#10003#11", "4#10006#11", "4#10008#11", "4#10009#11", "4#10013#11", "4#10014#11",
-- "4#10003#9", "4#10006#9", "4#10008#9", "4#10009#9", "4#10013#9", "4#10014#9",
@ -14,156 +54,63 @@ local chooseID
"4#10023#10", "4#10022#10", "4#10034#10", "4#10002#10", "4#10014#10","4#10002#10","4#10003#10"
}
local moneyList = {"1#3#999999999", "1#4#999999999", "1#5#999999999", "1#14#999999999", "1#15#999999999", "1#16#999999999"}
local mapId = {
[0] = 100,
[1] = 101,
[2] = 102,
[3] = 103,
[4] = 104,
[5] = 105,
[6] = 106,
[7] = 107,
[8] = 108,
[9] = 109,
[10] = 110,
}
--初始化组件(用于子类重写)
function GMPanel:InitComponent()
_GMConfig = {
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "12#0#%s", btnTip = "改名", inputTip = {"输入名称"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "20#0#%s", btnTip = "完成", inputTip = {"输入任务ID"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "16#%s#0", btnTip = "跳转", inputTip = {"输入兽潮层数"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "15#%s#0", btnTip = "获取", inputTip = {"孙龙秘宝积分"}, callBack = this.SetSunLongScroe},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "13#%s#0", btnTip = "解锁", inputTip = {"外敌ID"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "11#%s#0", btnTip = "确定", inputTip = {"输入Vip等级"}, callBack = this.SetVip},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "7#%s#0", btnTip = "角色升级",inputTip = {"输入等级"}, callBack = nil},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "10#4#%s", btnTip = "设置服务器时间", inputTip = {"例20170801190000"}, callBack = nil},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "10#%s#0", btnTip = "搜索地图", inputTip = {"输入地图Id"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "1#%s", btnTip = "生成道具", inputTip = {"道具ID#道具数量"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "4#%s", btnTip = "生成英雄", inputTip = {"英雄ID#星级"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "9#%s#0", btnTip = "通关关卡", inputTip = {"关卡id"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "3#1#%s", btnTip = "发送邮件", inputTip = {"id,num|id,num..."}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "14#%s#0", btnTip = "跳转", inputTip = {"试炼副本层数"}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Server, inputNum = 0, args = "8#1#1", btnTip = "通关所有关卡", inputTip = {}, callBack = nil},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 0, args = "6#0#0", btnTip = "一键物品", inputTip = {""}, callBack = nil},
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 0, args = "22#0#0", btnTip = "一键异妖", inputTip = {""}, callBack = nil},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "生成五个12星英雄", inputTip = {""}, callBack = this.FiveHero},
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "一键很多钱", inputTip = {""}, callBack = this.GetMoney},
{type = GMType.Function, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "跳转测试", inputTip = {"输入跳转ID"}, callBack = this.TestJump},
{type = GMType.Function, subType = GMSubType.Server, inputNum = 1, args = "23#0#%s", btnTip = "获取", inputTip = {"天宫秘宝积分"}, callBack = nil},
{type = GMType.Function, subType = GMSubType.Server, inputNum = 1, args = "24#%s", btnTip = "逍遥游", inputTip = {"类型#mapId#bossId"}, callBack = nil},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "战斗测试场景", inputTip = {""}, callBack = this.GoTestBattle},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "挑战怪物", inputTip = {"输入怪物组id"}, callBack = this.ChallengeMonster},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "测试假战斗", inputTip = {"输入假战斗id"}, callBack = this.RunFakeBattle},
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 2, args = "", btnTip = "演算战斗数据", inputTip = {"战斗数据", "时间戳"}, callBack = this.RunBattleData},
}
this.BtnBack = Util.GetGameObject(self.transform, "btnBack")
this.btnSureChange = Util.GetGameObject(self.transform, "TimeCtrl/Button")
--this.sureButton = Util.GetGameObject(self.transform, "sureButton")
-- 根节点
this.resourceRoot = Util.GetGameObject(self.gameObject, "ResourceCtrl")
this.processRoot = Util.GetGameObject(self.gameObject, "ProcessCtrl")
-- 资源控制
this.btnGenRole = Util.GetGameObject(self.gameObject, "ProcessCtrl/Generate")
this.strMsg = Util.GetGameObject(self.gameObject, "ProcessCtrl/InputField/Text"):GetComponent("Text")
this.GenerateHero = Util.GetGameObject(self.gameObject, "ProcessCtrl/GenerateHero")
this.GenerateTalisman = Util.GetGameObject(self.gameObject, "ProcessCtrl/GenerateTalisman")
this.passLevel = Util.GetGameObject(self.gameObject, "ProcessCtrl/passLevel")
this.GenerateFiveHero = Util.GetGameObject(self.gameObject, "ProcessCtrl/GenerateFiveHero")
this.sendMailBtn = Util.GetGameObject(self.gameObject, "ProcessCtrl/sendMailBtn")
this.strInputFieldHeroMsg = Util.GetGameObject(self.gameObject, "ProcessCtrl/InputFieldHero/Text"):GetComponent("Text")
this.InputFieldTalisman = Util.GetGameObject(self.gameObject, "ProcessCtrl/InputFieldTalisman/Text"):GetComponent("Text")
this.InputFieldpassLevel = Util.GetGameObject(self.gameObject, "ProcessCtrl/InputFieldpassLevel/Text"):GetComponent("Text")
this.strInputMailMsg = Util.GetGameObject(self.gameObject, "ProcessCtrl/InputMailField/Text"):GetComponent("Text")
this.allItemBtn = Util.GetGameObject(self.gameObject, "ProcessCtrl/allItemBtn")
this.diffMonsterBtn = Util.GetGameObject(self.gameObject, "ProcessCtrl/diffMonsterBtn")
-- 临时代码
this.MapFightText = Util.GetGameObject(self.gameObject, "MapFight/Text"):GetComponent("Text")
this.btnGo = Util.GetGameObject(self.gameObject, "MapFight/Go")
this.btnGoText = Util.GetGameObject(self.gameObject, "MapFight/Go/Text"):GetComponent("Text")
this.MonsterIdText = Util.GetGameObject(self.gameObject, "TestBattle/MapId"):GetComponent("Text")
this.btnBattleGo = Util.GetGameObject(self.gameObject, "TestBattle/Go")
this.btnTestBattle = Util.GetGameObject(self.gameObject, "TestBattle/Go2")
this.searchMap = Util.GetGameObject(self.gameObject, "ProcessCtrl/searchMap")
this.searchMapInputField = Util.GetGameObject(self.gameObject, "ProcessCtrl/searchMapInputField/Text"):GetComponent("Text")
this.GuideInputText = Util.GetGameObject(self.gameObject, "Guide/GuideJump/GuideId"):GetComponent("Text")
this.btnGuideGo = Util.GetGameObject(self.gameObject, "Guide/GuideJump/Go")
this.serverNowTimeText = Util.GetGameObject(self.gameObject, "TimeCtrl/Text (1)"):GetComponent("Text")
this.serverOpenTimeText = Util.GetGameObject(self.gameObject, "TimeCtrl/Text (3)"):GetComponent("Text")
this.serverCreateRoleTimeText = Util.GetGameObject(self.gameObject, "TimeCtrl/Text (5)"):GetComponent("Text")
this.updateServerNowTimeText = Util.GetGameObject(self.gameObject, "TimeCtrl/InputField/Text"):GetComponent("Text")
this.btnSureChange = Util.GetGameObject(self.transform, "TimeCtrl/Button")
this.btnRefreshServerTime = Util.GetGameObject(self.transform, "TimeCtrl/Button2")
this.fullLevel = Util.GetGameObject(self.gameObject, "ProcessCtrl/fullLevel")
this.Placeholder = Util.GetGameObject(self.gameObject, "ProcessCtrl/levelInputField/Text"):GetComponent("Text")
--vipLevel
this.setVipLevel = Util.GetGameObject(self.gameObject, "ProcessCtrl/setVipLevel")
this.vipLevelInputField = Util.GetGameObject(self.gameObject, "ProcessCtrl/vipLevelInputField/Text"):GetComponent("Text")
--recharge
this.confirmRecharge = Util.GetGameObject(self.gameObject, "ProcessCtrl/confirmRecharge")
this.rechargeValueInputField = Util.GetGameObject(self.gameObject, "ProcessCtrl/rechargeValueInputField/Text"):GetComponent("Text")
this.btnPassFight = Util.GetGameObject(self.gameObject, "ProcessCtrl/fightPass")
this.passText = Util.GetGameObject(this.btnPassFight, "Text"):GetComponent("Text")
this.passText.text = Language[11152]
this.btnMaxLv = Util.GetGameObject(self.gameObject, "ProcessCtrl/maxLv")
-- 测试跳过序章
this.btnPassMap = Util.GetGameObject(self.gameObject, "ProcessCtrl/passMap")
--修改名字
this.updateNameBtn=Util.GetGameObject(self.gameObject, "updateName/Button")
--输入的名字
this.inputNameText = Util.GetGameObject(self.gameObject, "updateName/InputField/Text"):GetComponent("Text")
--解锁外敌
this.unlockAlianInvasion = Util.GetGameObject(self.gameObject, "unlockAlianInvasionPanel/Button")
this.unlockAlianInvasionText= Util.GetGameObject(self.gameObject, "unlockAlianInvasionPanel/InputField/Text"):GetComponent("Text")
-- 试炼选层
this.levelText = Util.GetGameObject(self.gameObject, "trialLevelJump/InputField/Text"):GetComponent("Text")
this.btnJumpLevel = Util.GetGameObject(self.gameObject, "trialLevelJump/Button")
--孙龙宝藏积分
this.setTreasureScore = Util.GetGameObject(self.gameObject, "ProcessCtrl/setTreasureScore")
this.treasureScoreInputField = Util.GetGameObject(self.gameObject, "ProcessCtrl/treasureScoreInputField/Text"):GetComponent("Text")
-- 兽潮设定波次
this.btnMonsterWave = Util.GetGameObject(self.gameObject, "WaveSet/Button")
this.waveText = Util.GetGameObject(self.gameObject, "WaveSet/InputField/Text"):GetComponent("Text")
-- 任务状态完成
this.setTaskIdFinished = Util.GetGameObject(self.gameObject, "ProcessCtrl/setTaskIdFinished")
this.taskIdInputField = Util.GetGameObject(self.gameObject, "ProcessCtrl/taskIdInputField/Text"):GetComponent("Text")
-- 一键生成很多钱钱
this.btnGetMoney = Util.GetGameObject(self.gameObject, "btnGetMoney")
-- 一键上阵英雄全满级
this.btnHeroEnd = Util.GetGameObject(self.gameObject, "btnHeroEnd")
-- 科技树
this.btnTecTree = Util.GetGameObject(self.gameObject, "btnTecTree")
--天宫秘宝积分
this.setScoreOfHeaven = Util.GetGameObject(self.gameObject, "scoreOfHeaven/Button")
this.scoreOfHeavenInputField = Util.GetGameObject(self.gameObject, "scoreOfHeaven/InputField/Text"):GetComponent("Text")
-- 跳转测试
this.btnJump = Util.GetGameObject(self.gameObject, "jump/Button")
this.jumpId = Util.GetGameObject(self.gameObject, "jump/InputField/Text"):GetComponent("Text")
-- 跳转测试
this.xiaoyaoyou = Util.GetGameObject(self.gameObject, "xiaoyaoyou/Button")
this.xiaoyaoyouText = Util.GetGameObject(self.gameObject, "xiaoyaoyou/InputField/Text"):GetComponent("Text")
-- 添加圣物
this.btnAddHoly = Util.GetGameObject(self.gameObject, "HolyItem/Button")
this.HolyId = Util.GetGameObject(self.gameObject, "HolyItem/InputField/Text"):GetComponent("Text")
this._GMItemList = {}
this._GMItemRoot = {}
this._GMTypeBtn = {}
for _, type in pairs(GMType) do
this._GMItemRoot[type] = Util.GetGameObject(self.gameObject, "list"..type)
this._GMTypeBtn[type] = Util.GetGameObject(self.gameObject, "btn"..type)
end
this._GMItem = Util.GetGameObject(self.gameObject, "item")
end
--绑定事件(用于子类重写)
function GMPanel:BindEvent()
Util.AddClick(this.setTaskIdFinished, function()
NetManager.GMEvent("20#0#" .. this.taskIdInputField.text, function()
end)
end)
Util.AddClick(this.setTreasureScore, function()
NetManager.GMEvent("15#" .. this.treasureScoreInputField.text .. "#0", function()
TreasureOfSomebodyManagerV2.SetCurrentLevel(tonumber(this.treasureScoreInputField.text))
end)
end)
Util.AddClick(this.unlockAlianInvasion, function()
NetManager.GMEvent("13#"..this.unlockAlianInvasionText.text.."#" .. this.unlockAlianInvasionText.text)
end)
Util.AddClick(this.setVipLevel, function()
NetManager.GMEvent("11#" .. this.vipLevelInputField.text .. "#" .. this.vipLevelInputField.text, function()
VipManager.SetVipLevel(tonumber(this.vipLevelInputField.text))
end)
end)
Util.AddClick(this.confirmRecharge, function()
end)
Util.AddClick(this.BtnBack, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
@ -172,214 +119,114 @@ function GMPanel:BindEvent()
Util.AddClick(this.btnSureChange, function()
NetManager.GMEvent("10#4#" .. this.updateServerNowTimeText.text)
end)
Util.AddClick(this.updateNameBtn, function()
NetManager.GMEvent("12#0#" .. this.inputNameText.text)
Util.AddClick(this.btnRefreshServerTime, function()
this.RefreshServerTime()
end)
-- 测试跳过序章
Util.AddClick(this.btnPassMap, function ()
NetManager.MapInfoRequest(1, function ()
NetManager.MapOutRequest(0, function ()
PopupTipPanel.ShowTip(Language[11153])
end)
end)
end)
Util.AddClick(this.fullLevel, function()
NetManager.GMEvent("7#" .. this.Placeholder.text .. "#0")
end)
Util.AddClick(this.btnPassFight, function()
NetManager.GMEvent("8#1#1")
this.passText.text = Language[11154]
end)
Util.AddClick(this.btnMaxLv, function()
NetManager.GMEvent("7#100#0")
end)
Util.AddClick(this.searchMap, function()
Log(Language[11155] .. "5#" .. this.searchMapInputField.text .. "#0")
NetManager.GMEvent("5#" .. this.searchMapInputField.text .. "#0")
end)
chooseID = 1
Util.AddClick(this.btnGenRole, function()
if not this.strMsg.text or this.strMsg.text == "" then
for k,v in ConfigPairs(ConfigManager.GetConfig(ConfigName.EquipConfig)) do
local str=chooseID.."#"..v.Id.."#"..5
LogBlue(str)
NetManager.GMEvent(str)
end
for k,v in ConfigPairs(ConfigManager.GetConfig(ConfigName.JewelConfig)) do
local str=chooseID.."#"..v.Id.."#"..5
LogBlue(str)
NetManager.GMEvent(str)
end
return
end
local str = chooseID .. "#" .. this.strMsg.text
Log(str)
NetManager.GMEvent(str)
end)
Util.AddClick(this.GenerateHero, function()
if not this.strInputFieldHeroMsg.text or this.strInputFieldHeroMsg.text == "" then
for k,v in ConfigPairs(ConfigManager.GetConfig(ConfigName.HeroConfig)) do
local str= 4 .. "#" .. v.Id .. "#" ..v.MaxRank
LogBlue(str)
NetManager.GMEvent(str)
end
return
end
Log(this.strInputFieldHeroMsg.text)
NetManager.GMEvent(this.strInputFieldHeroMsg.text)
end)
Util.AddClick(this.GenerateTalisman, function()
local InputFieldTalismanStr = "19#"..this.InputFieldTalisman.text
Log(InputFieldTalismanStr)
NetManager.GMEvent(InputFieldTalismanStr)
end)
Util.AddClick(this.passLevel, function()
local InputFieldpassLevelStr = "9#"..this.InputFieldpassLevel.text.."#"..this.InputFieldpassLevel.text
Log(InputFieldpassLevelStr)
NetManager.GMEvent(InputFieldpassLevelStr)
end)
Util.AddClick(this.sendMailBtn, function()
NetManager.GMEvent(this.strInputMailMsg.text)
end)
Util.AddClick(this.allItemBtn, function()
NetManager.GMEvent("6#0#0")
end)
Util.AddClick(this.diffMonsterBtn, function()
NetManager.GMEvent("22#0#0")
end)
Util.AddClick(this.GenerateFiveHero, function()
for i=1, #heroList do
NetManager.GMEvent(heroList[i])
end
end)
Util.AddClick(this.btnGo, function()
if RoomManager.IsMatch == 0 then
--请求匹配房间
RoomManager.RoomMatchRequest(1, function ()
this.btnGoText.text = Language[11156]
end)
else
RoomManager.RoomCancelMatchRequest(1, function ()
this.btnGoText.text = Language[11157]
end)
end
end)
local monsterId = 10101
Util.AddClick(this.btnBattleGo, function()
if this.MonsterIdText.text == "" then
require("Modules.Main.BattleData1")
local data = testBattleData1
local testFightData = {
fightData = data,
fightSeed = 1600950572,
fightType = 0,
maxRound = 20
}
UIManager.OpenPanel(UIName.BattlePanel, testFightData, BATTLE_TYPE.Test)
return
end
monsterId = tonumber(this.MonsterIdText.text)
if #FormationManager.formationList[FormationManager.curFormationIndex].teamHeroInfos == 0 then
PopupTipPanel.ShowTip(Language[10702])
else
local MonsterGroup = ConfigManager.GetConfig(ConfigName.MonsterGroup)
if not MonsterGroup[monsterId] then
PopupTipPanel.ShowTip(Language[10706] .. monsterId .. Language[10707])
else
UIManager.OpenPanel(UIName.BattlePanel, BattleManager.GetBattleData(1, monsterId), nil, nil, nil, monsterId, nil)
--
for _, type in pairs(GMType) do
this._GMTypeBtn[type] = Util.GetGameObject(self.gameObject, "btn"..type)
Util.AddOnceClick(this._GMTypeBtn[type], function()
for _, type2 in pairs(GMType) do
this._GMItemRoot[type2]:SetActive(type == type2)
end
end)
end
end
-- 设置孙龙积分
function this.SetSunLongScroe(text)
TreasureOfSomebodyManagerV2.SetCurrentLevel(tonumber(text))
end
--设置vip
function this.SetVip(text)
VipManager.SetVipLevel(tonumber(text))
end
-- 一键五个银熊
function this.FiveHero()
for i=1, #heroList do
NetManager.GMEvent(heroList[i])
end
end
-- 一键很多钱
function this.GetMoney()
local index = 1
local time = Timer.New(function ()
NetManager.GMEvent(moneyList[index])
index = index + 1
end, 1, 6, true)
time:Start()
end
-- 测试跳转
function this.TestJump(text)
JumpManager.GoJump(tonumber(text))
end
-- 添加圣物
function this.AddHoly(text)
local command = "//addholy %s %s"
command = string.format(command, PlayerManager.uid, text)
ChatManager.RequestGMCommand(command)
end
-- 进入战斗测试场景
function this.GoTestBattle()
UIManager.OpenPanel(UIName.BattleTestPanel)
end
-- 挑战怪物
function this.ChallengeMonster(text)
local monsterId = tonumber(text)
if #FormationManager.formationList[FormationManager.curFormationIndex].teamHeroInfos == 0 then
PopupTipPanel.ShowTip(Language[10702])
else
local MonsterGroup = ConfigManager.GetConfig(ConfigName.MonsterGroup)
if not MonsterGroup[monsterId] then
PopupTipPanel.ShowTip(Language[10706] .. monsterId .. Language[10707])
else
UIManager.OpenPanel(UIName.BattlePanel, BattleManager.GetBattleData(1, monsterId), nil, nil, nil, monsterId, nil)
end
end)
Util.AddClick(this.btnTestBattle, function()
UIManager.OpenPanel(UIName.BattleTestPanel)
end)
end
end
Util.AddClick(this.btnGuideGo, function()
if this.GuideInputText.text ~= "" then
local strs = string.split(this.GuideInputText.text, "#")
NetManager.SaveGuideDataRequest(tonumber(strs[1]), tonumber(strs[2]))
end
end)
-- 试炼副本跳层
Util.AddClick(this.btnJumpLevel, function ()
local str = this.levelText.text
if tonumber(str) <= 1 then Log(Language[11158]) return end
str = "14#" .. tonumber(str) .. "#0"
NetManager.GMEvent(str, function ()
PopupTipPanel.ShowTip(Language[11159])
end)
end)
-- 兽潮选定波次
Util.AddClick(this.btnMonsterWave, function ()
local str = tostring(this.waveText.text)
if not str or str == "" then
PopupTipPanel.ShowTip(Language[11160]) return end
str = string.format("16#%s#0", str)
NetManager.GMEvent(str, function ()
PopupTipPanel.ShowTip(Language[11159])
end)
end)
-- 生成很多钱
Util.AddClick(this.btnGetMoney, function ()
local index = 1
local time = Timer.New(function ()
NetManager.GMEvent(moneyList[index])
index = index + 1
end, 1, 6, true)
time:Start()
end)
-- 一键上阵英雄全满级
Util.AddClick(this.btnHeroEnd, function ()
NetManager.GMEvent("21#21#21", function ()
PopupTipPanel.ShowTip(Language[11159])
end)
end)
Util.AddClick(this.btnTecTree, function ()
NetManager.GMEvent("21#0#0", function ()
PopupTipPanel.ShowTip(Language[11161])
end)
end)
--增加天宫秘宝积分
Util.AddClick(this.setScoreOfHeaven, function()
local score = "23#0#0"..this.scoreOfHeavenInputField.text
NetManager.GMEvent(score)
Log(Language[11162]..this.scoreOfHeavenInputField.text)
end)
--增加天宫秘宝积分
Util.AddClick(this.btnJump, function()
JumpManager.GoJump(tonumber(this.jumpId.text))
end)
--逍遥游
Util.AddClick(this.xiaoyaoyou, function()
Log("gm逍遥游"..this.xiaoyaoyouText.text)
NetManager.GMEvent(this.xiaoyaoyouText.text)
end)
function this.RunFakeBattle(fakeId)
fakeId = tonumber(fakeId)
local fdata = BattleManager.GetFakeBattleData(fakeId)
local fseed = 0
--增加圣物
Util.AddClick(this.btnAddHoly, function()
if this.HolyId.text == "" then
PopupTipPanel.ShowTip(Language[12199])
return
end
local command = "//addholy %s %s"
command = string.format(command, PlayerManager.uid, this.HolyId.text)
ChatManager.RequestGMCommand(command)
-- local score = "23#0#0"..this.HolyId.text
-- NetManager.GMEvent(score)
local testFightData = {
fightData = fdata,
fightSeed = fseed,
fightType = 0,
maxRound = 20
}
UIManager.OpenPanel(UIName.BattlePanel, testFightData, BATTLE_TYPE.Test)
end
-- 战斗数据
function this.RunBattleData(data, seed)
require("Modules.Main.BattleData1")
local fdata = (data and data ~= "") and data or testBattleData1
local fseed = (seed and seed ~= "") and seed or testBattleSeed
if not fdata or not fseed then
LogError("战斗数据错误")
return
end
local testFightData = {
fightData = fdata,
fightSeed = fseed,
fightType = 0,
maxRound = 20
}
UIManager.OpenPanel(UIName.BattlePanel, testFightData, BATTLE_TYPE.Test)
end
-- 刷新服务器时间
function this.RefreshServerTime()
NetManager.GMEvent("10#1#0", function(msg)
this.serverNowTimeText.text = msg.info
end)
NetManager.GMEvent("10#2#0", function(msg)
this.serverOpenTimeText.text = msg.info
end)
NetManager.GMEvent("10#3#0", function(msg)
this.serverCreateRoleTimeText.text = msg.info
end)
end
@ -395,17 +242,58 @@ end
--界面打开时调用(用于子类重写)
function GMPanel:OnOpen(...)
NetManager.GMEvent("10#1#0", function(msg)
this.serverNowTimeText.text = msg.info
end)
NetManager.GMEvent("10#2#0", function(msg)
this.serverOpenTimeText.text = msg.info
end)
NetManager.GMEvent("10#3#0", function(msg)
this.serverCreateRoleTimeText.text = msg.info
end)
-- 刷新时间
this.RefreshServerTime()
this.btnGoText.text = RoomManager.IsMatch == 1 and Language[11156] or Language[11157]
-- 初始化界面显示
for id, config in ipairs(_GMConfig) do
if not this._GMItemList[id] then
local go = newObjToParent(this._GMItem, this._GMItemRoot[config.type])
this._GMItemList[id] = go
local btn = Util.GetGameObject(go, "Button")
local btnText = Util.GetGameObject(btn, "Text"):GetComponent("Text")
btnText.text = config.btnTip
local input = {}
for i = 1, 2 do
input[i] = Util.GetGameObject(go, "InputField"..i):GetComponent("InputField")
input[i].gameObject:SetActive(config.inputNum >= i)
Util.GetGameObject(input[i].gameObject, "Placeholder"):GetComponent("Text").text = config.inputTip[i] or ""
end
Util.AddClick(btn, function()
-- 构建参数
local args = {}
for i = 1, config.inputNum do
if input[i].text == "" then
LogError("参数错误")
return
end
table.insert(args, input[i].text)
end
--
if config.subType == GMSubType.Server then
local gmstr = string.format(config.args, unpack(args))
NetManager.GMEvent(gmstr, function()
if config.callBack then
config.callBack(unpack(args))
end
PopupTipPanel.ShowTip("GM应用成功")
end)
elseif config.subType == GMSubType.Func then
if config.callBack then
config.callBack(unpack(args))
end
PopupTipPanel.ShowTip("GM应用成功")
end
end)
end
-- 默认打开玩家相关GM
for _, type in pairs(GMType) do
this._GMItemRoot[type]:SetActive(type == GMType.Player)
end
end
end
--界面关闭时调用(用于子类重写)
@ -415,7 +303,8 @@ end
--界面销毁时调用(用于子类重写)
function GMPanel:OnDestroy()
this._GMItemRoot = {}
this._GMItemList = {}
end
return GMPanel