local UITaskChapterPanel = UIViewClass() local SHOW_DURATION = 5 function UITaskChapterPanel:OnOpened(context) CTL.Sound.PlayGameSound("UI_sound_Loading") if context then if self.loc_Title.CurState == 0 then UIUtils.SetLabelText(self.labLocal_Chapter,Const_IDS[context.Name]) UIUtils.SetLabelText(self.labLocal_Title,Const_IDS[context.Content]) else UIUtils.SetLabelText(self.txt_Chapter,Const_IDS[context.Name]) UIUtils.SetLabelText(self.txt_Title,Const_IDS[context.Content]) end UIUtils.SetLabelText(self.labLocal_Content,Const_IDS[context.UIShow]) end self:StartRepeatFunc(self.OnUpdateFun, 1) end function UITaskChapterPanel:OnUpdateFun(deltaTime, timeSinceUpdate) if timeSinceUpdate > SHOW_DURATION then self:CloseView(true) end end return UITaskChapterPanel