From abd9e6b65a3595eaf7aeef16afec6e6b00ffd6ed Mon Sep 17 00:00:00 2001 From: JieLing Date: Tue, 25 Aug 2020 20:28:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=BD=E5=8F=8B=E5=88=87=E7=A3=8B=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=BB=93=E6=9E=9C=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Formation/View/PlayWithSBFormation.lua | 32 ++++++++++++++++--- .../~Lua/Modules/Popup/PlayerInfoPopup.lua | 2 +- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/PlayWithSBFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/PlayWithSBFormation.lua index d83760c6ed..62309fc45f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/View/PlayWithSBFormation.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/PlayWithSBFormation.lua @@ -5,16 +5,15 @@ local this = PlayWithSBFormation --- 是否需要切换编队的功能 this.IsNeedChangeFormation = true -function this.Init(root, uid, tname) +function this.Init(root, data) this.root = root - this.uid = uid - this.tname = tname + this.pData = data this.InitView() end --- 获取需要显示的编队id function this.GetFormationIndex() - return FormationManager.curFormationIndex + return FormationTypeDef.FORMATION_NORMAL end --- 提交按钮点击事件 function this.On_Btn1_Click() @@ -26,9 +25,32 @@ function this.On_Btn1_Click() PopupTipPanel.ShowTip(string.format(Language[10701], 1)) return end + + if not this.pData then + PopupTipPanel.ShowTip("为获取到玩家信息!") + return + end + + -- 请求开始挑战 - PlayerManager.RequestPlayWithSomeOne(this.uid, FormationManager.curFormationIndex, this.tname, function() + PlayerManager.RequestPlayWithSomeOne(this.pData.uid, FormationTypeDef.FORMATION_NORMAL, this.pData.name, function(result) this.root:ClosePanel() + + local arg = {} + arg.result = result + arg.blue = {} + arg.blue.uid = PlayerManager.uid + arg.blue.name = PlayerManager.nickName + arg.blue.head = PlayerManager.head + arg.blue.frame = PlayerManager.frame + arg.red= {} + arg.red.uid = this.pData.uid + arg.red.name = this.pData.name + arg.red.head = this.pData.head + arg.red.frame = this.pData.headFrame + + -- 不用回放直接显示结果 + UIManager.OpenPanel(UIName.ArenaResultPopup, arg) end) end diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua index a40750ce22..1963065e01 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua @@ -354,7 +354,7 @@ end -- 打他 function this.BeatHim() this:ClosePanel() - UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.PLAY, this._PlayerId) + UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.PLAY, this._PlayerData) end --界面关闭时调用(用于子类重写) function PlayerInfoPopup:OnClose()