local UIIllustratedSecondPanel = UIViewClass() function UIIllustratedSecondPanel:OnOpened(context) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.Library_PlotReview, self.RefreshLibraryRp) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.Library_Stratagem, self.RefreshLibraryRp) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.Library_LightEffect, self.RefreshLibraryRp) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.Library_Dye, self.RefreshLibraryRp) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.Library_Appearance, self.RefreshLibraryRp) -- 室外红点 self:RegistSystemEvent(CTL.RedPoint.RedPointKey.Library_Hero, self.RefreshLibraryOutRp) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.Library_Weapon, self.RefreshLibraryOutRp) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.Library_Treasure, self.RefreshLibraryOutRp) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.Library_Horse, self.RefreshLibraryOutRp) self:RegistSystemEvent(CTL.RedPoint.RedPointKey.Library_GodBeast, self.RefreshLibraryOutRp) UIUtils.SetLabelText(self.UITemplateTitlePanel.lab_Title, Const_IDS.IDS_Handbook_Enter_Title) self:RefreshLibraryRp() self:RefreshLibraryOutRp() end function UIIllustratedSecondPanel:OnBackButtonPressed() self:OnButtonClicked(self.UITemplateTitlePanel.btn_close) end function UIIllustratedSecondPanel:OnButtonClicked(comp) if comp == self.UITemplateTitlePanel.btn_close then self:CloseView(true) 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.Mansion}) elseif comp == self.btn_PlotReview or comp == self.btn_PlotReviewLoc then -- 剧情回顾 CTL.PlotReviewLibrary.OpenMainPanel() elseif comp == self.btn_Stratagem or comp == self.btn_StratagemLoc then -- 计略图鉴 CTL.StratagemLibrary.OpenMainPanel() elseif comp == self.btn_lightEffectPictorial or comp == self.btn_lightEffectPictorialLoc then CTL.EffectLibrary.OpenMainPanel() elseif comp == self.btn_DyeAppearance then CTL.AppearanceLibrary.OpenMainPanel() elseif comp == self.btn_Color then CTL.DyeLibrary.OpenMainPanel() elseif comp == self.btn_ChangeOut then self:CloseView(true) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIIllustratedMainPanel) end end function UIIllustratedSecondPanel:RefreshLibraryRp() local isRp = CTL.RedPoint.GetRedPointActive if CTL.PlotReviewLibrary.CheckUnlock() then self.btn_PlotReview:SetRedPoint(isRp(CTL.RedPoint.RedPointKey.Library_PlotReview)) self.btn_PlotReviewLoc:SetRedPoint(isRp(CTL.RedPoint.RedPointKey.Library_PlotReview)) else UIUtils.SetActive(self.btn_PlotReview, false) UIUtils.SetActive(self.btn_PlotReviewLoc, false) end if CTL.StratagemLibrary.CheckUnlock() then --计略图鉴红点 self.btn_Stratagem:SetRedPoint(isRp(CTL.RedPoint.RedPointKey.Library_Stratagem)) self.btn_StratagemLoc:SetRedPoint(isRp(CTL.RedPoint.RedPointKey.Library_Stratagem)) else UIUtils.SetActive(self.btn_Stratagem, false) UIUtils.SetActive(self.btn_StratagemLoc, false) end if CTL.EffectLibrary.CheckUnlock() then self.btn_lightEffectPictorial:SetRedPoint(isRp(CTL.RedPoint.RedPointKey.Library_LightEffect)) self.btn_lightEffectPictorialLoc:SetRedPoint(isRp(CTL.RedPoint.RedPointKey.Library_LightEffect)) end if CTL.DyeLibrary.CheckUnlock() then UIUtils.SetActive(self.btn_Color, true) self.btn_Color:SetRedPoint(isRp(CTL.RedPoint.RedPointKey.Library_Dye)) else UIUtils.SetActive(self.btn_Color, false) end if CTL.AppearanceLibrary.CheckUnlock() then UIUtils.SetActive(self.btn_DyeAppearance, true) self.btn_DyeAppearance:SetRedPoint(isRp(CTL.RedPoint.RedPointKey.Library_Appearance)) else UIUtils.SetActive(self.btn_DyeAppearance, false) end end function UIIllustratedSecondPanel:RefreshLibraryOutRp() local isRp = CTL.RedPoint.GetRedPointActive if CTL.HeroLibrary.CheckUnlock() and isRp(CTL.RedPoint.RedPointKey.Library_Hero) then self.btn_ChangeOut:SetRedPoint(true) return else self.btn_ChangeOut:SetRedPoint(false) end if CTL.WeaponLibrary.CheckUnlock() and isRp(CTL.RedPoint.RedPointKey.Library_Weapon) then self.btn_ChangeOut:SetRedPoint(true) return else self.btn_ChangeOut:SetRedPoint(false) end if CTL.TreasureLibrary.CheckUnlock() and isRp(CTL.RedPoint.RedPointKey.Library_Treasure) then self.btn_ChangeOut:SetRedPoint(true) return else self.btn_ChangeOut:SetRedPoint(false) end if CTL.HorseLibrary.CheckUnlock() and isRp(CTL.RedPoint.RedPointKey.Library_Horse) then self.btn_ChangeOut:SetRedPoint(true) return else self.btn_ChangeOut:SetRedPoint(false) end if CTL.GodBeastLibrary.CheckUnlock() and isRp(CTL.RedPoint.RedPointKey.Library_GodBeast) then self.btn_ChangeOut:SetRedPoint(true) return else self.btn_ChangeOut:SetRedPoint(false) end end return UIIllustratedSecondPanel