local UIBattlePlayerHeadPin = require("View/Battle/UIBattlePlayerHeadPin") local UIBattlePlayerHeadPinSoloFight = UIViewClass(UIBattlePlayerHeadPin) function UIBattlePlayerHeadPinSoloFight:OnCreated() self.enableReviveTimerUpdate = false self.showUpList = {} end -- 演武对决轮转头像逻辑 function UIBattlePlayerHeadPinSoloFight:IsHeroShowedUp(heroId) return self.showUpList[heroId] ~= nil end -- 已经出战过且血量不为0 function UIBattlePlayerHeadPinSoloFight:IsHeroWin(heroId) local info = self.showUpList[heroId] if info then return info.heroID == heroId and info.isWin end return false end -- 演武对决回合结束接收已出战武将胜利还是失败 function UIBattlePlayerHeadPinSoloFight:UpdateHeroRoundInfo(heroId, isWin) self.showUpList[heroId] = {heroID = heroId, isWin = isWin} -- 异步1v1 上过的将就置灰,每回合不管死没死双方都换将 end function UIBattlePlayerHeadPinSoloFight:SetHeroImage(index) local heroId = self.curInfo.heroID UTL.Item.SetHeroIconByHeroId(self.headImg_Group[index].texture_Head, heroId, BattleDataGetter.GetHeroIsAwaken(self.context.playerID, heroId)) UIUtils.SetActive(self.headImg_Group[index].group_Win, self:IsHeroWin(heroId)) UIUtils.SetActive(self.headImg_Group[index].black_Bg, index ~= 1 and not self:IsHeroShowedUp(heroId)) UIUtils.SetGray(self.headImg_Group[index].texture_Head, self:IsHeroShowedUp(heroId)) end return UIBattlePlayerHeadPinSoloFight