-- 操作性tipBase -- 子界面继承: -- UIHorseEquipTip 坐骑战装 local UIOptBaseTip = UIViewClass() local ItemBg = ConstAssetPathConfig.ItemBg local OffsetX = 185 function UIOptBaseTip:OnOpened(context) self.context = context self.isRightTip = context.isRightTip if context.isOffset then self.Panel_ItemTips:SetLocalPosition(OffsetX, nil, nil) end self:Init(context) self:Refresh() end -- BASE 初始化数据 -- 道具id-self.itemId -- 操作目标id-self.targetObjId function UIOptBaseTip:Init(context) end function UIOptBaseTip:Refresh() if self.targetObjId <= 0 then -- 无操作对象时 self:SetCfgTip() else -- 有操作对象时 self:SetTargetObjInfo() self:RefreshBtns() end end -- BASE 无操作对象时设置信息 function UIOptBaseTip:SetCfgTip() end -- BASE 有操作对象时设置信息 function UIOptBaseTip:SetTargetObjInfo() end -- BASE 刷新操作按钮 function UIOptBaseTip:RefreshBtns() end function UIOptBaseTip:RefreshNormalInfo() UTL.Item.SetItemCell(self.ItemBase, self.itemId) local itemData = DataSheetManager.ItemData:GetDataByID(self.itemId) local qualityData = DataSheetManager.QualityColor:GetDataByID(itemData.Color) local colorBg = qualityData.EquipFragmentComposeBase local colorPrint = qualityData.EquipRefineIcon local itemNameAndDesc = UTL.Item.GetItemDataSpliceByType(self.itemId) local colorName = UTL.Color.FormatQualityText(itemNameAndDesc.Name, itemData.Color) UIUtils.SetImageByAssetBundle(self.img_ItemInfoBg, string.format(ItemBg, colorBg)) UIUtils.SetImageByAssetBundle(self.img_ItemInfoBg2, string.format(ItemBg, colorPrint)) UIUtils.SetLabel(self.txt_ItemName, colorName) end function UIOptBaseTip:CloseAll() if self.context.rootName then UIManager.CloseView(self.context.rootName) else self:CloseView() end end return UIOptBaseTip