好友切磋添加结果显示

dev_chengFeng
JieLing 2020-08-25 20:28:32 +08:00
parent 745150e59a
commit abd9e6b65a
2 changed files with 28 additions and 6 deletions

View File

@ -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

View File

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