autoImport("CoreView"); RunePackagePart = class("RunePackagePart", CoreView) autoImport("BagItemCell"); autoImport("WrapListCtrl"); local TABCONFIG = { --[1] = {Config = nil}, } local RunePackPage = GameConfig.RunePackPage or _EmptyTable; for i=1,#RunePackPage do table.insert(TABCONFIG, {Config = RunePackPage[i]}); end function RunePackagePart:ctor() -- 220,280 -- ShowItemTip end local RunePackagePart_Path = "GUI/v1/part/RunePackagePart" function RunePackagePart:CreateSelf(parent) if(self.inited == true)then return; end self.inited = true; self.gameObject = self:LoadPreferb_ByFullPath(RunePackagePart_Path, parent, true); self:UpdateLocalPosCache(); self:InitPart(); end function RunePackagePart:InitPart() -- InitScrollPull begin self.waitting = self:FindComponent("Waitting", UILabel); self.scrollView = self:FindComponent("ItemScrollView", ROUIScrollView); self.panel = self.scrollView.gameObject:GetComponent(UIPanel) self.scrollView.OnBackToStop = function () self.waitting.text = ZhString.ItemNormalList_Refreshing; end self.scrollView.OnStop = function () self.scrollView:Revert(); ServiceItemProxy.Instance:CallPackageSort(SceneItem_pb.EPACKTYPE_RUNE); end self.scrollView.OnPulling = function (offsetY, triggerY) self.waitting.text = offsetY 0)then offset[1] = -650; offset[2] = 0; else offset[1] = 190; offset[2] = 0; end local callback = function () self.chooseId = 0; for _,cell in pairs(self.itemCells) do cell:SetChooseId(self.chooseId); end end; local sdata = { itemdata = data, ignoreBounds = ignoreBounds, callback = callback, funcConfig = FunctionItemFunc.GetItemFuncIds(data.staticData.id) }; local itemtip = self:ShowItemTip(sdata, self.normalStick, NGUIUtil.AnchorSide.Right, offset); itemtip:AddIgnoreBounds(self.gameObject); self:AddIgnoreBounds(itemtip.gameObject); end local tempV3 = LuaVector3(); function RunePackagePart:SetPos(x,y,z) if(self.gameObject)then tempV3:Set(x,y,z); self.gameObject.transform.position = tempV3; self:UpdateLocalPosCache(); end end function RunePackagePart:UpdateLocalPosCache() self.localPos_x, self.localPos_y, self.localPos_z = LuaGameObject.GetLocalPosition(self.gameObject.transform); end function RunePackagePart:SetLocalOffset(x,y,z) tempV3:Set(self.localPos_x + x, self.localPos_y + y, self.localPos_z + z); self.gameObject.transform.localPosition = tempV3; end function RunePackagePart:Show() if(not self.inited)then return; end self.gameObject:SetActive(true); EventManager.Me():AddEventListener(ItemEvent.RuneUpdate, self.UpdateInfo, self) end function RunePackagePart:Hide() if(not self.inited)then return; end ServiceItemProxy.Instance:CallBrowsePackage(SceneItem_pb.EPACKTYPE_RUNE); self.gameObject:SetActive(false); EventManager.Me():RemoveEventListener(ItemEvent.RuneUpdate, self.UpdateInfo, self) TipManager.Instance:CloseTip(); end