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()