2020-11-03 19:19:13 +08:00
|
|
|
|
-- 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")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
GMPanel = Inherit(BasePanel)
|
2020-11-03 19:19:13 +08:00
|
|
|
|
local this = GMPanel
|
2020-12-08 15:03:59 +08:00
|
|
|
|
|
2020-07-29 19:35:29 +08:00
|
|
|
|
local heroList = {
|
2020-12-03 18:36:01 +08:00
|
|
|
|
"4#10033#11", "4#10026#11", "4#10008#11", "4#10012#11", "4#10015#11","4#10014#11","4#10033#10","4#10026#10","4#10008#10","4#10012#10","4#10015#10","4#10014#10"
|
2020-07-29 19:35:29 +08:00
|
|
|
|
}
|
2020-12-08 15:03:59 +08:00
|
|
|
|
local baowuList = {
|
|
|
|
|
"1#100005#1", "1#100010#1", "1#100015#1", "1#100020#1", "1#100025#1","1#100030#1", "1#100035#1","1#100040#1"
|
|
|
|
|
}
|
|
|
|
|
local equipeList = {
|
|
|
|
|
"1#60159#1", "1#60184#1", "1#60194#1", "1#60199#1"
|
|
|
|
|
}
|
|
|
|
|
local moneyList = {"1#3#99999999", "1#4#99999999", "1#5#99999999", "1#14#99999999", "1#15#99999999", "1#16#99999999"}
|
2020-05-09 13:31:21 +08:00
|
|
|
|
--初始化组件(用于子类重写)
|
|
|
|
|
function GMPanel:InitComponent()
|
|
|
|
|
|
2021-01-09 13:53:48 +08:00
|
|
|
|
---
|
|
|
|
|
--- type 所属页签的类型 player 玩家页签 Function 功能类型 Battle 战斗相关
|
|
|
|
|
--- subType 类型 Server 直接向服务器请求的GM Func 回调某个方法的GM
|
|
|
|
|
---
|
2020-11-03 19:19:13 +08:00
|
|
|
|
_GMConfig = {
|
2021-04-09 18:02:32 +08:00
|
|
|
|
{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},
|
2020-11-03 19:19:13 +08:00
|
|
|
|
-- {type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "13#%s#0", btnTip = "解锁", inputTip = {"外敌ID"}, callBack = nil},
|
2021-04-09 18:02:32 +08:00
|
|
|
|
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "11#%s#0", btnTip = "确定", inputTip = {"输入Vip等级"}, callBack = this.SetVip},
|
|
|
|
|
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "7#%s#0", btnTip = "角色升级",inputTip = {"输入等级"}, callBack = this.LVPlayer},
|
2020-11-03 19:19:13 +08:00
|
|
|
|
-- {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},
|
2021-04-09 18:02:32 +08:00
|
|
|
|
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "1#%s", btnTip = "生成道具", inputTip = {"道具ID#道具数量"}, callBack = nil},
|
|
|
|
|
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "批量生成道具", inputTip = {"道具ID#道具数量|..."}, callBack = this.GetManyItems},
|
|
|
|
|
{type = GMType.Player, subType = GMSubType.Server, inputNum = 1, args = "4#%s", btnTip = "生成英雄", inputTip = {"英雄ID#星级"}, callBack = nil},
|
|
|
|
|
{type = GMType.Player, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "批量生成英雄", inputTip = {"英雄ID#星级|..."}, callBack = this.GetManyHeros},
|
|
|
|
|
{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.Func, inputNum = 1, args = "", btnTip = "添加圣物", inputTip = {"输入圣物ID"}, callBack = this.AddHoly},
|
|
|
|
|
{type = GMType.Player, subType = GMSubType.Server, inputNum = 0, args = "8#1#1", btnTip = "通关所有关卡", inputTip = {}, callBack = nil},
|
2020-11-03 19:19:13 +08:00
|
|
|
|
-- {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},
|
2021-04-09 18:02:32 +08:00
|
|
|
|
{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.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "生成顶级魂灵宝", inputTip = {""}, callBack = this.Baowu},
|
|
|
|
|
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "生成顶级装备", inputTip = {""}, callBack = this.GetEquipe},
|
|
|
|
|
{type = GMType.Player, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "生成很多物品", inputTip = {""}, callBack = this.GetAllItems},
|
|
|
|
|
|
|
|
|
|
{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},
|
2021-05-15 17:38:58 +08:00
|
|
|
|
{type = GMType.Function, subType = GMSubType.Func, inputNum = 2, args = "", btnTip = "功能引导测试", inputTip = {"请输入功能ID", "1去主界面2去挂机界面"}, callBack = this.TestFuncGuide},
|
2021-04-09 18:02:32 +08:00
|
|
|
|
{type = GMType.Function, subType = GMSubType.Func, inputNum = 0, args = "", btnTip = "红点Debug", inputTip = {""}, callBack = this.OpenRedDebug},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{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},
|
|
|
|
|
{type = GMType.Battle, subType = GMSubType.Func, inputNum = 1, args = "", btnTip = "演算后端战斗", inputTip = {"输入战斗id"}, callBack = this.RunServerBattle},
|
2020-11-03 19:19:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.BtnBack = Util.GetGameObject(self.transform, "btnBack")
|
|
|
|
|
|
|
|
|
|
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")
|
2020-11-03 19:19:13 +08:00
|
|
|
|
this.btnSureChange = Util.GetGameObject(self.transform, "TimeCtrl/Button")
|
|
|
|
|
this.btnRefreshServerTime = Util.GetGameObject(self.transform, "TimeCtrl/Button2")
|
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
2020-11-03 19:19:13 +08:00
|
|
|
|
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")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
2021-03-22 16:22:55 +08:00
|
|
|
|
function GMPanel.LVPlayer(lv)
|
|
|
|
|
NetManager.GMEvent(string.format("7#%s#0",lv))
|
2021-03-24 10:55:33 +08:00
|
|
|
|
local cor = coroutine.start(function()
|
|
|
|
|
coroutine.wait(1)
|
|
|
|
|
Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnLevelChange)
|
2021-04-21 16:36:12 +08:00
|
|
|
|
--LogGreen("升级了")
|
2021-03-24 10:55:33 +08:00
|
|
|
|
end)
|
2021-03-22 16:22:55 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
--绑定事件(用于子类重写)
|
|
|
|
|
function GMPanel:BindEvent()
|
|
|
|
|
Util.AddClick(this.BtnBack, function()
|
|
|
|
|
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
|
|
|
|
self:ClosePanel()
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
Util.AddClick(this.btnSureChange, function()
|
|
|
|
|
NetManager.GMEvent("10#4#" .. this.updateServerNowTimeText.text)
|
|
|
|
|
end)
|
2020-11-03 19:19:13 +08:00
|
|
|
|
Util.AddClick(this.btnRefreshServerTime, function()
|
|
|
|
|
this.RefreshServerTime()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end)
|
2020-11-03 19:19:13 +08:00
|
|
|
|
--
|
|
|
|
|
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
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end)
|
2020-11-03 19:19:13 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
2021-01-09 13:53:48 +08:00
|
|
|
|
function this.GetManyItems(text)
|
2021-04-09 18:02:32 +08:00
|
|
|
|
if text == "一键装备" then
|
2021-03-17 17:34:14 +08:00
|
|
|
|
local config = ConfigPairs(ConfigManager.GetConfig(ConfigName.EquipConfig))
|
|
|
|
|
local cor = coroutine.start(function()
|
|
|
|
|
for k,v in (config) do
|
|
|
|
|
if v.Position < 5 then
|
|
|
|
|
local str = "1#" .. v.Id .."#" .. 1
|
|
|
|
|
NetManager.GMEvent(str)
|
|
|
|
|
coroutine.wait(0.1)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
return
|
|
|
|
|
end
|
2021-04-09 18:02:32 +08:00
|
|
|
|
if text == "一键宝器" then
|
2021-03-17 17:34:14 +08:00
|
|
|
|
local config = ConfigPairs(ConfigManager.GetConfig(ConfigName.JewelConfig))
|
|
|
|
|
local cor = coroutine.start(function()
|
|
|
|
|
for k,v in (config) do
|
|
|
|
|
local str = "1#" .. v.Id .."#" .. 10
|
|
|
|
|
NetManager.GMEvent(str)
|
|
|
|
|
coroutine.wait(0.1)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
return
|
|
|
|
|
end
|
2021-04-09 18:02:32 +08:00
|
|
|
|
if text == "一键魂印" then
|
2021-03-17 17:34:14 +08:00
|
|
|
|
local config = ConfigPairs(ConfigManager.GetConfig(ConfigName.EquipConfig))
|
|
|
|
|
local cor = coroutine.start(function()
|
|
|
|
|
for k,v in (config) do
|
|
|
|
|
if v.Position == 5 then
|
|
|
|
|
local str = "1#" .. v.Id .."#" .. 1
|
|
|
|
|
NetManager.GMEvent(str)
|
|
|
|
|
coroutine.wait(0.1)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
return
|
|
|
|
|
end
|
2021-04-09 18:02:32 +08:00
|
|
|
|
if text == "一键灵兽" then
|
2021-03-22 17:05:00 +08:00
|
|
|
|
local config = ConfigPairs(ConfigManager.GetConfig(ConfigName.SpiritAnimal))
|
|
|
|
|
local cor = coroutine.start(function()
|
|
|
|
|
for k,v in (config) do
|
|
|
|
|
local str = "1#" .. v.Id .."#" .. 1
|
|
|
|
|
NetManager.GMEvent(str)
|
|
|
|
|
coroutine.wait(0.1)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
return
|
|
|
|
|
end
|
2021-03-17 17:34:14 +08:00
|
|
|
|
if text and text ~= "" then
|
|
|
|
|
local list = string.split(text, "|")
|
|
|
|
|
local cor = coroutine.start(function()
|
|
|
|
|
for _, str in ipairs(list) do
|
|
|
|
|
local item = string.split(str, "#")
|
|
|
|
|
local itemid = tonumber(item[1])
|
|
|
|
|
if not itemid then
|
|
|
|
|
local config = ConfigManager.GetConfigDataByKey(ConfigName.ItemConfig,"Name",item[1])
|
|
|
|
|
if config then
|
|
|
|
|
itemid = config.Id
|
|
|
|
|
else
|
|
|
|
|
itemid = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if itemid then
|
|
|
|
|
local str1 = "1#" .. itemid .."#" .. item[2]
|
|
|
|
|
NetManager.GMEvent(str1)
|
|
|
|
|
coroutine.wait(0.1)
|
|
|
|
|
end
|
|
|
|
|
end
|
2021-04-21 16:36:12 +08:00
|
|
|
|
--LogGreen("物品批量生成完成")
|
2021-03-17 17:34:14 +08:00
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
2021-01-09 13:53:48 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this.GetManyHeros(text)
|
2021-03-17 17:34:14 +08:00
|
|
|
|
if text and text ~= "" then
|
|
|
|
|
local list = string.split(text, "|")
|
|
|
|
|
local cor = coroutine.start(function()
|
|
|
|
|
for _, str in ipairs(list) do
|
|
|
|
|
local item = string.split(str, "#")
|
|
|
|
|
local itemid = tonumber(item[1])
|
|
|
|
|
if not itemid then
|
|
|
|
|
local config = ConfigManager.GetConfigDataByKey(ConfigName.HeroConfig,"ReadingName",item[1])
|
|
|
|
|
if config then
|
|
|
|
|
itemid = config.Id
|
|
|
|
|
else
|
|
|
|
|
itemid = 0
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if itemid and itemid < 10 and itemid > 0 then
|
|
|
|
|
for k,v in ConfigPairs(ConfigManager.GetConfig(ConfigName.HeroConfig)) do
|
|
|
|
|
if v.PropertyName == itemid and v.MaxRank >= tonumber(item[2]) and v.Star <= tonumber(item[2]) then
|
|
|
|
|
local str1 = "4#" .. v.Id .."#" .. item[2]
|
|
|
|
|
NetManager.GMEvent(str1)
|
|
|
|
|
coroutine.wait(0.1)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
elseif itemid and itemid > 0 then
|
|
|
|
|
local str1 = "4#" .. itemid .."#" .. item[2]
|
|
|
|
|
NetManager.GMEvent(str1)
|
|
|
|
|
coroutine.wait(0.1)
|
|
|
|
|
end
|
|
|
|
|
end
|
2021-04-21 16:36:12 +08:00
|
|
|
|
--LogGreen("英雄批量生成完成")
|
2021-03-17 17:34:14 +08:00
|
|
|
|
end)
|
|
|
|
|
end
|
2021-01-09 13:53:48 +08:00
|
|
|
|
end
|
2020-11-03 19:19:13 +08:00
|
|
|
|
-- 设置孙龙积分
|
|
|
|
|
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
|
2020-12-08 15:03:59 +08:00
|
|
|
|
-- 一键几个宝物
|
|
|
|
|
function this.Baowu()
|
|
|
|
|
for i=1, #baowuList do
|
|
|
|
|
NetManager.GMEvent(baowuList[i])
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- 一键顶级装备
|
|
|
|
|
function this.GetEquipe()
|
|
|
|
|
for i=1, #equipeList do
|
|
|
|
|
NetManager.GMEvent(equipeList[i])
|
|
|
|
|
end
|
|
|
|
|
end
|
2020-12-30 19:51:14 +08:00
|
|
|
|
|
|
|
|
|
-- 一键好多物品
|
2021-02-24 11:11:53 +08:00
|
|
|
|
function this.GetAllItems()
|
2020-12-30 19:51:14 +08:00
|
|
|
|
local ic = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
|
|
|
|
local i = 0
|
|
|
|
|
coroutine.start(function()
|
|
|
|
|
for id, value in ConfigPairs(ic) do
|
|
|
|
|
i = i + 1
|
|
|
|
|
if i >= 100 then
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
NetManager.GMEvent("1#"..id.."#1000000")
|
|
|
|
|
coroutine.wait(0.01)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
2020-11-03 19:19:13 +08:00
|
|
|
|
-- 一键很多钱
|
|
|
|
|
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
|
2021-01-28 11:42:05 +08:00
|
|
|
|
-- 测试功能引导
|
2021-05-15 17:38:58 +08:00
|
|
|
|
function this.TestFuncGuide(text, goType)
|
|
|
|
|
|
2021-01-28 11:42:05 +08:00
|
|
|
|
local gid = tonumber(text)
|
2021-05-15 17:38:58 +08:00
|
|
|
|
-- 判断要前往的界面
|
|
|
|
|
if goType == "1" then
|
|
|
|
|
GuideManager.AddFuncGuide(gid)
|
|
|
|
|
this:ClosePanel()
|
|
|
|
|
elseif goType == "2" then
|
|
|
|
|
GuideManager.AddFuncGuide(gid)
|
|
|
|
|
UIManager.OpenPanel(UIName.FightPointPassMainPanel)
|
|
|
|
|
else
|
|
|
|
|
PopupTipPanel.ShowTip("请输入要前往的界面")
|
|
|
|
|
end
|
|
|
|
|
|
2021-01-28 11:42:05 +08:00
|
|
|
|
end
|
2021-04-09 16:14:24 +08:00
|
|
|
|
-- 红点Debug
|
|
|
|
|
function this.OpenRedDebug()
|
|
|
|
|
UIManager.OpenPanel(UIName.RedpotDebugPanel)
|
|
|
|
|
end
|
2020-11-03 19:19:13 +08:00
|
|
|
|
-- 添加圣物
|
|
|
|
|
function this.AddHoly(text)
|
|
|
|
|
local command = "//addholy %s %s"
|
|
|
|
|
command = string.format(command, PlayerManager.uid, text)
|
2021-01-09 13:53:48 +08:00
|
|
|
|
Log(command)
|
2020-11-03 19:19:13 +08:00
|
|
|
|
ChatManager.RequestGMCommand(command)
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
2020-11-03 19:19:13 +08:00
|
|
|
|
-- 进入战斗测试场景
|
|
|
|
|
function this.GoTestBattle()
|
|
|
|
|
UIManager.OpenPanel(UIName.BattleTestPanel)
|
|
|
|
|
end
|
|
|
|
|
-- 挑战怪物
|
|
|
|
|
function this.ChallengeMonster(text)
|
|
|
|
|
local monsterId = tonumber(text)
|
|
|
|
|
if #FormationManager.formationList[FormationManager.curFormationIndex].teamHeroInfos == 0 then
|
2021-04-09 18:02:32 +08:00
|
|
|
|
PopupTipPanel.ShowTip("编队没人,请先上人!")
|
2020-11-03 19:19:13 +08:00
|
|
|
|
else
|
|
|
|
|
local MonsterGroup = ConfigManager.GetConfig(ConfigName.MonsterGroup)
|
|
|
|
|
if not MonsterGroup[monsterId] then
|
2021-04-09 18:02:32 +08:00
|
|
|
|
PopupTipPanel.ShowTip("怪物表id :" .. monsterId .. "不存在!")
|
2020-06-03 19:09:01 +08:00
|
|
|
|
else
|
2020-11-03 19:19:13 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.BattlePanel, BattleManager.GetBattleData(1, monsterId), nil, nil, nil, monsterId, nil)
|
2020-06-03 19:09:01 +08:00
|
|
|
|
end
|
2020-11-03 19:19:13 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
2020-12-17 18:36:08 +08:00
|
|
|
|
-- 假战斗数据
|
2020-11-03 19:19:13 +08:00
|
|
|
|
function this.RunFakeBattle(fakeId)
|
|
|
|
|
fakeId = tonumber(fakeId)
|
2020-11-06 14:15:03 +08:00
|
|
|
|
local fdata, fseed = BattleManager.GetFakeBattleData(fakeId)
|
2020-11-03 19:19:13 +08:00
|
|
|
|
local testFightData = {
|
|
|
|
|
fightData = fdata,
|
|
|
|
|
fightSeed = fseed,
|
|
|
|
|
fightType = 0,
|
|
|
|
|
maxRound = 20
|
|
|
|
|
}
|
|
|
|
|
UIManager.OpenPanel(UIName.BattlePanel, testFightData, BATTLE_TYPE.Test)
|
|
|
|
|
end
|
2020-12-17 18:36:08 +08:00
|
|
|
|
|
|
|
|
|
-- 请求服务器战斗数据
|
|
|
|
|
function this.RunServerBattle(fightId)
|
|
|
|
|
BattleManager.RequestBattleDataByFightId(fightId, function(fightData)
|
2021-04-21 16:36:12 +08:00
|
|
|
|
--LogGreen("战斗回调")
|
2020-12-17 18:36:08 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.Test)
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
2020-11-03 19:19:13 +08:00
|
|
|
|
-- 战斗数据
|
|
|
|
|
function this.RunBattleData(data, seed)
|
2020-11-11 16:04:01 +08:00
|
|
|
|
data = loadstring("return "..data)()
|
2020-11-11 16:10:21 +08:00
|
|
|
|
seed = tonumber(seed)
|
2020-11-03 19:19:13 +08:00
|
|
|
|
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
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
2020-11-03 19:19:13 +08:00
|
|
|
|
-- 刷新服务器时间
|
|
|
|
|
function this.RefreshServerTime()
|
|
|
|
|
NetManager.GMEvent("10#1#0", function(msg)
|
|
|
|
|
this.serverNowTimeText.text = msg.info
|
2020-05-25 19:16:23 +08:00
|
|
|
|
end)
|
2020-11-03 19:19:13 +08:00
|
|
|
|
NetManager.GMEvent("10#2#0", function(msg)
|
|
|
|
|
this.serverOpenTimeText.text = msg.info
|
2020-11-01 15:46:48 +08:00
|
|
|
|
end)
|
2020-11-03 19:19:13 +08:00
|
|
|
|
NetManager.GMEvent("10#3#0", function(msg)
|
|
|
|
|
this.serverCreateRoleTimeText.text = msg.info
|
2020-06-30 18:59:44 +08:00
|
|
|
|
end)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--添加事件监听(用于子类重写)
|
|
|
|
|
function GMPanel:AddListener()
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--移除事件监听(用于子类重写)
|
|
|
|
|
function GMPanel:RemoveListener()
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面打开时调用(用于子类重写)
|
|
|
|
|
function GMPanel:OnOpen(...)
|
2020-11-03 19:19:13 +08:00
|
|
|
|
-- 刷新时间
|
|
|
|
|
this.RefreshServerTime()
|
|
|
|
|
|
|
|
|
|
-- 初始化界面显示
|
|
|
|
|
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
|
2021-04-09 18:02:32 +08:00
|
|
|
|
PopupTipPanel.ShowTip("参数错误")
|
2020-12-17 18:36:08 +08:00
|
|
|
|
return
|
2020-11-03 19:19:13 +08:00
|
|
|
|
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
|
2021-04-09 18:02:32 +08:00
|
|
|
|
PopupTipPanel.ShowTip("GM应用成功")
|
2020-11-03 19:19:13 +08:00
|
|
|
|
end)
|
|
|
|
|
elseif config.subType == GMSubType.Func then
|
|
|
|
|
if config.callBack then
|
|
|
|
|
config.callBack(unpack(args))
|
|
|
|
|
end
|
2021-04-09 18:02:32 +08:00
|
|
|
|
PopupTipPanel.ShowTip("GM应用成功")
|
2020-11-03 19:19:13 +08:00
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
2020-11-03 19:19:13 +08:00
|
|
|
|
-- 默认打开玩家相关GM
|
|
|
|
|
for _, type in pairs(GMType) do
|
|
|
|
|
this._GMItemRoot[type]:SetActive(type == GMType.Player)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
|
|
|
function GMPanel:OnClose()
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
|
|
|
function GMPanel:OnDestroy()
|
2020-11-03 19:19:13 +08:00
|
|
|
|
this._GMItemRoot = {}
|
|
|
|
|
this._GMItemList = {}
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
2020-06-23 18:36:24 +08:00
|
|
|
|
return GMPanel
|