annotate Modules/PaperDoll.lua @ 62:ef4116179e2f v7.0.3-1

- cleaned up old file structure remnants
author Nenue
date Tue, 16 Aug 2016 08:37:07 -0400
parents
children ba9c13261bb2
rev   line source
Nenue@62 1 -- Veneer
Nenue@62 2 -- PaperDoll.lua
Nenue@62 3 -- Created: 8/16/2016 8:18 AM
Nenue@62 4 -- %file-revision%
Nenue@62 5 --
Nenue@62 6
Nenue@62 7 local plugin = CreateFrame('Frame', 'VeneerPaper', UIParent)
Nenue@62 8 local vn, print = LibStub("LibKraken").register(VeneerController, plugin)
Nenue@62 9
Nenue@62 10 -- PaperDollFrame is separate from InspectUI handlers
Nenue@62 11 local PaperDollItemSlotButton_Update = function(self)
Nenue@62 12 local name = self:GetName()
Nenue@62 13 local slot = self:GetID()
Nenue@62 14 local frame = _G[name .. 'Veneer']
Nenue@62 15 if not frame then
Nenue@62 16 frame = CreateFrame('Frame', name..'Veneer', self)
Nenue@62 17 frame.label = frame:CreateFontString(nil, 'OVERLAY', 'GameFontNormal')
Nenue@62 18 frame.gemslot = {}
Nenue@62 19 frame:SetPoint('LEFT', self, 'RIGHT')
Nenue@62 20 end
Nenue@62 21
Nenue@62 22 if self.hasItem then
Nenue@62 23 frame.link = GetInventoryItemLink('player', slot)
Nenue@62 24 frame.gem1, frame.gem2, frame.gem3 = GetInventoryItemGems('player', slot)
Nenue@62 25 frame.label:SetText(GetInventoryItemLink('player', slot))
Nenue@62 26 -- todo: test GetExtendedItemInfo()
Nenue@62 27
Nenue@62 28 for i = 1, 3 do
Nenue@62 29 local gname = 'gem'..i
Nenue@62 30 if frame[gname] then
Nenue@62 31 frame.gemslot[i] = frame.gemslot[i] or frame:CreateTexture(nil, 'ARTWORK')
Nenue@62 32 print(frame[gname])
Nenue@62 33 end
Nenue@62 34 end
Nenue@62 35 frame:Show()
Nenue@62 36 else
Nenue@62 37 frame:Hide()
Nenue@62 38 end
Nenue@62 39 end
Nenue@62 40
Nenue@62 41 plugin.init = function()
Nenue@62 42 hooksecurefunc("PaperDollItemSlotButton_Update", PaperDollItemSlotButton_Update)
Nenue@62 43 end
Nenue@62 44