local EventSystem = require('Event/EventSystem') local UIBattleTeamPVPBattlePanel = UIViewClass() UIBattleTeamPVPBattlePanel.isHolding = false UIBattleTeamPVPBattlePanel.totalTimeChangeTick = 0 local LuaConst=LuaConst local FP=FP local JINDU_RED_EFFECT = ConstAssetPathConfig.JINDU_RED_EFFECT local MOVE_BLUE_EFFECT = ConstAssetPathConfig.MOVE_BLUE_EFFECT local MOVE_RED_EFFECT = ConstAssetPathConfig.MOVE_RED_EFFECT local CIRCLE_BLUE_EFFECT = ConstAssetPathConfig.CIRCLE_BLUE_EFFECT local CIRCLE_RED_EFFECT = ConstAssetPathConfig.CIRCLE_RED_EFFECT local TeamPvPHoldState = { None = 0,--占点从来没有被占领过 Holding = 1,--无占领抢夺 HoldingStop = 2, --抢夺中停止了 Occupy = 3,--已经占领 OccupyHolding = 4,--被占领中去抢夺(A占领B去抢夺) 类似于Holding OccupyHoldingStop = 5,--抢夺中被压制,暂停抢夺,类似于HoldingStop Crucial = 6,--在99.99%的时候出现敌人(加时) CrucialHolding = 7,--加时被抢回(A到99%触发加时,B将A赶下) CrucialHoldingStop = 8,--加时被抢有压制抢(A到99%触发加时,B将A赶下,B盘子没转满A进来,B盘子停止) Over = 9,--比赛结束 } function UIBattleTeamPVPBattlePanel:OnOpened() --注册Update self:StartRepeat() self.isHolding = false self.holdingIsMe = false -- 正在hold的人是我 self.isMyGoing = false self.isOtherGoing = false self.isChecking = false self.isBeginBattle = false self.lastFrameTime = 0 self.totalBattleTime = DataSheetManager.ConstData:GetDataByID("TVTBattleTime").IntValue self.holdingTime = FP.tonumberV1( 1 / DataSheetManager.ConstData:GetDataByID("TVTBattleSpeed").FloatValue ) -- 5 local maxProgress = BattleDataGetter.GetTVTPointSpeed() self.totalProgrss = FP.tonumberV1( FP.Math.Floor(FP.Const.One / maxProgress / LuaConst.TimeSpan) )-- 2000帧 self.hasLoadPlayerHeadImg = false self.labLocal_otherPorgress.text = "0 %" self.labLocal_myPorgress.text = "0 %" self.labLocal_BattleTime.text = "--:--" self.holdState:SetState(0) UIUtils.SetActive(self.checkTime.gameObject,false) UIUtils.SetAtlasImageFillAmount( self.checkTimeBar , 1) UIUtils.SetActive(self.holdingObj2.gameObject,false) self:RegistSystemEvent(EventID.UI_UIBattleTeamPVPBattlePanel_BeginBattle, self.BeginBattle) self:RegistSystemEvent(EventID.UI_BattleTeamPVPBattlePanel_SetMyProgress, self.SetMyProgress) self:RegistSystemEvent(EventID.UI_BattleTeamPVPBattlePanel_SetOtherProgress, self.SetOtherProgress) self:RegistSystemEvent(EventID.UI_BattleTeamPVPBattlePanel_ShowCheckTime, self.ShowCheckTime) self:RegistSystemEvent(EventID.UI_BattleTeamPVPBattlePanel_SetHoldingProgress, self.SetHoldingProgress) self:RegistSystemEvent(EventID.UI_BattleTeamPVPBattlePanel_Over, self.Over) --self:RegistSystemEvent(EventID.UI_BattleTeamPVPBattlePanel_OnEntityDead, self.OnEntityDead) self:RegistSystemEvent(EventID.UI_BattleTeamPVPBattlePanel_OnEntityRevive, self.OnEntityRevive) self:RegistSystemEvent(EventID.UI_UpdateBuff_OtherHero,self.UpdateBuffShow) self:RegistSystemEvent(EventID.UI_UpdateBuff_Self,self.UpdateOwnBuffShow) self:RegistSystemEvent(EventID.SDK_OnVoiceRoomStateChange,self.RefreshVoiceUI) if BattleDataGetter.CheckCurLevelType(LuaConst.LevelType.SyncTeamFairChampionship) then self.voiceRoomType = MDL.VoiceRoom.VoiceRoomType.TeamFairChampionship else self.voiceRoomType = MDL.VoiceRoom.VoiceRoomType.Room_3V3 end --获取语音状态 if not BattleDataGetter.IsInLevelWatchBattle() and not GameAppInfo.IsJapanesePackage() then MDL.VoiceRoom.VoiceCallStateReq(self.voiceRoomType) else UIUtils.SetActive(self.img_VoiceChat,false) end self.isDead = {} self.enemyEntityIndex = {} self.friendEntityIndex = {} self.friendEntityBuffPanel = {} self.enemyEntityBuffPanel = {} local EntityList_Sync = BattleDataGetter.GetEntityList_Sync() local sortList = {} for i, entity in ipairs(EntityList_Sync) do if BattleDataGetter.GetMainPlayerCharacterID() == entity._logicInitData.CharacterID then table.insert(sortList, 1, entity) else table.insert(sortList, entity) end end for i, entity in ipairs(sortList) do self:RegistSystemEvent(entity.Event_EntityHPChanged, self.RefreshPlayer) self:CreatePlayerHead(entity, entity._logicInitData.EntityCampID) end self.hasLoadPlayerHeadImg = true self.comboViewRoot:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIBattleCombo), {isShowComboType = LuaConst.ComboType.IsKillHero}) self.beginPosX, self.beginPosY = self.begin.transform:GetAnchoredPosition() self.beginMyPosX, self.beginMyPosY = self.beginMy.transform:GetAnchoredPosition() self:Refresh() end function UIBattleTeamPVPBattlePanel:StartRepeat() self:StartRepeatFunc(self.OnUpdateFun, 0) end function UIBattleTeamPVPBattlePanel:Refresh() self.isBeginBattle = LogicUpdateManager._clientHandleFrame > 1 self.totalTimeChangeTick = 0 self.isHolding = false self.holdingIsMe = false -- 正在hold的人是我 local battleInfo = BattleDataGetter.GetBattleInfo() if battleInfo.occupyCamp == LevelPlayerManager.MainEntityCampID then self.isMyGoing = true self.isOtherGoing = false self.holdState:SetState(2) self.bg_otherline.gameObject:SetActive(false) self.bg_myline.gameObject:SetActive(true) self.bg_rightNone.gameObject:SetActive(true) self.bg_leftNone.gameObject:SetActive(false) elseif battleInfo.occupyCamp ~= -1 then -- -1 代表无归属 self.isMyGoing = false self.isOtherGoing = true self.holdState:SetState(1) self.bg_otherline.gameObject:SetActive(true) self.bg_myline.gameObject:SetActive(false) self.bg_rightNone.gameObject:SetActive(false) self.bg_leftNone.gameObject:SetActive(true) end local holdingIsgo = battleInfo.curState == TeamPvPHoldState.Holding or battleInfo.curState == TeamPvPHoldState.OccupyHolding local holdingIsMyCamp = battleInfo.holdCamp == LevelPlayerManager.MainEntityCampID local isFromZero = battleInfo.holdProgress == 0 self:SetHoldingProgress(holdingIsgo,holdingIsMyCamp,isFromZero,false ,not holdingIsgo) self:OnUpdateFun(0,0) local mytime = battleInfo.myProgress / self.totalProgrss self.labLocal_myPorgress.text = string.format( "%.0f %%" , mytime * 100 ) local othertime = battleInfo.otherProgress / self.totalProgrss self.labLocal_otherPorgress.text = string.format( "%.0f %%" , othertime * 100 ) if BattleDataGetter.CheckCurLevelType(LuaConst.LevelType.SyncTeamFairChampionship) then --天下会武3v3需要显示双方战队名字 if BattleDataGetter.GetMyCampID() == 1 then self.staticLable_my.text = BattleDataGetter.GetCampName1() self.staticLable_other.text = BattleDataGetter.GetCampName2() else self.staticLable_my.text = BattleDataGetter.GetCampName2() self.staticLable_other.text = BattleDataGetter.GetCampName1() end else --显示我方\敌方 UIUtils.SetLabelText(self.staticLable_my, Const_IDS.IDS_UI_Word1) UIUtils.SetLabelText(self.staticLable_other, Const_IDS.IDS_UI_Word2) end end function UIBattleTeamPVPBattlePanel:OnEntityRevive(entity) if entity._logicInitData.IsPlayerSelf and not BattleDataGetter.IsInLevelWatchBattle() then UIManager.OpenView(Const_UI_Lua.UIEnum.UISyncTeamPVPRevive) end self:RefreshPlayer(entity) end function UIBattleTeamPVPBattlePanel:InitPlayer(entity, index, isEnemy) if index > 3 then return -- 3v3正常是6个人 也只有6个头像 超过会报错 但是测试过程中 可能有超过6个人 这么写一下 如果判断celltable 有其它问题可能给检测不到 end local roleId = entity._logicInitData.CharacterID local cellTable = nil if isEnemy then cellTable = self.enemyList[index] else cellTable = self.friendList[index] end --头像只加载一次 if self.hasLoadPlayerHeadImg == false then UTL.Item.SetHeroIconByHeroId(cellTable.texture_HeadImg, roleId, BattleDataGetter.GetHeroIsAwaken(entity:GetPlayerID(), roleId)) local entityId = entity:GetEntityID() if entity:IsPlayerSelf() then self.friendEntityBuffPanel[index] = self.friendList[index].buffCanvas:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UISyncTeamBuffPanel), {entityId = entityId, buffType = LuaConst.UIBuffShowType.PlayerSelf}) else if isEnemy then self.enemyEntityBuffPanel[index] = self.enemyList[index].buffCanvas:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UISyncTeamBuffPanel), {entityId = entityId, buffType = LuaConst.UIBuffShowType.PlayerOthers}) else self.friendEntityBuffPanel[index] = self.friendList[index].buffCanvas:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UISyncTeamBuffPanel), {entityId = entityId, buffType = LuaConst.UIBuffShowType.PlayerOthers}) end end end cellTable.sprite_HpFg_Show.fillAmount = FP.tonumberV1(entity.components.attr.hp / entity.components.attr:GetAttrValue(LuaConst.AttrType.hplmt)) if CampManager.IsEnemyCamp(entity._logicInitData.EntityCampID, LevelPlayerManager.MainEntityCampID) then --UIUtils.SetImageByAssetBundle(cellTable.sprite_HpFg_Show, RedHpBarImgPath) end local reviveTime = entity.components.revive.ReviveTimer if reviveTime > 0 then if not self.isDead[entity._logicInitData.CharacterID] then self.isDead[entity._logicInitData.CharacterID] = reviveTime cellTable.timer:ResetAndBeginTimer(false, reviveTime / 1000) cellTable.sprite_HpFg_Show.fillAmount = 1 end end self.isDead[entity._logicInitData.CharacterID] = nil end ---头像部分 function UIBattleTeamPVPBattlePanel:CreatePlayerHead(entity, campId) if campId ~= LevelPlayerManager.MainEntityCampID then table.insert(self.enemyEntityIndex, entity:GetEntityID()) self:InitPlayer(entity, #self.enemyEntityIndex, true) else table.insert(self.friendEntityIndex, entity:GetEntityID()) self:InitPlayer(entity, #self.friendEntityIndex, false) end --人数不够需要隐藏。天下会武3V3会有这种情况 for i, v in ipairs(self.friendList) do UIUtils.SetActive(v.gameObject, i <= #self.friendEntityIndex) end for i, v in ipairs(self.enemyList) do UIUtils.SetActive(v.gameObject, i <= #self.enemyEntityIndex) end end function UIBattleTeamPVPBattlePanel:RefreshProgressData() local battleInfo = BattleDataGetter.GetBattleInfo() if battleInfo == nil then return end local mytime = battleInfo.myProgress / self.totalProgrss if(mytime > 0.99) then self.labLocal_myPorgress.text = "99 %" else self.labLocal_myPorgress.text = string.format( "%.0f %%" , mytime * 100 ) end local othertime = battleInfo.otherProgress / self.totalProgrss if(othertime > 0.99) then self.labLocal_otherPorgress.text = "99 %" else self.labLocal_otherPorgress.text = string.format( "%.0f %%" , othertime * 100 ) end UIUtils.SetAtlasImageFillAmount( self.holdingProgressTop , battleInfo.holdProgress / (self.holdingTime*20)) end function UIBattleTeamPVPBattlePanel:SetInitData(maxprogress) self.totalProgrss = maxprogress end function UIBattleTeamPVPBattlePanel:BeginBattle() self.isBeginBattle = true self.totalTimeChangeTick = 0 end function UIBattleTeamPVPBattlePanel:OnUpdateFun(deltaTime, timeSinceUpdate) if(self.isBeginBattle) then self.totalTimeChangeTick = self.totalTimeChangeTick + deltaTime if(self.totalTimeChangeTick >= 1) then self.totalTimeChangeTick = self.totalTimeChangeTick -1 local leftBattleTimeFrame = BattleDataGetter.GetLeftBattleTimeFrame() local battleTimeStr = self:GetTimeStrByFrame(leftBattleTimeFrame) self.labLocal_BattleTime.text = battleTimeStr end end if( self.isHolding) then local holding = deltaTime / self.holdingTime --UIUtils.SetAtlasImageFillAmount( self.holdingProgress , self.holdingProgress.fillAmount - holding) local fillAmount = self.holdingProgressTop.fillAmount + holding UIUtils.SetAtlasImageFillAmount( self.holdingProgressTop , fillAmount) --设置新的进度条 local battleInfo = BattleDataGetter.GetBattleInfo() local noOccupy = battleInfo.occupyCamp == -1 if self.holdingIsMe then local blue = fillAmount if noOccupy then blue = 0.5 + 0.5 * fillAmount end UIUtils.SetAtlasImageFillAmount( self.holdingMyLine , blue) UIUtils.SetAtlasImageFillAmount( self.holdingEnemyLine , 1 - blue) if fillAmount > 0 and fillAmount < 1 then --self.holdingEff:PlayUIEffect(JINDU_BLUE_EFFECT,-1) self.holdingEff.transform:SetLocalPosition( -270 + 540 * blue,0,0) end else local red = fillAmount if noOccupy then red = 0.5 + 0.5 * fillAmount end UIUtils.SetAtlasImageFillAmount( self.holdingMyLine , 1 - red) UIUtils.SetAtlasImageFillAmount( self.holdingEnemyLine , red) if fillAmount > 0 and fillAmount < 1 then --self.holdingEff:PlayUIEffect(JINDU_RED_EFFECT,-1) self.holdingEff.transform:SetLocalPosition( 270 - 540 * red,0,0) end end end local battleInfo = BattleDataGetter.GetBattleInfo() if(self.isMyGoing)then local mytime = battleInfo.myProgress / self.totalProgrss if(mytime > 0.99) then self.labLocal_myPorgress.text = "99 %" else self.labLocal_myPorgress.text = string.format( "%.0f %%" , mytime * 100 ) end end if(self.isOtherGoing)then local othertime = battleInfo.otherProgress / self.totalProgrss if(othertime > 0.99) then self.labLocal_otherPorgress.text = "99 %" else self.labLocal_otherPorgress.text = string.format( "%.0f %%" , othertime * 100 ) end end if(self.isChecking)then local checkt = deltaTime / self.checkTick UIUtils.SetAtlasImageFillAmount( self.checkTimeBar , self.checkTimeBar.fillAmount - checkt) end end function UIBattleTeamPVPBattlePanel:SetHoldingProgress(isgo,isMyCamp,isFromZero,isFirst ,stopUI2) if stopUI2 then self.isHolding = false UIUtils.SetActive(self.holdingObj2.gameObject,false) end if isgo then UIUtils.SetActive(self.holdingObj2.gameObject,true) end self.isHolding = isgo self.holdingIsMe = isMyCamp if(isFromZero) then if(isFirst) then UIUtils.SetAtlasImageFillAmount( self.holdingProgress , 0) --print("fisrt = true") else UIUtils.SetAtlasImageFillAmount( self.holdingProgress , self.holdingProgressTop.fillAmount ) --print("fisrt = false") end UIUtils.SetAtlasImageFillAmount( self.holdingProgressTop , 0 ) self.holdingEff.transform:SetLocalPosition( 0,0,0) self.holdingEff:PlayUIEffect(JINDU_RED_EFFECT,-1) else local battleInfo = BattleDataGetter.GetBattleInfo() if battleInfo ~= nil then UIUtils.SetAtlasImageFillAmount( self.holdingProgressTop , battleInfo.holdProgress / (self.holdingTime*20)) end end -- if(isMyCamp) then -- UTL.Item.SetAtlasSprite(self.holdingProgressTop,"UI_Battle","holdingBlue") -- UTL.Item.SetAtlasSprite(self.holdingProgress,"UI_Battle","holdingRed") -- else -- UTL.Item.SetAtlasSprite(self.holdingProgressTop,"UI_Battle","holdingRed") -- UTL.Item.SetAtlasSprite(self.holdingProgress,"UI_Battle","holdingBlue") -- end end function UIBattleTeamPVPBattlePanel:MoveEffect(isBlue) local px, py = self.endEffect.transform:GetLocalPosition() local begin = nil if isBlue then begin = self.begin begin.transform:SetAnchoredPosition(self.beginPosX,self.beginPosY) self.beginMy.transform:SetAnchoredPosition(self.beginPosX,self.beginPosY) else begin = self.beginMy begin.transform:SetAnchoredPosition(self.beginMyPosX,self.beginMyPosY) self.begin.transform:SetAnchoredPosition(self.beginMyPosX,self.beginMyPosY) end if self.moveAnim == nil then self.moveAnim = self:MoveToPos(begin.transform, px, py, 2, true) else self:MoveToPos(self.moveAnim, px, py, 2) end if isBlue then begin:PlayUIEffect(MOVE_BLUE_EFFECT,-1) CTL.Sound.PlayGameSound("UI_youfang_zhandian") else begin:PlayUIEffect(MOVE_RED_EFFECT,-1) CTL.Sound.PlayGameSound("UI_difang_zhandian") end end function UIBattleTeamPVPBattlePanel:OnUIAnimationStoped() self.begin:StopUIEffect() self.beginMy:StopUIEffect() if self.isOtherGoing then self.endEffect:PlayUIEffect(CIRCLE_BLUE_EFFECT,1) else self.endEffect:PlayUIEffect(CIRCLE_RED_EFFECT,1) end if self.isMyGoing then self.holdState:SetState(2) self.bg_otherline.gameObject:SetActive(false) self.bg_myline.gameObject:SetActive(true) self.bg_rightNone.gameObject:SetActive(true) self.bg_leftNone.gameObject:SetActive(false) elseif self.isOtherGoing then self.holdState:SetState(1) self.bg_otherline.gameObject:SetActive(true) self.bg_myline.gameObject:SetActive(false) self.bg_rightNone.gameObject:SetActive(false) self.bg_leftNone.gameObject:SetActive(true) end end function UIBattleTeamPVPBattlePanel:SetMyProgress(isgo) self.isMyGoing = isgo; self.isOtherGoing = false; if self.isMyGoing then -- self.holdState:SetState(2) -- self.bg_otherline.gameObject:SetActive(false) -- self.bg_myline.gameObject:SetActive(true) -- self.bg_rightNone.gameObject:SetActive(true) -- self.bg_leftNone.gameObject:SetActive(false) self:MoveEffect(true) end --print("isMyGoing=", tostring( isgo) ) end function UIBattleTeamPVPBattlePanel:SetOtherProgress(isgo) self.isOtherGoing = isgo; self.isMyGoing = false; if self.isOtherGoing then -- self.holdState:SetState(1) -- self.bg_otherline.gameObject:SetActive(true) -- self.bg_myline.gameObject:SetActive(false) -- self.bg_rightNone.gameObject:SetActive(false) -- self.bg_leftNone.gameObject:SetActive(true) self:MoveEffect(false) end --print("OtherProgress=", tostring( isgo) ) end function UIBattleTeamPVPBattlePanel:ShowCheckTime(show ,times) if(show) then self.checkTick = DataSheetManager.ConstData:GetDataByID("TVTOverTime").IntListValue[times] if(not self.checkTime.gameObject.activeSelf) then UIUtils.SetActive(self.checkTime.gameObject,true) end else UIUtils.SetActive(self.checkTime.gameObject,false) end self.isChecking = show UIUtils.SetAtlasImageFillAmount( self.checkTimeBar , 1) end function UIBattleTeamPVPBattlePanel:Over() self.isBeginBattle = false end function UIBattleTeamPVPBattlePanel:GetTimeStr(totalSecond) local timeStr = "00:00" local second = math.fmod (totalSecond ,UTL.Time.TotalSecondsOneMinute) local minute = math.floor(totalSecond / UTL.Time.TotalSecondsOneMinute) timeStr = string.format("%02d:%02d",minute,second) return timeStr end function UIBattleTeamPVPBattlePanel:GetTimeStrByFrame(timeFrame) local timeStr = "00:00" local totalSecond = math.floor(timeFrame / 20) local second = math.fmod (totalSecond ,UTL.Time.TotalSecondsOneMinute) local minute = math.floor(totalSecond / UTL.Time.TotalSecondsOneMinute) timeStr = string.format("%02d:%02d",minute,second) return timeStr end function UIBattleTeamPVPBattlePanel:GetCellIndexByCharacterId(entity) if CampManager.IsEnemyCamp(entity:GetCampID(),LevelPlayerManager.MainEntityCampID) then for i, v in ipairs(self.enemyEntityIndex) do if v == entity:GetEntityID() then return i - 1 end end logging.error(LTAG.ERROR, "没有找到对应敌人EntityID索引", self.enemyEntityIndex, entity:GetEntityID()) else for i, v in ipairs(self.friendEntityIndex) do if v == entity:GetEntityID() then return i - 1 end end logging.error(LTAG.ERROR, "没有找到对应友方EntityID索引", self.friendEntityIndex, entity:GetEntityID()) end end function UIBattleTeamPVPBattlePanel:RefreshPlayer(entity, delta, value) if CampManager.IsEnemyCamp(entity:GetCampID(),LevelPlayerManager.MainEntityCampID) then for i, v in ipairs(self.enemyEntityIndex) do if v == entity:GetEntityID() then self:InitPlayer(entity, i, true) return end end --logging.error(LTAG.ERROR, "没有找到对应敌人ID的头像Cell索引", entity._logicInitData.CharacterID) else for i, v in ipairs(self.friendEntityIndex) do if v == entity:GetEntityID() then self:InitPlayer(entity, i, false) return end end --logging.error(LTAG.ERROR, "没有找到对应友方ID的头像Cell索引", entity._logicInitData.CharacterID) end end function UIBattleTeamPVPBattlePanel:UpdateBuffShow(entity, buffData, time, layer, sourceEntityId) for i, v in ipairs(self.enemyEntityIndex) do if v == entity:GetEntityID() then if self.enemyList[i] then self.enemyEntityBuffPanel[i]:UpdateBuffShow(buffData, time, layer, sourceEntityId) return end end end for i, v in ipairs(self.friendEntityIndex) do if v == entity:GetEntityID() then if self.friendList[i] then self.friendEntityBuffPanel[i]:UpdateBuffShow(buffData, time, layer, sourceEntityId) return end end end end function UIBattleTeamPVPBattlePanel:UpdateOwnBuffShow(entity, buffData, time, layer, sourceEntityId) for i, v in ipairs(self.friendEntityIndex) do if v == entity:GetEntityID() then self.friendEntityBuffPanel[i]:UpdateBuffShow(buffData, time, layer, sourceEntityId) return end end end function UIBattleTeamPVPBattlePanel:OnButtonClicked(obj) if obj == self.img_Listen then --收听 local listen, call = CTL.VoiceRoom.IsEnabledListener(), CTL.VoiceRoom.IsEnabledMicrophone() listen = not listen MDL.VoiceRoom.VoiceCallSetStateReq(self.voiceRoomType, call, listen) if listen then CTL.Tips.AddTipsMsg(Const_IDS["IDS_WarChannel_Listening"]) CTL.Sound.PlayGameSound("UI_voice_system") else CTL.Tips.AddTipsMsg(Const_IDS["IDS_WarChannel_NotListening"]) CTL.Sound.PlayGameSound("UI_invalid") end elseif obj == self.img_Speak then --麦克风 local listen, call = CTL.VoiceRoom.IsEnabledListener(), CTL.VoiceRoom.IsEnabledMicrophone() call = not call MDL.VoiceRoom.VoiceCallSetStateReq(self.voiceRoomType, call, listen) if call then CTL.Tips.AddTipsMsg(Const_IDS["IDS_WarChannel_NotSpeakingBtn"]) CTL.Sound.PlayGameSound("UI_voice_system") else CTL.Tips.AddTipsMsg(Const_IDS["IDS_WarChannel_SpeakingBtn"]) CTL.Sound.PlayGameSound("UI_invalid") end end end --region 语音相关 function UIBattleTeamPVPBattlePanel:RefreshVoiceUI() UIUtils.SetActive(self.img_VoiceChat,true) self.state_Listen:SetState(CTL.VoiceRoom.IsEnabledListener() and 0 or 1) self.state_Speak:SetState(CTL.VoiceRoom.IsEnabledMicrophone() and 0 or 1) end --endregion return UIBattleTeamPVPBattlePanel