Skip to content

Commit

Permalink
Update ItemCache
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonomit committed Dec 21, 2024
1 parent ff92817 commit 4d59d5a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Libs/ItemCache/ItemCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ local format = format
local strsplit = strsplit
local wipe = wipe
local GetMouseFocus = GetMouseFocus
local DoesItemExistByID = C_Item.DoesItemExistByID
local GetItemInfo = GetItemInfo -- removes the need to bypass own hook
local GetItemInfoInstant = GetItemInfoInstant
local UnitExists = UnitExists
Expand All @@ -44,6 +43,16 @@ local mathFloor = math.floor
local mathHuge = math.huge


-- https://github.com/Stanzilla/WoWUIBugs/issues/449
-- Can use C_Item.GetItemIconByID to instantly retrieve the icon, but it causes a request for item info
local DoesItemExistByID = C_Item.DoesItemExistByID
-- if DoesItemExistByID(1) then
-- DoesItemExistByID = function(itemID)
-- return C_Item.GetItemIconByID(itemID) ~= 134400 -- question icon
-- end
-- end


local function MakeLookupTable(t, val, keepOrigVals)
local ValFunc
if val ~= nil then
Expand Down Expand Up @@ -103,8 +112,8 @@ do
expansionsHelper.isEra = expansionsHelper.expansionLevel == expansionsHelper.expansions.era

local season = ((C_Seasons or {}).GetActiveSeason or nop)() or 0
expansionsHelper.isSoM = season == Enum.SeasonID.SeasonOfMastery
expansionsHelper.isSoD = season == Enum.SeasonID.SeasonOfDiscovery
expansionsHelper.isSoM = C_Seasons and season == Enum.SeasonID.SeasonOfMastery or false
expansionsHelper.isSoD = C_Seasons and season == Enum.SeasonID.SeasonOfDiscovery or false
end

local MY_CLASS = select(2, UnitClassBase"player")
Expand Down Expand Up @@ -747,6 +756,7 @@ end

function ItemDB:InitMouseoverHook()
self.mouseoverHook = true
if expansionsHelper.isRetail then return end
GameTooltip:HookScript("OnTooltipSetItem", function(tooltip)
if not self.mouseoverHook then return end

Expand Down

0 comments on commit 4d59d5a

Please sign in to comment.