mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-22 07:36:56 +00:00
710be52f35
Drop the now-vestigial expansion plumbing.
- Delete modules/thirdparty-tbc.lua + its xml Include
- Strip 10 tbc-tagged CreateConfig calls in modules/gui.lua
- Drop the expansion arg from CreateConfig() signature + the disabled-
entry rendering path that depended on it
- Drop the showdisabled GUI toggle + its default
- Simplify pfUI:RegisterModule / pfUI:RegisterSkin to (name, func) only
- Strip the leading version arg ("vanilla:tbc", etc.) from all 114
Register call sites
- Delete the pfUI.expansion variable
53 lines
1.5 KiB
Lua
53 lines
1.5 KiB
Lua
pfUI:RegisterModule("unusable", function ()
|
|
if not pfUI.bag then return end
|
|
if C.appearance.bags.unusable ~= "1" then return end
|
|
|
|
pfUI.unusable = {}
|
|
|
|
local scanner = libtipscan:GetScanner("unusable")
|
|
local durability = string.gsub(DURABILITY_TEMPLATE, "%%[^%s]+", "(.+)")
|
|
local r, g, b, a = strsplit(",", C.appearance.bags.unusable_color)
|
|
|
|
function pfUI.unusable:UpdateSlot(bag, slot)
|
|
-- break on invalid bag slots
|
|
if not pfUI.bags[bag] then return end
|
|
if not pfUI.bags[bag].slots[slot] then return end
|
|
|
|
-- add button shortcuts
|
|
local frame = pfUI.bags[bag].slots[slot].frame
|
|
local name = frame:GetName()
|
|
|
|
-- return on empty buttons
|
|
if not frame.hasItem then return end
|
|
|
|
-- set the proper tooltip method
|
|
if bag == BANK_CONTAINER then
|
|
scanner:SetInventoryItem("player", 39+slot)
|
|
else
|
|
scanner:SetBagItem(bag, slot)
|
|
end
|
|
|
|
-- check for red color in tooltip
|
|
local red = scanner:Color(RED_FONT_COLOR)
|
|
if not red then return end
|
|
|
|
-- check for broken items
|
|
local left = scanner:Line(red)
|
|
local _, _, broken = string.find(left, durability, 1)
|
|
if broken then return end
|
|
|
|
-- update button vertex color
|
|
_G.SetItemButtonTextureVertexColor(frame, r, g, b, a)
|
|
end
|
|
|
|
-- update on regular pfUI button updates
|
|
hooksecurefunc(pfUI.bag, "UpdateSlot", function(self, bag, slot)
|
|
pfUI.unusable:UpdateSlot(bag, slot)
|
|
end)
|
|
|
|
-- update on bank frame itemlock updates
|
|
hooksecurefunc("BankFrameItemButton_UpdateLock", function()
|
|
pfUI.unusable:UpdateSlot(-1, this:GetID())
|
|
end)
|
|
end)
|