[玉虚论道]=======开战添加相同神将屏蔽提示

dev_chengFeng
wangzhenxing 2022-05-25 13:58:31 +08:00
parent 4c259df154
commit 1c715438c8
1 changed files with 16 additions and 0 deletions

View File

@ -21,6 +21,8 @@ local leftAllTeam={}
local rightAllTeam={} local rightAllTeam={}
local myOldScore=0 local myOldScore=0
local enOldScore=0 local enOldScore=0
local allMyHeros={}
local isSame=false
local function OnBeginDrag(self, Pointgo, data) local function OnBeginDrag(self, Pointgo, data)
if state~=1 then if state~=1 then
return return
@ -285,6 +287,10 @@ function WorldArenaBattleInfoPanel:BindEvent()
return return
end end
end end
if isSame then
PopupTipPanel.ShowTip("检测到多个阵容使用相同神将,无法开战")
return
end
NetManager.CrossYuXuLunDaoChallengeRequest(list,enemyId,costType,function(msg) NetManager.CrossYuXuLunDaoChallengeRequest(list,enemyId,costType,function(msg)
resultList=msg.fightResult resultList=msg.fightResult
fightDataList=msg.fightData fightDataList=msg.fightData
@ -571,6 +577,12 @@ function this.SetTeamInfo(_go,teamData,type)
elseif starType == 2 then elseif starType == 2 then
starSize = Vector2.New(48,48) starSize = Vector2.New(48,48)
end end
if type==1 and isSame==false then
isSame=BattleUtil.ChecklistIsContainValue(allMyHeros,hero.heroid)
if isSame==false then
table.insert(allMyHeros,hero.heroid)
end
end
SetHeroStars(this.spLoader, teamList[hero.position].starGrid, star,starType,starSize,starScale) SetHeroStars(this.spLoader, teamList[hero.position].starGrid, star,starType,starSize,starScale)
Util.SetParticleSortLayer(teamList[hero.position].starGrid,this.sortingOrder + 1) Util.SetParticleSortLayer(teamList[hero.position].starGrid,this.sortingOrder + 1)
local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig, heroTid) local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig, heroTid)
@ -619,6 +631,8 @@ function this:OnClose()
end end
_CloseFunc = nil _CloseFunc = nil
end end
allMyHeros={}
isSame=false
-- 重置状态 -- 重置状态
--state = 1 --state = 1
isAnim = false isAnim = false
@ -629,6 +643,8 @@ function WorldArenaBattleInfoPanel:OnDestroy()
this.spLoader:Destroy() this.spLoader:Destroy()
leftAllTeam={} leftAllTeam={}
rightAllTeam={} rightAllTeam={}
allMyHeros={}
isSame=false
-- 头像 -- 头像
if myHeadObj then if myHeadObj then
myHeadObj:Recycle() myHeadObj:Recycle()