--- 形象设置界面 local UIHeroLightEffectTool = require "View/Common/UIHeroLightEffectTool" local UICharacterTeamChangeImage = UIViewClass() local Common2DScenePrefab = ConstAssetPathConfig.Common2DScenePrefab local bgTexturePath = ConstAssetPathConfig.bgTextruePath local horseEffectID = 0 local FightIcon = "zq_icon_zhanli" --战力icon local ATTR_TXT_COLOR = "70c664" local ModelShowIndex = { Hero = 0, Horse = 1, HorseAppearance = 3 } function UICharacterTeamChangeImage:OnCreated() self.heroLightEffectDatas = UIHeroLightEffectTool.CreateHeroLightEffectDatas(false) self.modelComponentDataHandle = UTL.UIRender.CreateModelComponentDatas(self.ModelShow) UTL.UIRender.Create2DSceneTrans(self.modelComponentDataHandle, Common2DScenePrefab, 1600, 0, 1600, bgTexturePath, true) end --- context = {openIndex = 打开的页签, openID = 打开的道具ID} function UICharacterTeamChangeImage:OnOpened(context) self.sortedHeroList = {} self.toggle_LeftGroup = self.group_LeftBtn.toggles_Group UTL.Toggle.InitToggleGroupByIDS(self.toggle_LeftGroup, "txt",{Const_IDS.IDS_Hero, Const_IDS.IDS_Horse_Title_1}) self:RegistSystemEvent(EventID.ChangeTeamShowModel, self.RefreshInfo) self:RegistSystemEvent(EventID.ChangeHorseShowModel, self.RefreshInfo) self:RegistSystemEvent(EventID.UI_UpdateHorseAppearance, self.RefreshInfo) self.openParamIndex = context and context.openIndex or nil self.openID = context and context.openID or 0 UIUtils.SetActive(self.UITemplateTitlePanel.btn_Info, false) UIManager.ActiveUIModle(false, "UICharacterTeamChangeImage") self:Init() end function UICharacterTeamChangeImage:Init() local defaultOpenIndex = ModelShowIndex.Hero if self.openParamIndex then if self.openParamIndex == ModelShowIndex.HorseAppearance then defaultOpenIndex = ModelShowIndex.Horse else defaultOpenIndex = self.openParamIndex end else self:SwitchModelType(defaultOpenIndex) end self.toggle_LeftGroup:SelectIndex(defaultOpenIndex) self.currentToggle = self.toggle_ChangeImage -- 设置标题 UIUtils.SetLabelText(self.UITemplateTitlePanel.lab_Title, Const_IDS.IDS_Team_ChangeHint_1) end function UICharacterTeamChangeImage:OnClosed() UTL.UIRender.DisposeModelComponentData(self.modelComponentDataHandle) UIUtils.SetActive(self.UITemplateTitlePanel.btn_Info, true) UIManager.ActiveUIModle(true, "UICharacterTeamChangeImage") self.selectCellItem = nil self.selectCellData = nil end function UICharacterTeamChangeImage:RefreshInfo() if self.modelType == ModelShowIndex.Hero then self:InitHeroCell() elseif self.modelType == ModelShowIndex.Horse then self:InitHorseCell() elseif self.modelType == ModelShowIndex.HorseAppearance then self:InitHorseAppearanceCell() end self:OnClickCellItem(self.selectCellIndex) end function UICharacterTeamChangeImage:SwitchModelType(index) if self.modelType == index then return end -- 坐骑相关显示 local isHorse = index == ModelShowIndex.Horse or index == ModelShowIndex.HorseAppearance UIUtils.SetActive(self.toggle_TopGroup, isHorse) UIUtils.SetActive(self.img_TabLine, isHorse) UIUtils.SetActive(self.Scroll_ChangeHero, not isHorse) UIUtils.SetActive(self.Scroll_ChangeHorse, index == ModelShowIndex.Horse) UIUtils.SetActive(self.Scroll_ChangeHorseSkin, index == ModelShowIndex.HorseAppearance) UIUtils.SetActive(self.img_BlackCoverRight, isHorse) self.selectCellItem = nil self.selectCellData = nil self.riderModelPath = nil self.horseHeroLightEffects = nil self.modelType = index --切换页签调用clearCells,防止ReloadAll报错 self.Scroll_ChangeHero:ClearCells() self.Scroll_ChangeHorse:ClearCells() self.Scroll_ChangeHorseSkin:ClearCells() if index == ModelShowIndex.Hero then self:InitHeroCell() elseif index == ModelShowIndex.Horse then self:InitHorseCell() elseif index == ModelShowIndex.HorseAppearance then self:InitHorseAppearanceCell() end end function UICharacterTeamChangeImage:ChangeModelShow() UTL.UIRender.DisposeHorseOther(self.modelComponentDataHandle) UTL.UIRender.DisposePlayerModel(self.modelComponentDataHandle) self:StopHeroLightEffect() if self.modelType == ModelShowIndex.Hero then local data = self.selectCellData --显示人物 UTL.UIRender.CreatePlayerModel(self.modelComponentDataHandle, data.ID, nil, nil, true) UTL.UIRender.SetHeroParentPos(self.modelComponentDataHandle, 0.37, -1.1, 0) UTL.UIRender.SetHeroParentRot(self.modelComponentDataHandle, 0, -10, 0) if MDL.DivineWeaponForgeSoul.IsWeaponSoulActive(data.ID) then UTL.UIRender.LoadPlayerWeaponSoul(self.modelComponentDataHandle, MDL.DivineWeaponForgeSoul.GetWeaponForgeSoulSkillsLv(data.ID)) end local heroLightEffects = MDL.LightEffect.GetHeroWearLightEffectIDList(data.ID) self:BeginHeroLightEffect(self,UIHeroLightEffectTool.PlayLightEffectFuncEnum.UI3DModel,heroLightEffects) elseif self.modelType == ModelShowIndex.Horse then--无外观Horse local horseData = self.selectCellData if not UTL.UIRender.CanLoadHorse(horseData) then --没下好就用默认模型 horseData = DataSheetManager.HorseData:GetDataByHorseID(1) end --显示人骑马 UTL.UIRender.CreateHorse3DModel(self.modelComponentDataHandle, horseData.HorseID, 0, UTL.UIRender.LayerActiveType.HorseShow) --切换模型播放上马特效 local horseModeData = DataSheetManager.HorseModelData:GetDataByHorseModelID(horseData.HorseModelID) self:PlayHorseEffect(horseModeData.HorseEffect) local heroID = self:GetRidingHorseHeroId() self.horseHeroLightEffects = MDL.LightEffect.GetHeroWearLightEffectIDList(heroID) UTL.UIRender.Create2DSceneTrans(self.modelComponentDataHandle, Common2DScenePrefab, 1600, 0, 1600, bgTexturePath, false) UTL.UIRender.StartRideHorse(self.modelComponentDataHandle, horseData.HorseID, heroID) local isStandOnHorse, driverAnim = UTL.UIRender.GetOnHorseAnim(horseData) local posX, posY, posZ = 0.37, -1.1, 0 if horseData.SettingModelXYZ and #horseData.SettingModelXYZ > 0 then posX, posY, posZ = horseData.SettingModelXYZ[1], horseData.SettingModelXYZ[2], horseData.SettingModelXYZ[3] end local _, _, modelScale ,modelRot = UTL.UIRender.LoadShowHorse3DComponent(horseData) UTL.UIRender.SetHeroParentRot(self.modelComponentDataHandle, 0, modelRot, 0) UTL.UIRender.SetHeroParentPos(self.modelComponentDataHandle, posX, posY, posZ) UTL.UIRender.SetModelRootLocalScale(self.modelComponentDataHandle, 0.9, 0.9, 0.9) if not isStandOnHorse then UTL.UIRender.DriverEntityPlayAnim(self.modelComponentDataHandle, "ride_idle_loop") else UTL.UIRender.DriverEntityPlayAnim(self.modelComponentDataHandle, LuaConst.Animation_idle_loop) end if MDL.DivineWeaponForgeSoul.IsWeaponSoulActive(heroID) then UTL.UIRender.LoadPlayerWeaponSoul(self.modelComponentDataHandle, MDL.DivineWeaponForgeSoul.GetWeaponForgeSoulSkillsLv(heroID)) end self:BeginHeroLightEffect(self,UIHeroLightEffectTool.PlayLightEffectFuncEnum.UI3DDriver,self.horseHeroLightEffects) elseif self.modelType == ModelShowIndex.HorseAppearance then local horseData = self.selectCellData if not UTL.UIRender.CanLoadHorse(horseData) then --没下好就用默认模型 horseData = DataSheetManager.HorseData:GetDataByHorseID(1) end --显示人骑马 UTL.UIRender.CreateHorse3DModel(self.modelComponentDataHandle, horseData.HorseID, horseData.ID, UTL.UIRender.LayerActiveType.HorseShow) --切换模型播放上马特效 local horseModeData = DataSheetManager.HorseModelData:GetDataByHorseModelID(horseData.HorseModelID) self:PlayHorseEffect(horseModeData.HorseEffect) local heroID = self:GetRidingHorseHeroId() self.horseHeroLightEffects = MDL.LightEffect.GetHeroWearLightEffectIDList(heroID) UTL.UIRender.Create2DSceneTrans(self.modelComponentDataHandle, Common2DScenePrefab, 1600, 0, 1600, bgTexturePath, false) UTL.UIRender.StartRideHorse(self.modelComponentDataHandle, horseData.HorseID, heroID) local _, _, _, modelRot = UTL.UIRender.LoadShowHorse3DComponent(horseData) UTL.UIRender.SetHeroParentPos(self.modelComponentDataHandle, 0.37, -1.1, 0) UTL.UIRender.SetHeroParentRot(self.modelComponentDataHandle, 0, modelRot, 0) UTL.UIRender.SetModelRootLocalScale(self.modelComponentDataHandle, 0.9, 0.9, 0.9) local isStandOnHorse, driverAnim = UTL.UIRender.GetOnHorseAnim(horseData) if not isStandOnHorse then UTL.UIRender.DriverEntityPlayAnim(self.modelComponentDataHandle, "ride_idle_loop") else UTL.UIRender.DriverEntityPlayAnim(self.modelComponentDataHandle, LuaConst.Animation_idle_loop) end if MDL.DivineWeaponForgeSoul.IsWeaponSoulActive(heroID) then UTL.UIRender.LoadPlayerWeaponSoul(self.modelComponentDataHandle, MDL.DivineWeaponForgeSoul.GetWeaponForgeSoulSkillsLv(heroID)) end self:BeginHeroLightEffect(self, UIHeroLightEffectTool.PlayLightEffectFuncEnum.UI3DDriver, self.horseHeroLightEffects) end end function UICharacterTeamChangeImage:GetRidingHorseHeroId() return MDL.Player.GetCurShowId() end function UICharacterTeamChangeImage:SelectLeftToggleIndex() self.toggle_LeftGroup:SelectIndex(self.modelType) end function UICharacterTeamChangeImage:DisposeRider() if self.riderModelPath then UTL.UIRender.DisposePlayerModel(self.modelComponentDataHandle) self.riderModelPath = nil end end function UICharacterTeamChangeImage:OnValueChanged(comp, value) if comp == self.toggle_TopGroup then if value == 0 then self:SwitchModelType(ModelShowIndex.Horse) else self:SwitchModelType(ModelShowIndex.HorseAppearance) end else if self.currentToggle == nil then if self.ExchangeToggle == nil then self.ExchangeToggle = self:PlayUIAnimation("UIAniRightIn") else self:PlayUIAnimation(self.ExchangeToggle) end end if comp ~= self.toggle_LeftGroup and self.currentToggle ~= comp and MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.WarHorse) then if self.ExchangeToggle == nil then self.ExchangeToggle = self:PlayUIAnimation("UIAniRightIn") else self:PlayUIAnimation(self.ExchangeToggle) end self.currentToggle = comp end if value then if value == ModelShowIndex.Hero then self:SwitchModelType(ModelShowIndex.Hero) elseif value == ModelShowIndex.Horse then if not MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.WarHorse) then CTL.Tips.AddTipsMsg(Const_IDS.IDS_Horse_Town_1) self:StartRepeatFunc(self.SelectLeftToggleIndex, 0.2, 1) return end if self.openParamIndex then if self.openParamIndex == ModelShowIndex.HorseAppearance then self.toggle_TopGroup:SelectIndex(1) else self.toggle_TopGroup:SelectIndex(0) end self.openParamIndex = nil else self:SwitchModelType(ModelShowIndex.Horse) self.toggle_TopGroup:SelectIndex(0) end end end end end --region ******************** 武将头像 **************** --武将排序:已穿戴>激活>未激活>品质>id local function SortHeroRule(a, b) local isWearA = a.ID == MDL.Player.GetCurShowId() local isWearB = b.ID == MDL.Player.GetCurShowId() if isWearA ~= isWearB then return isWearA end local isHasA = MDL.HeroSelect.IsHasHero(a.ID) local isHasB = MDL.HeroSelect.IsHasHero(b.ID) if isHasA ~= isHasB then return isHasA else if a.HeroQuality ~= b.HeroQuality then return a.HeroQuality > b.HeroQuality else return a.ID < b.ID end end end function UICharacterTeamChangeImage:GetHeroSortedList() table.clearArray(self.sortedHeroList) local index = 1 for i, v in DataSheetManager.HeroNum:GetEnumerator() do if MDL.HideGolden.IsShowGoldenByID(LuaConst.ShowGoldenType.Hero, v.ID) then -- 屏蔽金将判断 self.sortedHeroList[index] = v index = index + 1 end end table.sort(self.sortedHeroList, SortHeroRule) return self.sortedHeroList end function UICharacterTeamChangeImage:InitHeroCell() local heroList = self:GetHeroSortedList() self.Scroll_ChangeHero:ReloadAll(heroList) self.Scroll_ChangeHero:SelectIndex(0, true) end --endregion ******************** 武将头像 **************** --region ******************** 坐骑 **************** --坐骑排序:已穿戴->激活->未激活->品质高低 local function sortRule(a, b) local wear_a = a.HorseID == MDL.WarHorse.GetCurShowId() local wear_b = b.HorseID == MDL.WarHorse.GetCurShowId() if wear_a ~= wear_b then return wear_a end local state_a = MDL.WarHorse.GetInfoByID(a.HorseID) and true or false local state_b = MDL.WarHorse.GetInfoByID(b.HorseID) and true or false if state_a ~= state_b then return state_a else if a.HorseQuality ~= b.HorseQuality then return a.HorseQuality > b.HorseQuality else return a.HorseID < b.HorseID end end end function UICharacterTeamChangeImage:GetHorseSortedList() local horseList = MDL.WarHorse.GetSortedHorseList(sortRule) return horseList end function UICharacterTeamChangeImage:InitHorseCell() local horseList = self:GetHorseSortedList() self.Scroll_ChangeHorse:ReloadAll(horseList) self.Scroll_ChangeHorse:SelectIndex(0, true) end function UICharacterTeamChangeImage:InitHorseAppearanceCell() local appearanceList = MDL.WarHorse.GetAppearanceDataList() self.Scroll_ChangeHorseSkin:ReloadAll(appearanceList) for i, v in ipairs(appearanceList) do if v.ID == self.openID then self.Scroll_ChangeHorseSkin:SelectIndex(i - 1, true) return end end self.Scroll_ChangeHorseSkin:SelectIndex(0, true) end --endregion ******************** 坐骑 **************** function UICharacterTeamChangeImage:OnClickCellItem(cellIndex) self.selectCellIndex = cellIndex if self.selectCellItem == nil or self.selectCellData == nil then return end UIUtils.SetActive(self.selectCellItem.img_Selected, true) self:ChangeModelShow() local isSet = false if self.modelType == ModelShowIndex.Hero then isSet = self.selectCellData.ID == MDL.Player.GetCurShowId() elseif self.modelType == ModelShowIndex.Horse then isSet = self.selectCellData.HorseID == MDL.WarHorse.GetCurShowId() end if isSet then self.obj_state:SetState(1) if self.modelType == ModelShowIndex.Hero then UIUtils.SetLabelText(self.txt_PromptInfo, Const_IDS.IDS_Team_ChangeHint_3) elseif self.modelType == ModelShowIndex.Horse then UIUtils.SetLabelText(self.txt_PromptInfo, Const_IDS.IDS_Team_ChangeHint_4) elseif self.modelType == ModelShowIndex.HorseAppearance then UIUtils.SetLabelText(self.txt_PromptInfo, Const_IDS.IDS_HorseAppearance_Wearing) end else local isActive = false if self.modelType == ModelShowIndex.Hero then isActive = MDL.HeroSelect.IsHasHero(self.selectCellData.ID) elseif self.modelType == ModelShowIndex.Horse then isActive = MDL.WarHorse.GetInfoByID(self.selectCellData.HorseID) ~= nil elseif self.modelType == ModelShowIndex.HorseAppearance then isActive = MDL.WarHorse.GetOwnType(self.selectCellData.ID) <= MDL.WarHorse.OwnedType.TimeLimit end if isActive then self.obj_state:SetState(0) UIUtils.SetLabelText(self.lab_Change, Const_IDS["IDS_Team_ChangeHint_2"]) else self.obj_state:SetState(1) if self.modelType == ModelShowIndex.Hero then UIUtils.SetLabelText(self.txt_PromptInfo, Const_IDS.IDS_Team_ChangeHint_5) elseif self.modelType == ModelShowIndex.Horse then UIUtils.SetLabelText(self.txt_PromptInfo, Const_IDS.IDS_Team_ChangeHint_6) end end end -- 坐骑皮肤单独处理逻辑 if self.modelType == ModelShowIndex.HorseAppearance then local isAppearanceSet = self.selectCellData.ID == MDL.WarHorse.GetCurAppearanceShowID() local isActive = MDL.WarHorse.GetOwnType(self.selectCellData.ID) <= MDL.WarHorse.OwnedType.TimeLimit -- 坐骑外观特定UI self.obj_state:SetState(0) UIUtils.SetActive(self.img_Expiration, isActive) UIUtils.SetActive(self.img_BlackBG, not isActive) --皮肤未解锁 UIUtils.SetActive(self.btn_Change, isAppearanceSet or isActive) self.btn_Change:SetGray(isAppearanceSet) UIUtils.SetLabelText(self.lab_Change, isAppearanceSet and Const_IDS["IDS_HorseAppearance_Wearing"] or Const_IDS["IDS_Team_ChangeHint_2"]) CTL.WarHorse.SetStateTimerTxt(self.selectCellData.ID, self.txt_countDownTimer) UIUtils.SetActive(self.txt_Effect, true) UIUtils.SetActive(self.txt_Source, true) UIUtils.SetLabelText(self.txt_Effect, Const_IDS["IDS_HorseAppearance_Title4"]) UIUtils.SetLabelText(self.txt_Source, Const_IDS["IDS_HorseAppearance_GetWay"]) for index, v in ipairs(self.selectCellData.Attr_Table) do UTL.Attr.SetWarHorseScrollingAttr(self.effectTxtCollection[index], v.AttrType, v.AttrNum, false, true) end UIUtils.SetLabelText(self.txt_SourceTxt, Const_IDS[self.selectCellData.Describe]) else UIUtils.SetActive(self.img_BlackBG, false) UIUtils.SetActive(self.txt_Effect, false) UIUtils.SetActive(self.txt_Source, false) self.btn_Change:SetGray(false) UIUtils.SetActive(self.img_Expiration, false) end end --region ****************** Loop ********************* function UICharacterTeamChangeImage:OnCellSelect(scrollRect, index, cellTable, data) if self.selectCellItem ~= nil then UIUtils.SetActive(self.selectCellItem.img_Selected, false) end self.selectCellItem = cellTable self.selectCellData = data self:OnClickCellItem(index) end function UICharacterTeamChangeImage:OnCellInit(scrollRect, index, cellTable, data) if self.selectCellData ~= nil and data == self.selectCellData then UIUtils.SetActive(cellTable.img_Selected, true) else UIUtils.SetActive(cellTable.img_Selected, false) end if self.modelType == ModelShowIndex.Hero then local isActive = MDL.HeroSelect.IsHasHero(data.ID) UIUtils.SetActive(cellTable.img_Frame,true) UIUtils.SetActive(cellTable.mask_Locked, not isActive) cellTable.txt_HeroName:SetText(UIUtils.GetLocalizedTxt(Const_IDS[data.NameIDS])) cellTable.obj_state:SetState(0) UTL.Item.SetHeroIconByHeroId(cellTable.img_HeroHead, data.ID, MDL.HeroAwaken.GetIsHeroAwaken(data.ID)) local quality = CTL.HeroAwaken.GetHeroQuality(data.ID, MDL.HeroAwaken.GetIsHeroAwaken(data.ID)) UTL.Color.SetQualityImageByType(cellTable.img_HeroBg, quality, UTL.Color.QualityType.CharacterUIModify) UTL.Color.SetQualityImageByType(cellTable.img_Frame, quality, UTL.Color.QualityType.CharacterUIFrame) if data.ID == MDL.Player.GetCurShowId() then UIUtils.SetActive(cellTable.img_UsedBg, true) else UIUtils.SetActive(cellTable.img_UsedBg, false) end elseif self.modelType == ModelShowIndex.Horse then cellTable.txt_HeroName:SetText(UIUtils.GetLocalizedTxt(Const_IDS[data.HorseName])) cellTable.obj_state:SetState(1) UIUtils.SetImageByAssetBundle(cellTable.img_HorseHead, data.HorsePicture) UTL.Color.SetQualityImageByType(cellTable.img_HeroBg, data.HorseQuality, UTL.Color.QualityType.CharacterUIModify) UTL.Color.SetQualityImageByType(cellTable.img_Frame, data.HorseQuality, UTL.Color.QualityType.CharacterUIFrame) self:InitHorseCellStatus(cellTable, data) elseif self.modelType == ModelShowIndex.HorseAppearance then cellTable.txt_HeroName:SetText(UIUtils.GetLocalizedTxt(Const_IDS[data.Name])) cellTable.obj_state:SetState(1) UIUtils.SetImageByAssetBundle(cellTable.img_HorseHead, data.HorsePicture) if #data.IconXYZ > 0 then -- 设置皮肤icon UV cellTable.img_HorseHead:SetPivotCenter(data.IconXYZ[1], data.IconXYZ[2]) cellTable.img_HorseHead:SetScaleRadio(data.IconScale) end UTL.Color.SetQualityImageByType(cellTable.img_HeroBg, data.Color, UTL.Color.QualityType.CharacterUIModify) UTL.Color.SetQualityImageByType(cellTable.img_Frame, data.Color, UTL.Color.QualityType.CharacterUIFrame) self:InitHorseAppearanceCellStatus(cellTable, data) end end function UICharacterTeamChangeImage:InitHorseCellStatus(cellTable, data) local isActive = MDL.WarHorse.GetInfoByID(data.HorseID) ~= nil UIUtils.SetActive(cellTable.mask_Locked, not isActive) if data.HorseID == MDL.WarHorse.GetCurShowId() then UIUtils.SetActive(cellTable.img_UsedBg, true) else UIUtils.SetActive(cellTable.img_UsedBg, false) end end function UICharacterTeamChangeImage:InitHorseAppearanceCellStatus(cellTable, data) local activeState = MDL.WarHorse.GetOwnType(data.ID) UIUtils.SetActive(cellTable.mask_Locked, activeState == MDL.WarHorse.OwnedType.UnOwned or activeState == MDL.WarHorse.OwnedType.Overdue) -- 未拥有 cellTable.img_Red:SetRedPoint(data.IsNew) if MDL.WarHorse.GetCurAppearanceShowID() == data.ID then UIUtils.SetActive(cellTable.img_UsedBg, true) else UIUtils.SetActive(cellTable.img_UsedBg, false) end end --endregion ****************** Loop ********************* function UICharacterTeamChangeImage:OnBackButtonPressed() self:OnButtonClicked(self.UITemplateTitlePanel.btn_close) end function UICharacterTeamChangeImage:OnButtonClicked(comp) if comp == self.btn_Change then if self.modelType == ModelShowIndex.Hero then if BattleDataGetter.IsTaskChangeAvatarState() then CTL.Tips.AddTipsMsg(Const_IDS["IDS_ChangingBody_CannotChangeImage"]) return end MDL.Player.ShowChangeHeroRequest(self.selectCellData.ID) CTL.Sound.PlayGameSound("UI_xingxiang") elseif self.modelType == ModelShowIndex.Horse then if MDL.WarHorse.GetInfoByID(self.selectCellData.HorseID) ~= nil then MDL.WarHorse.HorseChangeShowRequest(self.selectCellData.HorseID) CTL.Sound.PlayGameSound("UI_xingxiang") end elseif self.modelType == ModelShowIndex.HorseAppearance then if MDL.WarHorse.GetOwnType(self.selectCellData.ID) <= MDL.WarHorse.OwnedType.TimeLimit then MDL.WarHorse.HorseAppearanceShowChangeReq(self.selectCellData.ID) CTL.Sound.PlayGameSound("UI_xingxiang") end end elseif comp == self.UITemplateTitlePanel.btn_close then self:CloseView(true) self:StopHeroLightEffect() elseif comp == self.UITemplateTitlePanel.btn_Home then CTL.HomeMain.CloseViewBackHomeMain() self:StopHeroLightEffect() end end function UICharacterTeamChangeImage:StopHeroLightEffect() UIHeroLightEffectTool.StopHeroLightEffect(self.heroLightEffectDatas) end function UICharacterTeamChangeImage:BeginHeroLightEffect(renderComp,playLightEffectFuncEnum,heroLightEffects) if heroLightEffects then for _, lightEffectID in ipairs(heroLightEffects) do UIHeroLightEffectTool.PlayHeroLightEffect(self.heroLightEffectDatas, renderComp, 0, playLightEffectFuncEnum, lightEffectID, nil) end end end function UICharacterTeamChangeImage:PlayHorseEffect(effectPath) if horseEffectID ~= 0 then AuxUtil.StopPsEffect(horseEffectID) horseEffectID = 0 end horseEffectID = UTL.UIRender.PlayHorsePsEffect(self.modelComponentDataHandle, effectPath) end function UICharacterTeamChangeImage:PlayDriverModelEffect(effectPath) return UTL.UIRender.PlayDriverPsEffect(self.modelComponentDataHandle, effectPath) end function UICharacterTeamChangeImage:AuxUtilPlayPsEffect(effectPath) return UTL.UIRender.PlayPsEffect(self.modelComponentDataHandle, effectPath) end function UICharacterTeamChangeImage:PlayCharacterModelEffect(effectPath) return UTL.UIRender.PlayPsEffect(self.modelComponentDataHandle, effectPath) end return UICharacterTeamChangeImage