local TreasureLibrary_Controller = {} local private = {} local EventSystem = require('Event/EventSystem') function TreasureLibrary_Controller.OnStartup() EventSystem.Regist(EventID.FunctionUnlockUpdate, TreasureLibrary_Controller.CheckRedPoint) private.params = { oldLevelCfg = nil, newLevelCfg = nil } end function TreasureLibrary_Controller.OnShutdown() private.params = nil end function TreasureLibrary_Controller.OpenMainPanel() local isUnlock, content = MDL.Unlock.IsClientUnlockWithText(MDL.Unlock.FunctionType.TreasureLibrary, "IDS_Activity_Condition_01") if isUnlock then UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UITreasureIllustratedBase,nil, Const_UI_Lua.UIEnum.UIHeroIllustratedBase) end end function TreasureLibrary_Controller.CheckUnlock() local isUnlock, content = MDL.Unlock.IsClientUnlockWithText(MDL.Unlock.FunctionType.TreasureLibrary, "IDS_Activity_Condition_01") return isUnlock end function TreasureLibrary_Controller.ShowLeveUpTipPanel(oldLevel, newLevel) if oldLevel and newLevel > oldLevel then private.params.newLevelCfg = DataSheetManager.TreasurePictorialScore:GetDataByLevelID(newLevel) local _, oldCfg = DataSheetManager.TreasurePictorialScore:TryGetDataByLevelID(oldLevel) if oldCfg then private.params.oldLevelCfg = oldCfg else private.params.oldLevelCfg = nil end private.params.type = LuaConst.PictorialType.Treasure UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroIllustratedLevelUpTip, private.params) end end function TreasureLibrary_Controller.CheckRedPoint() if not MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.TreasureLibrary) then CTL.RedPoint.RemoveRedPoint(CTL.RedPoint.RedPointKey.Library_Treasure) return end if MDL.TreasureLibrary.IsShowRP() then CTL.RedPoint.AddRedPoint(CTL.RedPoint.RedPointKey.Library_Treasure) return end CTL.RedPoint.RemoveRedPoint(CTL.RedPoint.RedPointKey.Library_Treasure) end return TreasureLibrary_Controller