# HG changeset patch # User Nenue # Date 1471613318 14400 # Node ID 6ccacc927ef64f22f005ff3d8fcb5def5193f664 # Parent 4fe16cb3f5d6a8285c134a9c361a611f5e455807 - paperdoll scan timing changed to PLAYER_ENTERING_WORLD and PLAYER_EQUIPMENT_CHANGED diff -r 4fe16cb3f5d6 -r 6ccacc927ef6 Modules/PaperDoll.lua --- a/Modules/PaperDoll.lua Wed Aug 17 18:01:42 2016 -0400 +++ b/Modules/PaperDoll.lua Fri Aug 19 09:28:38 2016 -0400 @@ -140,6 +140,8 @@ tinsert(pendingSlots, frame) end + + plugin.ticker() end @@ -160,26 +162,31 @@ plugin.ticker() end + elseif event == 'PLAYER_ENTERING_WORLD' then + UpdateAll() + end end + plugin:SetScript('OnEvent', plugin.event) plugin:RegisterEvent('PLAYER_EQUIPMENT_CHANGED') +plugin:RegisterEvent('PLAYER_ENTERING_WORLD') -hooksecurefunc("ToggleCharacter", function() - if PaperDollFrame:IsVisible() then - UpdateAll() - end -end) + hooksecurefunc("PaperDollItemSlotButton_Update", PaperDollItemSlotButton_Update) hooksecurefunc(GameTooltip, "SetInventoryItem", function(self, unit, slot) if self:GetOwner() == plugin then if unit == 'player' and vnslot[slot] then - local text = GameTooltipTextLeft3:GetText():match('Item Level (%d+)') - if not text then - text = GameTooltipTextLeft2:GetText():match('Item Level (%d+)') + local text + for i = 1, 3 do + text = _G['GameTooltipTextLeft'..i]:GetText() + text = text:match('Item Level (%d+)') + if text then + break + end end vnslot[slot].label:SetText(text or '???') end