Nenue@62: -- Veneer Nenue@62: -- PaperDoll.lua Nenue@62: -- Created: 8/16/2016 8:18 AM Nenue@62: -- %file-revision% Nenue@62: -- Nenue@62: Nenue@62: local plugin = CreateFrame('Frame', 'VeneerPaper', UIParent) Nenue@62: local vn, print = LibStub("LibKraken").register(VeneerController, plugin) Nenue@62: Nenue@62: -- PaperDollFrame is separate from InspectUI handlers Nenue@62: local PaperDollItemSlotButton_Update = function(self) Nenue@62: local name = self:GetName() Nenue@62: local slot = self:GetID() Nenue@62: local frame = _G[name .. 'Veneer'] Nenue@62: if not frame then Nenue@62: frame = CreateFrame('Frame', name..'Veneer', self) Nenue@62: frame.label = frame:CreateFontString(nil, 'OVERLAY', 'GameFontNormal') Nenue@62: frame.gemslot = {} Nenue@62: frame:SetPoint('LEFT', self, 'RIGHT') Nenue@62: end Nenue@62: Nenue@62: if self.hasItem then Nenue@62: frame.link = GetInventoryItemLink('player', slot) Nenue@62: frame.gem1, frame.gem2, frame.gem3 = GetInventoryItemGems('player', slot) Nenue@62: frame.label:SetText(GetInventoryItemLink('player', slot)) Nenue@62: -- todo: test GetExtendedItemInfo() Nenue@62: Nenue@62: for i = 1, 3 do Nenue@62: local gname = 'gem'..i Nenue@62: if frame[gname] then Nenue@62: frame.gemslot[i] = frame.gemslot[i] or frame:CreateTexture(nil, 'ARTWORK') Nenue@62: print(frame[gname]) Nenue@62: end Nenue@62: end Nenue@62: frame:Show() Nenue@62: else Nenue@62: frame:Hide() Nenue@62: end Nenue@62: end Nenue@62: Nenue@62: plugin.init = function() Nenue@62: hooksecurefunc("PaperDollItemSlotButton_Update", PaperDollItemSlotButton_Update) Nenue@62: end Nenue@62: