dont use GameTooltip for caching

This commit is contained in:
Spit
2025-10-03 00:20:58 +03:00
parent f4407ef0ef
commit 717d8489ba
2 changed files with 20 additions and 23 deletions
+9 -11
View File
@@ -1069,7 +1069,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
text = itemColor..itemName;
else
if ( itemID and itemID ~= 0 ) then
GameTooltip:SetHyperlink("item:"..itemID)
AtlasLootCacheTooltip:SetHyperlink("item:"..itemID)
AtlasLootItemsFrame.refreshTime = refreshTimeout
AtlasLootItemsFrame.queue[itemID] = true
end
@@ -1083,10 +1083,8 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
spellName = SpellInfo(spellID)
else
if ( spellID and spellID ~= 0 ) then
GameTooltip:SetOwner(WorldFrame, "ANCHOR_NONE")
GameTooltip:SetHyperlink("enchant:"..spellID)
spellName = GameTooltipTextLeft1:GetText()
GameTooltip:Hide()
AtlasLootCacheTooltip:SetHyperlink("enchant:"..spellID)
spellName = AtlasLootCacheTooltipTextLeft1:GetText()
end
if ( not (spellName and spellName ~= "") ) then
spellName = GetSpellInfoAtlasLootDB["enchants"][spellID]["name"]
@@ -1098,7 +1096,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
text, _, quality = GetItemInfo(craftItem)
if ( not text ) then
if ( craftItem and craftItem ~= 0 ) then
GameTooltip:SetHyperlink("item:"..craftItem)
AtlasLootCacheTooltip:SetHyperlink("item:"..craftItem)
AtlasLootItemsFrame.refreshTime = refreshTimeout
AtlasLootItemsFrame.queue[craftItem] = true
end
@@ -1126,7 +1124,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
text, _, quality = GetItemInfo(craftItem)
if ( not text ) then
if ( craftItem ~= 0 ) then
GameTooltip:SetHyperlink("item:"..craftItem)
AtlasLootCacheTooltip:SetHyperlink("item:"..craftItem)
text = AtlasLoot_FixText(spellName);
AtlasLootItemsFrame.refreshTime = refreshTimeout
AtlasLootItemsFrame.queue[craftItem] = true
@@ -1287,7 +1285,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
for j = 1, table.getn(reagents) do
local reagent = GetSpellInfoAtlasLootDB["craftspells"][spellID]["reagents"][j]
if ( not GetItemInfo(reagent[1]) ) then
GameTooltip:SetHyperlink("item:"..reagent[1]);
AtlasLootCacheTooltip:SetHyperlink("item:"..reagent[1]);
end
end
end
@@ -3284,7 +3282,7 @@ function AtlasLoot_CacheItem(linkOrID)
if GetItemInfo(linkOrID) then
return true
else
GameTooltip:SetHyperlink("item:"..linkOrID)
AtlasLootCacheTooltip:SetHyperlink("item:"..linkOrID)
return false
end
else
@@ -3296,7 +3294,7 @@ function AtlasLoot_CacheItem(linkOrID)
if ( GetItemInfo(item) ) then
return true
else
GameTooltip:SetHyperlink(item)
AtlasLootCacheTooltip:SetHyperlink(item)
return false
end
end
@@ -3448,7 +3446,7 @@ function AtlasLoot_QueryLootPage()
if ( (queryitem) and (queryitem ~= "") and (queryitem ~= 0) and
(string.sub(queryitem, 1, 1) ~= "s") and (string.sub(queryitem, 1, 1) ~= "e") ) then
if ( not GetItemInfo(queryitem) ) then
GameTooltip:SetHyperlink("item:"..queryitem..":0:0:0");
AtlasLootCacheTooltip:SetHyperlink("item:"..queryitem..":0:0:0");
end
end
end
+11 -12
View File
@@ -37,7 +37,7 @@
<Size x="105" y="20"/>
</Button>
<Frame name="AtlasLootDefaultFrame" toplevel="true" frameStrata="HIGH" movable="true" enableMouseClicks="true" hidden="true" parent="UIParent" enableKeyboard="true">
<Frame name="AtlasLootDefaultFrame" toplevel="true" frameStrata="HIGH" movable="true" enableMouse="true" hidden="true" parent="UIParent">
<Size x="600" y="690"/>
<Anchors>
<Anchor point="CENTER"/>
@@ -50,22 +50,14 @@
<Frames>
<Button name="$parent_CloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="AtlasLootDefaultFrame" relativePoint="TOPRIGHT">
<Anchor point="TOPRIGHT">
<Offset x="-10" y="-10"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
AtlasLootDefaultFrame:Hide();
</OnClick>
<OnShow>
this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1);
</OnShow>
</Scripts>
</Button>
<Button name="$parent_Atlas" inherits="AtlasLootDefaultFrameButtonTemplate">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT">
<Anchor point="TOPRIGHT">
<Offset x="-38" y="-15"/>
</Anchor>
</Anchors>
@@ -81,7 +73,6 @@
<OnShow>
local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot");
this:SetText(AL["Atlas"]);
this:SetFrameLevel((this:GetParent()):GetFrameLevel() + 1);
if IsAddOnLoaded("Atlas") then
this:Enable();
else
@@ -452,6 +443,14 @@
<GameTooltip name="AtlasLootTooltip" inherits="GameTooltipTemplate" parent="UIParent" hidden="true"/>
<GameTooltip name="AtlasLootTooltip2" inherits="GameTooltipTemplate" parent="UIParent" hidden="true"/>
<GameTooltip name="AtlasLootCacheTooltip" inherits="GameTooltipTemplate" parent="UIParent" hidden="true">
<Scripts>
<OnLoad>
this:SetOwner(WorldFrame, "ANCHOR_NONE")
</OnLoad>
</Scripts>
</GameTooltip>
<Button name="AtlasLootNewBossLineTemplate" virtual="true" hidden="true">
<Size x="336" y="15"/>