local AppearanceLibrary_Controller = {} local private = {} local EventSystem = require('Event/EventSystem') local CONST_DISPLAY_COUNT = 5 function AppearanceLibrary_Controller.OnStartup() EventSystem.Regist(EventID.FunctionUnlockUpdate, AppearanceLibrary_Controller.CheckRedPoint) private.params = { oldLevelCfg = nil, newLevelCfg = nil } private.totalCount = 0 for i, v in DataSheetManager.CollectionAP:GetEnumerator() do private.totalCount = private.totalCount + 1 end end function AppearanceLibrary_Controller.OnShutdown() private.params = nil end function AppearanceLibrary_Controller.OpenMainPanel() local isUnlock, content = MDL.Unlock.IsClientUnlockWithText(MDL.Unlock.FunctionType.AppearanceLibrary, "IDS_Activity_Condition_01") if isUnlock then UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIAppearanceIllustratedBase, nil, Const_UI_Lua.UIEnum.UIHeroIllustratedBase) end end function AppearanceLibrary_Controller.CheckUnlock() local isUnlock, content = MDL.Unlock.IsClientUnlockWithText(MDL.Unlock.FunctionType.AppearanceLibrary, "IDS_Activity_Condition_01") return isUnlock end function AppearanceLibrary_Controller.ShowLeveUpTipPanel(oldLevel, newLevel) if oldLevel and newLevel > oldLevel then private.params.newLevelCfg = DataSheetManager.CollectorPictorialScore:GetDataByLevelID(newLevel) if newLevel - 1 > 0 then private.params.oldLevelCfg = DataSheetManager.CollectorPictorialScore:GetDataByLevelID(newLevel - 1) end private.params.type = LuaConst.PictorialType.Appearance UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroIllustratedLevelUpTip, private.params) end end function AppearanceLibrary_Controller.CheckRedPoint() if not MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.AppearanceLibrary) then CTL.RedPoint.RemoveRedPoint(CTL.RedPoint.RedPointKey.Library_Appearance) return end if MDL.AppearanceLibrary.IsShowRP() then CTL.RedPoint.AddRedPoint(CTL.RedPoint.RedPointKey.Library_Appearance) return end CTL.RedPoint.RemoveRedPoint(CTL.RedPoint.RedPointKey.Library_Appearance) end function AppearanceLibrary_Controller.GetEntryList() local entryList = {} for i, v in DataSheetManager.CollectionAP:GetEnumerator() do table.insert(entryList, v) end if #entryList < CONST_DISPLAY_COUNT then for i = #entryList + 1, CONST_DISPLAY_COUNT do --凑齐长度显示敬请期待 table.insert(entryList, 0) end end return entryList end function AppearanceLibrary_Controller.GetTotalCount() return private.totalCount end return AppearanceLibrary_Controller