--[[ 道具预览tips ]] local UIBagItemTips = require "View/Bag/UIBagItemTips"; local UIPreviewItemTips = UIViewClass(UIBagItemTips) local EventSystem = require('Event/EventSystem') local OffsetX = 316 function UIPreviewItemTips:OnCreated() self.isClosedByParent = false; end function UIPreviewItemTips:OnOpened(context) self:RegistSystemEvent(EventID.UI_ItemTips_Closed_Child, self.OnCloseChildItemTips) self:RegistSystemEvent(EventID.UI_ItemTips_refreshItem, self.OnRefreshItemTips) if self.tipsData.isOffset then self:SetPanelTipsPos(OffsetX, nil, nil); end UIUtils.SetActive(self.btn_Close, not self.tipsData.isChildTips); end function UIPreviewItemTips:OnRefreshItemTips(context) self.tipsData = context; self:SetTipsData(); end function UIPreviewItemTips:SetBottomButtons() UIUtils.SetActive(self.group_Btns.gameObject, false) end function UIPreviewItemTips:OnCloseChildItemTips(isClosedByParent) if self.tipsData.isChildTips then self.isClosedByParent = isClosedByParent; self:CloseView(); end end function UIPreviewItemTips:OnClosed() if self.tipsData.isChildTips and not self.isClosedByParent then EventSystem.Dispatch(EventID.UI_ItemTips_Closed) end end return UIPreviewItemTips