From 5e09e0b9a3f6507db5be9ec0c6dc1a4d6430e441 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Fri, 19 Nov 2021 16:16:45 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=81=B5=E8=84=89=E7=A7=98=E5=A2=83?= =?UTF-8?q?=E3=80=91=E5=88=87=E7=A3=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Formation/View/LingMaiFormation.lua | 82 ++++++++++++------- .../LingMaiMiJing/LingMaiMiJingManager.lua | 8 +- .../~Lua/Modules/Popup/PlayerInfoPopup.lua | 8 +- 3 files changed, 63 insertions(+), 35 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/LingMaiFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/LingMaiFormation.lua index c9a893307b..09c91be08d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/View/LingMaiFormation.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/LingMaiFormation.lua @@ -8,10 +8,13 @@ local hadClick = false this.nodeData = {} local curFormationTypeDef --- 逻辑初始化 -function this.Init(root, _nodeData) +function this.Init(root,...) this.spLoader = SpriteLoader.New() this.root = root - this.nodeData = _nodeData + local temp = {...} + LogGreen("temp[1]:"..tostring(temp[1]).." temp[2]:"..tostring(temp[2])) + this.nodeData = temp[1] + this.isTest = temp[2] and temp[2] or false this.InitView() end --- 获取需要显示的编队id @@ -69,36 +72,57 @@ function this.StartFight() PopupTipPanel.ShowTip(string.format(Language[10699], 1)) return end - if this.nodeData.uid == PlayerManager.uid then - this.root:ClosePanel() - else - NetManager.LingMaiBattleRequest(this.nodeData.Id,2030,function (msg) - PrivilegeManager.RefreshPrivilegeUsedTimes(2030, 1)--更新特权 + if this.isTest then + LogRed("#################") + PlayerManager.RequestPlayWithSomeOne(this.nodeData.uid, FormationTypeDef.FORMATION_LINGMAIMIJING, this.nodeData.name, function(result) this.root:ClosePanel() + local arg = {} + arg.result = result.result + arg.blue = {} + arg.blue.uid = PlayerManager.uid + arg.blue.name = PlayerManager.nickName + arg.blue.head = PlayerManager.head + arg.blue.frame = HeadManager.GetCurFrameId() + arg.red= {} + arg.red.uid = this.nodeData.uid + arg.red.name = this.nodeData.name + arg.red.head = this.nodeData.head + arg.red.frame = this.nodeData.headFrame - local num = this.nodeData.uid > 0 and 1 or 0 - local fightData = BattleManager.GetBattleServerData(msg,num) - LingMaiMiJingManager.battleResult = msg - UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.LINGMAIMIJING,function () - local arg = {} - arg.panelType=2 - arg.result = msg.result - arg.blue = {} - arg.blue.uid = PlayerManager.uid - arg.blue.name = PlayerManager.nickName - arg.blue.head = PlayerManager.head - arg.blue.frame = HeadManager.GetCurFrameId() - arg.red= {} - arg.red.uid = this.nodeData.uid - arg.red.name = this.nodeData.name - arg.red.head = this.nodeData.head - arg.red.frame = this.nodeData.headFrame - -- 不用回放直接显示结果 - UIManager.OpenPanel(UIName.ArenaResultPopup, arg) - end):SetResult(msg.result) - - end) + -- 不用回放直接显示结果 + UIManager.OpenPanel(UIName.ArenaResultPopup, arg) + end,this.isTest) + else + if this.nodeData.uid == PlayerManager.uid then + this.root:ClosePanel() + else + NetManager.LingMaiBattleRequest(this.nodeData.Id,2030,function (msg) + PrivilegeManager.RefreshPrivilegeUsedTimes(2030, 1)--更新特权 + this.root:ClosePanel() + local num = this.nodeData.uid > 0 and 1 or 0 + local fightData = BattleManager.GetBattleServerData(msg,num) + LingMaiMiJingManager.battleResult = msg + UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.LINGMAIMIJING,function () + local arg = {} + arg.panelType=2 + arg.result = msg.result + arg.blue = {} + arg.blue.uid = PlayerManager.uid + arg.blue.name = PlayerManager.nickName + arg.blue.head = PlayerManager.head + arg.blue.frame = HeadManager.GetCurFrameId() + arg.red= {} + arg.red.uid = this.nodeData.uid + arg.red.name = this.nodeData.name + arg.red.head = this.nodeData.head + arg.red.frame = this.nodeData.headFrame + -- 不用回放直接显示结果 + UIManager.OpenPanel(UIName.ArenaResultPopup, arg) + end):SetResult(msg.result) + end) + end end + end return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/LingMaiMiJing/LingMaiMiJingManager.lua b/Assets/ManagedResources/~Lua/Modules/LingMaiMiJing/LingMaiMiJingManager.lua index 0a376d8e15..6afc5aff0e 100644 --- a/Assets/ManagedResources/~Lua/Modules/LingMaiMiJing/LingMaiMiJingManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/LingMaiMiJing/LingMaiMiJingManager.lua @@ -89,13 +89,12 @@ function this.GetLingMaiServerData(msg,func) this.lingmaiData = msg.lingmaiData for i = 1, #msg.lingmaiData do this.curPage = lodeConfig[msg.lingmaiData[i].lingmaiId].PageNo - LogYellow("id:"..tostring(msg.lingmaiData[i].lingmaiId).." uid:"..tostring(msg.lingmaiData[i].uid).." name:"..tostring(msg.lingmaiData[i].name) - .." practiceLevel:"..tostring(msg.lingmaiData[i].practiceLevel).." servername:"..tostring(msg.lingmaiData[i].servername)) + -- LogYellow("id:"..tostring(msg.lingmaiData[i].lingmaiId).." uid:"..tostring(msg.lingmaiData[i].uid).." name:"..tostring(msg.lingmaiData[i].name) + -- .." practiceLevel:"..tostring(msg.lingmaiData[i].practiceLevel).." servername:"..tostring(msg.lingmaiData[i].servername)) msg.lingmaiData[i].name = PracticeManager.SetNameColor(msg.lingmaiData[i].name,msg.lingmaiData[i].practiceLevel) end - LogGreen("state:"..tostring(msg.state).." myPlaceId:"..tostring(msg.myOccupyId).." startTime:"..tostring(msg.myOccupyTime) + Log("state:"..tostring(msg.state).." myPlaceId:"..tostring(msg.myOccupyId).." startTime:"..tostring(msg.myOccupyTime) .." fightTime:"..tostring(msg.remainChangeTimes).." lingmaiData:"..tostring(#msg.lingmaiData).." curPage:"..tostring(this.curPage).." timePoint:"..tostring(msg.timePoint)) - -- Game.GlobalEvent:DispatchEvent(GameEvent.LingMaiMiJing.RefreshPanel) if func then func() end @@ -108,7 +107,6 @@ function this.OpenRecord() end function this.CheckPrivilage(func) - -- LogBlue("特权2030:"..tostring(PrivilegeManager.GetPrivilegeRemainValue(2030)).." 特权2031:"..tostring(PrivilegeManager.GetPrivilegeRemainValue(2031))) if PrivilegeManager.GetPrivilegeRemainValue(2030) <= 0 then if PrivilegeManager.GetPrivilegeRemainValue(2031) > 0 then local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP,10044, 1) diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua index 7a317b424a..0d23b00d16 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua @@ -83,7 +83,7 @@ local _ViewConfig = { tip = "灵脉秘境阵容:", isAddFriend = false, btnType = { - {name = "切磋", func = 3}, + {name = "切磋", func = 8}, {name = "挑战", func = 8}, {name = "调整编队", func = 8}, } @@ -557,10 +557,16 @@ end function this.LingMaiFormaion() if this.data.uid == PlayerManager.uid then this:ClosePanel() + Log("调整编队") UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.LINGMAIMIJING, this.data) + elseif this.data.Id > LingMaiMiJingManager.myPlaceId then + this:ClosePanel() + Log("切磋") + UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.LINGMAIMIJING, this.data,true) else LingMaiMiJingManager.CheckPrivilage(function () this:ClosePanel() + Log("正常战斗") UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.LINGMAIMIJING, this.data) end) end