local UITeamSelectHeroBasePanel = UIViewClass() local SkillPath = ConstAssetPathConfig.SkillImagePath function UITeamSelectHeroBasePanel:OnOpened(context) self.modelComponentDataHandle = UTL.UIRender.CreateModelComponentDatas(self.heroShow) UTL.UIRender.Create2DSceneTrans(self.modelComponentDataHandle, ConstAssetPathConfig.Common2DScenePrefab, 1600, 0, 1600, ConstAssetPathConfig.bgTexturePath, false) self:RegistSystemEvent(EventID.UI_SyncTeamPVPSelectHero_TeamMemberChangeHero, self.TeamMemberChangeHero) self:RegistSystemEvent(EventID.UI_SyncTeamPVPSelectHero_TeamMemberReady, self.TeamMemberReady) self:RegistSystemEvent(EventID.UI_SyncTeamPVP_OnCancelReady, self.OnCancelReady) self:RegistSystemEvent(EventID.UI_SyncTeamPVPSelect_RefreshHeroSelect, self.RefreshHeroData) self:RegistSystemEvent(EventID.UI_SyncTeamPVP_PlayerReady, self.ShowAlreadyPrepared) self:RegistSystemEvent(EventID.SDK_OnVoiceRoomStateChange, self.RefreshVoiceUI) self:RegistSystemEvent(EventID.UI_FairPlay_RefreshHeroFixedInfo, self.RefreshHeroFixedInfo) self.currentSkillGroupIndex = 1 self.effectResult = nil self.mainHeroSelectId, self.viceHeroSelectId = MDL.SyncTeamPVP.GetSelfSelectHero() self.timer = 0 self.currentTime = 0 self.role1Info = nil --队友1 self.role2Info = nil --队友2 self.skill1ID = 0 self.skill2ID = 0 self.skill3ID = 0 self.skill4ID = 0 self.role1SelectMainId = nil self.role1SelectViceId = nil self.role2SelectMainId = nil self.role2SelectViceId = nil self:InitHeroList() UIUtils.SetActive(self.obj_Country.gameObject, false) UIUtils.SetActive(self.obj_Profession.gameObject, false) UIUtils.SetActive(self.group_Skill, false) self:StartRepeatFunc(self.OnUpdateFun, 1) self.btn_Prepare.gameObject:SetActive(true) self.timeout = 0 self.obj_mask.gameObject:SetActive(false) self:RefreshTeamMemberInfo() self:RefreshNameAndServer() self:OpenChatView() self:RefreshHeroData(self.mainHeroSelectId, self.viceHeroSelectId) UIManager.ActiveUIModle(false, "UITeamSelectHeroBasePanel") UIUtils.SetActive(self.img_VoiceChat, false) UIUtils.SetActive(self.group_card, false) UIUtils.SetActive(self.group_HeroInfoFixed.gameObject, false) self.voiceRoomType = nil self:InitVoice() end function UITeamSelectHeroBasePanel:InitVoice() if not GameAppInfo.IsJapanesePackage() then MDL.VoiceRoom.VoiceCallStateReq(self.voiceRoomType) end end function UITeamSelectHeroBasePanel:GetTeamMembersInfo() end function UITeamSelectHeroBasePanel:RefreshNameAndServer() if self.role1Info == nil or self.role2Info == nil then self:GetTeamMembersInfo() end self:RefreshGroupNameAndServer(self.group_Role1, self.role1Info.name, self.role1Info.serId) self:RefreshGroupNameAndServer(self.group_Role2, self.role2Info.name, self.role2Info.serId) self:RefreshGroupNameAndServer(self.group_Self, BattleDataGetter.GetPlayerName(), MDL.Login.GetServerShowId()) end function UITeamSelectHeroBasePanel:RefreshGroupNameAndServer(group, name, server) UIUtils.SetActive(group.lab_Server, self:IsShowServer()) group.lab_Server.text = string.FormatByIdsId(Const_IDS.IDS_Rank_ServerIDS, server) group.lab_Name.text = name end function UITeamSelectHeroBasePanel:IsShowServer() return CTL.CrossServer.IsShowServerTextInFairPlay() end function UITeamSelectHeroBasePanel:GetHeroList() end function UITeamSelectHeroBasePanel:InitHeroList() logging.log(LTAG.LOG, " UITeamSelectHeroBasePanel:InitHeroList") end function UITeamSelectHeroBasePanel:ShowHeroModel(heroId) heroId = CTL.HeroAwaken.DecodeHeroId(heroId) UTL.UIRender.DisposePlayerModel(self.modelComponentDataHandle) UTL.UIRender.Create2DSceneTrans(self.modelComponentDataHandle, ConstAssetPathConfig.Common2DScenePrefab, 1600, 0, 1600, ConstAssetPathConfig.bgTexturePath, false) UTL.UIRender.CreatePlayerModel(self.modelComponentDataHandle, heroId, nil, nil, true) UTL.UIRender.SetHeroParentPos(self.modelComponentDataHandle, 0.16, -1.2, 0) -- 设置模型位移信息 UTL.UIRender.SetHeroParentRot(self.modelComponentDataHandle, 0, -10, 0) -- 设置模型位移信息 if not self.effectResult then self.effectResult = CTL.FairPlay.CreateFogEffectInScene(UTL.UIRender.GetModelRootTrans(self.modelComponentDataHandle)) end end function UITeamSelectHeroBasePanel:GetIndexByHeroId(id) for i, v in ipairs(self.heroList) do if v.heroId == id then return i end end end function UITeamSelectHeroBasePanel:ContainHeroId(list, id) for i, v in ipairs(list) do if v.heroId == id then return true end end return false end function UITeamSelectHeroBasePanel:OnCellInit(scrollRect, index, cellTable, data) local heroId = data.heroId UTL.Item.SetHeroIconByHeroId(cellTable.img_Head, CTL.HeroAwaken.DecodeHeroId(heroId)) local _heroId, isAwaken = CTL.HeroAwaken.DecodeHeroId(heroId) local heroData = DataSheetManager.HeroNum:GetDataByID(_heroId) if isAwaken then cellTable.lab_Name.text = string.FormatByIdsId(Const_IDS.IDS_HeroAwaken_Awaken, UIUtils.GetLocalizedTxt(Const_IDS[heroData.NameIDS])) else UIUtils.SetLabelText(cellTable.lab_Name, Const_IDS[heroData.NameIDS]) end if self.mainHeroSelectId == heroId or self.viceHeroSelectId == heroId then UIUtils.SetActive(cellTable.img_BeSelected.gameObject, true) UIUtils.SetActive(cellTable.group_FriendSelected.gameObject, false) UIUtils.SetActive(cellTable.img_SelfSelected, true) elseif self.role1SelectMainId == heroId or self.role1SelectViceId == heroId or self.role2SelectMainId == heroId or self.role2SelectViceId == heroId then UIUtils.SetActive(cellTable.group_FriendSelected.gameObject, true) UIUtils.SetActive(cellTable.img_BeSelected.gameObject, false) elseif CTL.HeroAwaken.TranslateHeroId(self.mainHeroSelectId) == heroId or CTL.HeroAwaken.TranslateHeroId(self.viceHeroSelectId) == heroId then UIUtils.SetActive(cellTable.img_BeSelected.gameObject, true) UIUtils.SetActive(cellTable.img_SelfSelected, false) UIUtils.SetActive(cellTable.group_FriendSelected.gameObject, false) elseif CTL.HeroAwaken.TranslateHeroId(self.role1SelectMainId) == heroId or CTL.HeroAwaken.TranslateHeroId(self.role1SelectViceId) == heroId or CTL.HeroAwaken.TranslateHeroId(self.role2SelectMainId) == heroId or CTL.HeroAwaken.TranslateHeroId(self.role2SelectViceId) == heroId then UIUtils.SetActive(cellTable.group_FriendSelected.gameObject, true) UIUtils.SetActive(cellTable.img_BeSelected.gameObject, false) else UIUtils.SetActive(cellTable.group_FriendSelected.gameObject, false) UIUtils.SetActive(cellTable.img_BeSelected.gameObject, false) end UIUtils.SetActive(cellTable.img_FreeBg, false) UIUtils.SetActive(cellTable.img_TestBg, false) self:InitCellextra(scrollRect, index, cellTable, data) end function UITeamSelectHeroBasePanel:OnCellClicked(scrollRect, index, cellTable, target, data) local heroId = data.heroId if target == cellTable.btn_FriendSelected then CTL.Tips.AddTipsMsg(Const_IDS["IDS_RepeatSelect"]) elseif heroId == self.mainHeroSelectId then self:CancelSelectHero(heroId, true) elseif heroId == self.viceHeroSelectId then self:CancelSelectHero(heroId, false) else if CTL.HeroAwaken.TranslateHeroId(self.mainHeroSelectId) == heroId or CTL.HeroAwaken.TranslateHeroId(self.viceHeroSelectId) == heroId or CTL.HeroAwaken.TranslateHeroId(self.role1SelectMainId) == heroId or CTL.HeroAwaken.TranslateHeroId(self.role1SelectViceId) == heroId or CTL.HeroAwaken.TranslateHeroId(self.role2SelectMainId) == heroId or CTL.HeroAwaken.TranslateHeroId(self.role2SelectViceId) == heroId then return end if self.mainHeroSelectId and self.mainHeroSelectId > 0 and self.viceHeroSelectId and self.viceHeroSelectId > 0 then CTL.Tips.AddTipsMsg(Const_IDS["IDS_BossChallenge_ChooseHero_FullHero"]) else self:SelectedHero(heroId) self:RefreshSelectHeroData(heroId) end end end function UITeamSelectHeroBasePanel:CancelSelectHero(heroId, isMain) if isMain then MDL.SyncTeamPVP.SendChangeHero(0, self.viceHeroSelectId or 0) else MDL.SyncTeamPVP.SendChangeHero(self.mainHeroSelectId or 0, 0) end end function UITeamSelectHeroBasePanel:SelectedHero(heroId) if self.mainHeroSelectId and self.mainHeroSelectId > 0 then if not self.viceHeroSelectId or self.viceHeroSelectId == 0 then MDL.SyncTeamPVP.SendChangeHero(self.mainHeroSelectId, heroId) end else MDL.SyncTeamPVP.SendChangeHero(heroId, self.viceHeroSelectId or 0) end end function UITeamSelectHeroBasePanel:RefreshHeroData(mainHeroId, viceHeroId) self.btn_Prepare.gameObject:SetActive(true) self.btn_Prepare:SetGray(false) if mainHeroId and mainHeroId > 0 then self:UpdateRoleHeroGroup(mainHeroId, self.group_Self, true) local oldId = self.mainHeroSelectId self.mainHeroSelectId = mainHeroId self:UpdateLoopHeroIndex(oldId, mainHeroId) else self:CancelSelectHeroGroup(self.group_Self, true) local oldId = self.mainHeroSelectId or 0 self.mainHeroSelectId = mainHeroId or 0 self:UpdateLoopHeroIndex(oldId, mainHeroId) end if viceHeroId and viceHeroId > 0 then self:UpdateRoleHeroGroup(viceHeroId, self.group_Self, false) local oldId = self.viceHeroSelectId self.viceHeroSelectId = viceHeroId self:UpdateLoopHeroIndex(oldId, viceHeroId) else self:CancelSelectHeroGroup(self.group_Self, false) local oldId = self.viceHeroSelectId or 0 self.viceHeroSelectId = viceHeroId or 0 self:UpdateLoopHeroIndex(oldId, viceHeroId) end end function UITeamSelectHeroBasePanel:UpdateLoopHeroIndex(oldId, newId) if oldId and oldId > 0 then local preIndex = self:GetIndexByHeroId(oldId) if preIndex then self.loopscroll_Head:UpdateIndex(preIndex - 1) end local id = CTL.HeroAwaken.TranslateHeroId(oldId) if id ~= oldId then local preIndex = self:GetIndexByHeroId(id) if preIndex then self.loopscroll_Head:UpdateIndex(preIndex - 1) end end end if newId and newId > 0 then local index = self:GetIndexByHeroId(newId) if index then self.loopscroll_Head:UpdateIndex(index - 1) end local id = CTL.HeroAwaken.TranslateHeroId(newId) if id ~= newId then local index = self:GetIndexByHeroId(id) if index then self.loopscroll_Head:UpdateIndex(index - 1) end end end end function UITeamSelectHeroBasePanel:RefreshSelectHeroData(heroId) self.currentSkillGroupIndex = 1 --重置技能组索引 self:ShowHeroModel(heroId) UIUtils.SetActive(self.group_HeroInfo.gameObject, true) local _heroId, isAwaken = CTL.HeroAwaken.DecodeHeroId(heroId) local heroData = DataSheetManager.HeroNum:GetDataByID(_heroId) if heroData then if isAwaken then self.txt_Name.text = string.FormatByIdsId(Const_IDS.IDS_HeroAwaken_Awaken, UIUtils.GetLocalizedTxt(Const_IDS[heroData.NameIDS])) else UIUtils.SetLabelText(self.txt_Name, Const_IDS[heroData.NameIDS]) end -- 武将国别 CTL.HeroSelect.SetHeroCountry(_heroId, self.obj_Country) -- 武将职业 CTL.HeroSelect.SetHeroProfession(_heroId, self.obj_Profession, true) UIUtils.SetActive(self.obj_Country.gameObject, true) UIUtils.SetActive(self.obj_Profession.gameObject, true) self.curHeroId = heroId self:RefreshSkillShow(heroId) self:ShowHeroFixedInfo(heroId) end end function UITeamSelectHeroBasePanel:RefreshSkillShow(heroId) local id, isAwaken = CTL.HeroAwaken.DecodeHeroId(heroId) self.activeSkillList = MDL.HeroSelect.GetHeroDisplaySkillIdList(id) --多套技能显示切换展示按钮 UIUtils.SetActive(self.btn_Change, #self.activeSkillList > 1) --技能图标 for index, img in ipairs(self.skill_Btn_Group) do local skillId = self.activeSkillList[self.currentSkillGroupIndex][index] local skillIcon if skillId then local skillData = DataSheetManager.SkillTipsData:GetDataByID(skillId) if skillData then skillIcon = skillData.SkillIcon UIUtils.SetActive(img.transform.parent.gameObject, true) if isAwaken then UIUtils.SetImageByAssetBundle(img, CTL.HeroAwaken.GetAwakenDisplaySkillIcon(id, skillId)) else UIUtils.SetImageByAssetBundle(img, string.format(SkillPath, skillIcon)) end else UIUtils.SetActive(img.transform.parent.gameObject, false) end else UIUtils.SetActive(img.transform.parent.gameObject, false) end end UIUtils.SetActive(self.group_Skill, true) end --准备行为 function UITeamSelectHeroBasePanel:OnClickPrepare() if self.mainHeroSelectId > 0 and self.viceHeroSelectId > 0 then MDL.SyncTeamPVP.SendFighterReady(self.mainHeroSelectId, self.viceHeroSelectId) else CTL.Tips.AddTipsMsg(Const_IDS["IDS_BossChallenge_ChooseHero_Empty"]) end end --取消准备 function UITeamSelectHeroBasePanel:OnClickCancelReady() MDL.SyncTeamPVP.CancelReady() end function UITeamSelectHeroBasePanel:ShowAlreadyPrepared() self:SetGroupReady(self.group_Self, true) self.isSelfReady = true self.group_Btn:SetState(1) end function UITeamSelectHeroBasePanel:OnCancelReady() self:SetGroupReady(self.group_Self, false) self.isSelfReady = false self.group_Btn:SetState(0) end --服务器通知队友换英雄(PUSH) function UITeamSelectHeroBasePanel:TeamMemberChangeHero(msg) if self.role1Info == nil or self.role2Info == nil then self:GetTeamMembersInfo() end if msg.acid == self.role1Info.acid then if msg.mainHero and msg.mainHero > 0 then local id = msg.mainHeroAwaken and CTL.HeroAwaken.EncodeHeroId(msg.mainHero) or msg.mainHero self:UpdateRoleHeroGroup(id, self.group_Role1, true) local oldId = self.role1SelectMainId self.role1SelectMainId = id self:UpdateLoopHeroIndex(oldId, id) else self:CancelSelectHeroGroup(self.group_Role1, true) local oldId = self.role1SelectMainId or 0 self.role1SelectMainId = 0 self:UpdateLoopHeroIndex(oldId, 0) end if msg.viceHero and msg.viceHero > 0 then local id = msg.viceHeroAwaken and CTL.HeroAwaken.EncodeHeroId(msg.viceHero) or msg.viceHero self:UpdateRoleHeroGroup(id, self.group_Role1, false) local oldId = self.role1SelectViceId self.role1SelectViceId = id self:UpdateLoopHeroIndex(oldId, id) else self:CancelSelectHeroGroup(self.group_Role1, false) local oldId = self.role1SelectViceId or 0 self.role1SelectViceId = 0 self:UpdateLoopHeroIndex(oldId, 0) end elseif msg.acid == self.role2Info.acid then if msg.mainHero and msg.mainHero > 0 then local id = msg.mainHeroAwaken and CTL.HeroAwaken.EncodeHeroId(msg.mainHero) or msg.mainHero self:UpdateRoleHeroGroup(id, self.group_Role2, true) local oldId = self.role2SelectMainId self.role2SelectMainId = id self:UpdateLoopHeroIndex(oldId, id) else self:CancelSelectHeroGroup(self.group_Role2, true) local oldId = self.role2SelectMainId or 0 self.role2SelectMainId = 0 self:UpdateLoopHeroIndex(oldId, 0) end if msg.viceHero and msg.viceHero > 0 then local id = msg.viceHeroAwaken and CTL.HeroAwaken.EncodeHeroId(msg.viceHero) or msg.viceHero self:UpdateRoleHeroGroup(id, self.group_Role2, false) local oldId = self.role2SelectViceId self.role2SelectViceId = id self:UpdateLoopHeroIndex(oldId, id) else self:CancelSelectHeroGroup(self.group_Role2, false) local oldId = self.role2SelectViceId or 0 self.role2SelectViceId = 0 self:UpdateLoopHeroIndex(oldId, 0) end end end function UITeamSelectHeroBasePanel:CancelSelectHeroGroup(roleGroup, isMain) if isMain then roleGroup.HeadMain.gameObject:SetActive(false) roleGroup.HeadMain_None.gameObject:SetActive(true) else roleGroup.HeadVice.gameObject:SetActive(false) roleGroup.HeadVice_None.gameObject:SetActive(true) end end function UITeamSelectHeroBasePanel:UpdateRoleHeroGroup(heroId, roleGroup, isMain) if isMain then roleGroup.HeadMain.gameObject:SetActive(true) roleGroup.HeadMain_None.gameObject:SetActive(false) UTL.Item.SetHeroIconByHeroId(roleGroup.HeadMain.img_Head, CTL.HeroAwaken.DecodeHeroId(heroId)) roleGroup.HeadMain.gameObject:SetActive(true) else roleGroup.HeadVice.gameObject:SetActive(true) roleGroup.HeadVice_None.gameObject:SetActive(false) UTL.Item.SetHeroIconByHeroId(roleGroup.HeadVice.img_Head, CTL.HeroAwaken.DecodeHeroId(heroId)) roleGroup.HeadVice.gameObject:SetActive(true) end end function UITeamSelectHeroBasePanel:TeamMemberReady(accid, isReady) if accid == self.role1Info.acid then self:SetGroupReady(self.group_Role1, isReady) elseif accid == self.role2Info.acid then self:SetGroupReady(self.group_Role2, isReady) end end function UITeamSelectHeroBasePanel:SetGroupReady(roleGroup, isReady) roleGroup.HeadMain.img_SelectHead.gameObject:SetActive(isReady) roleGroup.HeadVice.img_SelectHead.gameObject:SetActive(isReady) end function UITeamSelectHeroBasePanel:RefreshTeamMemberInfo() self:RefreshSingleTeamMember(MDL.SyncTeamPVP.GetRole1Info()) self:RefreshSingleTeamMember(MDL.SyncTeamPVP.GetRole2Info()) end function UITeamSelectHeroBasePanel:RefreshSingleTeamMember(roleAcid, roleMainHero, mainHeroAwaken, roleViceHero, viceHeroAwaken, roleReady) local lMsg = { acid = roleAcid, mainHero = roleMainHero, mainHeroAwaken = mainHeroAwaken, viceHero = roleViceHero, viceHeroAwaken = viceHeroAwaken, ready = roleReady } self:TeamMemberChangeHero(lMsg) if lMsg.ready then self:TeamMemberReady(lMsg.acid, lMsg.ready) end end function UITeamSelectHeroBasePanel:OnUpdateFun(deltaTime, timeSinceUpdate) if self.timeout ~= 1 then self.timer = timeSinceUpdate - self.currentTime if self.timer >= 1 then self.currentTime = self.currentTime + self.timer self.timer = 0; self.gameTime = self.gameTime - 1; local minute = math.floor(self.gameTime / UTL.Time.TotalSecondsOneMinute) local second = self.gameTime % UTL.Time.TotalSecondsOneMinute local minuteStr local secondStr if minute < 10 then minuteStr = "0" .. tostring(minute) else minuteStr = tostring(minute) end if second < 10 then secondStr = "0" .. tostring(second) else secondStr = tostring(second) end if self.gameTime <= 0 then self.txt_time.text = "00:00" else self.txt_time.text = minuteStr .. ":" .. secondStr end end end end function UITeamSelectHeroBasePanel:OnButtonClicked(obj) if obj == self.btn_Prepare then self:OnClickPrepare() elseif obj == self.btn_cancelReady then self:OnClickCancelReady() elseif obj == self.group_Self.HeadMain.btn_SelfHead then if not self.isSelfReady then self:CancelSelectHero(self.viceHeroSelectId or 0, true) else CTL.Tips.AddTipsMsg(Const_IDS["IDS_3v3ReadyChange"]) end elseif obj == self.group_Self.HeadVice.btn_SelfHead then if not self.isSelfReady then self:CancelSelectHero(self.mainHeroSelectId or 0, false) else CTL.Tips.AddTipsMsg(Const_IDS["IDS_3v3ReadyChange"]) end elseif obj == self.btn_Change then self.currentSkillGroupIndex = self.currentSkillGroupIndex + 1 if self.currentSkillGroupIndex > #self.activeSkillList then self.currentSkillGroupIndex = 1 end self:RefreshSkillShow(self.curHeroId) elseif 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 elseif obj == self.obj_Country.btn_Country then if self.curHeroId then local id, isAwaken = CTL.HeroAwaken.DecodeHeroId(self.curHeroId) UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroFilterView, { canJump = false, heroId = id, isCountry = true, heroFilterPos = self.obj_HeroFilterPos }) end elseif obj == self.obj_Profession.btn_Profession then if self.curHeroId then local id, isAwaken = CTL.HeroAwaken.DecodeHeroId(self.curHeroId) UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroFilterView, { canJump = false, heroId = id, isCountry = false, heroFilterPos = self.obj_HeroFilterPos }) end end for index, btn in ipairs(self.skill_Btn_Group) do if obj == btn then local id, isAwaken = CTL.HeroAwaken.DecodeHeroId(self.curHeroId) CTL.Tips.OpenHeroSkillTipsPreview(true, self.SkillTips, id, self.activeSkillList[self.currentSkillGroupIndex][index], isAwaken) return end end end function UITeamSelectHeroBasePanel:OpenChatView() self.chatView:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIBattleChatDlg)) end function UITeamSelectHeroBasePanel:OnClosed() UIManager.ActiveUIModle(true, "UITeamSelectHeroBasePanel") CTL.Sound.StopGameSound("MUSIC_pvp_zhunbei") if self.effectResult then self.effectResult:Dispose() self.effectResult = nil end UTL.UIRender.DisposeModelComponentData(self.modelComponentDataHandle) end function UITeamSelectHeroBasePanel: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 --显示武将校正信息 function UITeamSelectHeroBasePanel:ShowHeroFixedInfo(heroId) self.lastClickedHeroId = heroId local hasData, atkContent, defContent, hpContent = CTL.FairPlay.GetFixedContent(self.fairPlayType, heroId) if hasData then UIUtils.SetActive(self.group_HeroInfoFixed.gameObject, true) --修正属性 if string.isNilOrEmpty(atkContent) then UIUtils.SetActive(self.group_HeroInfoFixed.txt_Info1, false) else UIUtils.SetActive(self.group_HeroInfoFixed.txt_Info1, true) UIUtils.SetLabel(self.group_HeroInfoFixed.txt_Info1, atkContent) end if string.isNilOrEmpty(defContent) then UIUtils.SetActive(self.group_HeroInfoFixed.txt_Info2, false) else UIUtils.SetActive(self.group_HeroInfoFixed.txt_Info2, true) UIUtils.SetLabel(self.group_HeroInfoFixed.txt_Info2, defContent) end if string.isNilOrEmpty(hpContent) then UIUtils.SetActive(self.group_HeroInfoFixed.txt_Info3, false) else UIUtils.SetActive(self.group_HeroInfoFixed.txt_Info3, true) UIUtils.SetLabel(self.group_HeroInfoFixed.txt_Info3, hpContent) end else UIUtils.SetActive(self.group_HeroInfoFixed.gameObject, false) end end function UITeamSelectHeroBasePanel:RefreshHeroFixedInfo() if self.lastClickedHeroId then self:ShowHeroFixedInfo(self.lastClickedHeroId) end end return UITeamSelectHeroBasePanel