local EventSystem = require("Event/EventSystem") local UIFreeLineupCustomDetailPanel = require("View/FreeLineUp/UIFreeLineupCustomDetailPanel") local UIFreeLineupCustomDetailPanel_3v3 = UIViewClass(UIFreeLineupCustomDetailPanel) function UIFreeLineupCustomDetailPanel_3v3:SendFreeLineUpGetSlotInfoRequest() local lineNumber = MDL.FreeLineUp.GetFreeLineUpLineNumber(self.curFuncType) MDL.FreeLineUp.C2GFreeLineUpGetSlotInfoRequest(self.curFuncType, lineNumber, self.parentView.selectAcid) end function UIFreeLineupCustomDetailPanel_3v3:OnButtonClicked(comp) if comp == self.UITemplateTitlePanel.btn_close then self:CloseView() elseif comp == self.UITemplateTitlePanel.btn_Home then CTL.HomeMain.CloseViewBackHomeMain() elseif comp == self.UITemplateTitlePanel.btn_Info then UIManager.OpenView(Const_UI_Lua.UIEnum.UICommonNoteView, {id = LuaConst.NoteID.FreeLineUp}) end end function UIFreeLineupCustomDetailPanel_3v3:OnClosed() self.serverData = nil end --不可删,防止走到基类的方法 function UIFreeLineupCustomDetailPanel_3v3:OnClosedFunc() --do nothing end --region Hero -- OVERRIDE function UIFreeLineupCustomDetailPanel_3v3:InitHeroInfo(formationGroupCollection, slotIndex) local realSlotIndex = self:GetMappingData(1, slotIndex, 0) local heroInfo = self.slotCustomDetail[realSlotIndex].heroInfos --进阶 local advancedData = DataSheetManager.HeroAdvance:GetDataByAdvanceID(heroInfo.advanceLv) local groupStar = formationGroupCollection.group_Star CTL.Advanced.InstantiateStarCell( self, groupStar[1].gameObject, groupStar, advancedData.SumStar, advancedData.LightStar, advancedData.StarColorIcon, advancedData.StarLockIcon ) --X阶X级 local title = string.FormatByIdsId(Const_IDS[advancedData.AdvanceDesc], advancedData.Stage, advancedData.LightStar) UIUtils.SetLabel(formationGroupCollection.txt_Advance, title) --等级显示 local heroLevelUpData = DataSheetManager.HeroLevelUp:GetDataByHeroLevel(heroInfo.heroLv) if heroLevelUpData then local levelStr = UTL.Item.GetNobilityByTeamLevel(heroLevelUpData.HeroLevel, 2) -- 爵位转换 local teamLevelName = string.FormatByIdsId(Const_IDS[heroLevelUpData.TeamLevelName], levelStr) UIUtils.SetLabel(formationGroupCollection.txt_Level, teamLevelName) end end function UIFreeLineupCustomDetailPanel_3v3:RefreshLineupGS() end --endregion -- OVERRIDE function UIFreeLineupCustomDetailPanel_3v3:UpdateViewBySubView() self:InitCustomChildPanel(true, true) end --定制子界面 function UIFreeLineupCustomDetailPanel_3v3:InitCustomChildPanel(showSaveBtn, showGSGroup) self.customCanvas:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIFreeLineupDetailChild3v3Panel), { parentView = self, curFuncType = self.curFuncType}) end function UIFreeLineupCustomDetailPanel_3v3:InitHeroPictures() local heroList = self.parentView.allHeroList[self.parentView.selectMemberIndex] for k, v in ipairs(self.heroGroupCollections) do local heroId = heroList[k] if heroId > 0 then UIUtils.SetActive(v.group_Empty, false) local isAwaken = MDL.FreeLineUp.GetLineupHeroAwaken(self.curFuncType, k, self.parentView.selectAcid) UTL.Item.SetHeroIconByHeroId(v.img_Hero, heroId, isAwaken) UTL.Color.SetQualityImageByType(v.img_QuaDec, CTL.HeroAwaken.GetHeroQuality(heroId, isAwaken), UTL.Color.QualityType.HeroSelectFrame) UTL.Color.SetQualityImageByType(v.img_Qua, CTL.HeroAwaken.GetHeroQuality(heroId, isAwaken), UTL.Color.QualityType.HeroSelectBg) local heroBreak = MDL.FreeLineUp.GetLineupHeroStar(self.curFuncType, k, self.parentView.selectAcid) if heroBreak == 0 then UIUtils.SetActive(v.group_Break, false) else UIUtils.SetActive(v.group_Break, true) UIUtils.SetLabel(v.txt_Num, "+" .. heroBreak) end else UIUtils.SetActive(v.group_Empty, true) end end end -- OVERRIDE function UIFreeLineupCustomDetailPanel_3v3:RefreshFormateTitle() if self.curFuncType == MDL.FreeLineUp.FuncType.TeamWar then UIUtils.SetLabelText(self.lab_Front1, Const_IDS["IDS_LineupDrag_Name"..(self.lineNumbers[1] or 1)]) UIUtils.SetLabelText(self.lab_Front2, Const_IDS["IDS_LineupDrag_Name"..(self.lineNumbers[2] or 2)]) UIUtils.SetLabelText(self.lab_Front3, Const_IDS["IDS_LineupDrag_Name"..(self.lineNumbers[3] or 3)]) else UIUtils.SetLabelText(self.lab_Front1, Const_IDS.IDS_HeroMatch3v3_FirstLineUp) UIUtils.SetLabelText(self.lab_Front2, Const_IDS.IDS_HeroMatch3v3_SecondLineUp) UIUtils.SetLabelText(self.lab_Front3, Const_IDS.IDS_HeroMatch3v3_ThirdLineUp) end UIUtils.SetLabelText(self.lab_Formate1, Const_IDS.IDS_HeroMatch3v3_FirstLineUp2) UIUtils.SetLabelText(self.lab_Formate2, Const_IDS.IDS_HeroMatch3v3_SecondLineUp2) UIUtils.SetLabelText(self.lab_Formate3, Const_IDS.IDS_HeroMatch3v3_ThirdLineUp2) end function UIFreeLineupCustomDetailPanel_3v3:OnDrop(comp, eventData) --第一步,还原拖拽物体的位置 self.draggingTrans:SetParent(self.originParent, true) self.draggingTrans:SetLocalPosition(self.originX, self.OriginY, 0) -- 停止特效的播放 self:StopEffectByDrag() -- 第二步,计算交换后的数据 if comp and comp.transform ~= eventData.pointerDrag.transform then local targetSlot, targetSubSlot, param = self:GetDragGameObjectIndex(comp.transform.gameObject) local originSlot, originSubSlot = self:GetDragGameObjectIndex(eventData.pointerDrag.transform.gameObject) self:ExchangeMappingData(self.currentTabData.index, originSlot, originSubSlot, targetSlot, targetSubSlot, param) if self.hasChanged then MDL.FreeLineUp.C2GFreeLineUpSlotSetRequest(self.curFuncType, self.serverData, self.parentView.selectAcid) end end --第三步,刷新当前页签 self:RefreshView() end return UIFreeLineupCustomDetailPanel_3v3