mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-24 04:50:49 +00:00
skin: restore items after tab for long distance
This commit is contained in:
@@ -66,7 +66,7 @@ pfUI:RegisterSkin("InspectFrame", function ()
|
|||||||
frame:SetScript("OnEnter", function()
|
frame:SetScript("OnEnter", function()
|
||||||
if not GetInventoryItemLink(InspectFrame.unit, this:GetID()) and this.hasItem then
|
if not GetInventoryItemLink(InspectFrame.unit, this:GetID()) and this.hasItem then
|
||||||
GameTooltip:SetOwner(this, "ANCHOR_TOPRIGHT")
|
GameTooltip:SetOwner(this, "ANCHOR_TOPRIGHT")
|
||||||
GameTooltip:SetHyperlink("item:"..cache[this:GetID()])
|
GameTooltip:SetHyperlink("item:"..cache[this:GetID()]["id"])
|
||||||
GameTooltip:Show()
|
GameTooltip:Show()
|
||||||
else
|
else
|
||||||
funce()
|
funce()
|
||||||
@@ -137,15 +137,23 @@ pfUI:RegisterSkin("InspectFrame", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
hooksecurefunc("InspectPaperDollItemSlotButton_Update", function(button)
|
hooksecurefunc("InspectPaperDollItemSlotButton_Update", function(button)
|
||||||
UpdateSlots()
|
|
||||||
QueueFunction(UpdateSlots)
|
|
||||||
|
|
||||||
local link = GetInventoryItemLink(InspectFrame.unit, button:GetID())
|
local link = GetInventoryItemLink(InspectFrame.unit, button:GetID())
|
||||||
if link then
|
if link then
|
||||||
local _,_,itemID = string.find(link, 'item:(%d+)')
|
local _,_,itemID = string.find(link, 'item:(%d+)')
|
||||||
cache[button:GetID()] = itemID
|
cache[button:GetID()] = {}
|
||||||
end
|
cache[button:GetID()]["id"] = itemID
|
||||||
end)
|
cache[button:GetID()]["tex"] = GetInventoryItemTexture(InspectFrame.unit, button:GetID())
|
||||||
|
cache[button:GetID()]["count"] = GetInventoryItemCount(InspectFrame.unit, button:GetID())
|
||||||
|
elseif cache[button:GetID()] then
|
||||||
|
-- restore cache information
|
||||||
|
SetItemButtonTexture(button, cache[button:GetID()]["tex"])
|
||||||
|
SetItemButtonCount(button, cache[button:GetID()]["count"]);
|
||||||
|
button.hasItem = 1;
|
||||||
|
end
|
||||||
|
|
||||||
|
UpdateSlots()
|
||||||
|
QueueFunction(UpdateSlots)
|
||||||
|
end, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
do -- Honor Tab
|
do -- Honor Tab
|
||||||
|
|||||||
Reference in New Issue
Block a user