Skip to content

Commit

Permalink
[Bags] Fix oGlow for bags in Classic when the ShestakUI bags aren't e…
Browse files Browse the repository at this point in the history
…nabled
  • Loading branch information
EsreverWoW committed Dec 8, 2023
1 parent bc8bd73 commit 9419b98
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ShestakUI/Core/Disable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ if IsAddOnLoaded("DBM-SpellTimers") then
C.raidcooldown.enable = false
end

if IsAddOnLoaded("AdiBags") or IsAddOnLoaded("ArkInventory") or IsAddOnLoaded("cargBags_Nivaya") or IsAddOnLoaded("cargBags") or IsAddOnLoaded("Bagnon") or IsAddOnLoaded("Combuctor") or IsAddOnLoaded("TBag") or IsAddOnLoaded("BaudBag") then
if IsAddOnLoaded("AdiBags") or IsAddOnLoaded("ArkInventory") or IsAddOnLoaded("cargBags_Nivaya") or IsAddOnLoaded("cargBags") or IsAddOnLoaded("Bagnon") or IsAddOnLoaded("Combuctor") or IsAddOnLoaded("TBag") or IsAddOnLoaded("BaudBag") or IsAddOnLoaded("Baganator") then
C.bag.enable = false
end

Expand Down
35 changes: 26 additions & 9 deletions ShestakUI/Libs/oGlow/Pipes/Bags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,25 @@ local hook
local _E

local pipe = function(self)
for _, button in self:EnumerateValidItems() do
local bagID = button:GetBagID()
local slotID = button:GetID()
local slotLink = C_Container.GetContainerItemLink(bagID, slotID)
if oGlow:IsClassic() then
local id = self:GetID()
local name = self:GetName()
local size = self.size

for i = 1, size do
local bid = size - i + 1
local slotFrame = _G[name.."Item"..bid]
local slotLink = C_Container.GetContainerItemLink(id, i)
oGlow:CallFilters("bags", slotFrame, _E and slotLink)
end
else
for _, button in self:EnumerateValidItems() do
local bagID = button:GetBagID()
local slotID = button:GetID()
local slotLink = C_Container.GetContainerItemLink(bagID, slotID)

oGlow:CallFilters("bags", button, _E and slotLink)
oGlow:CallFilters("bags", button, _E and slotLink)
end
end
end

Expand All @@ -28,11 +41,15 @@ local enable = function(self)
_E = true

if not hook then
for i = 1, NUM_CONTAINER_FRAMES do
local frame = _G["ContainerFrame"..i]
hooksecurefunc(frame, "UpdateItems", pipe)
if oGlow:IsClassic() then
hooksecurefunc("ContainerFrame_Update", pipe)
else
for i = 1, NUM_CONTAINER_FRAMES do
local frame = _G["ContainerFrame"..i]
hooksecurefunc(frame, "UpdateItems", pipe)
end
hooksecurefunc(ContainerFrameCombinedBags, "UpdateItems", pipe)
end
hooksecurefunc(ContainerFrameCombinedBags, "UpdateItems", pipe)

hook = true
end
Expand Down
2 changes: 1 addition & 1 deletion ShestakUI/Modules/Blizzard/Bags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Stuffing = CreateFrame("Frame", nil, UIParent)
Stuffing:RegisterEvent("ADDON_LOADED")
Stuffing:RegisterEvent("PLAYER_ENTERING_WORLD")
Stuffing:SetScript("OnEvent", function(this, event, ...)
if IsAddOnLoaded("AdiBags") or IsAddOnLoaded("ArkInventory") or IsAddOnLoaded("cargBags_Nivaya") or IsAddOnLoaded("cargBags") or IsAddOnLoaded("Bagnon") or IsAddOnLoaded("Combuctor") or IsAddOnLoaded("TBag") or IsAddOnLoaded("BaudBag") then return end
if IsAddOnLoaded("AdiBags") or IsAddOnLoaded("ArkInventory") or IsAddOnLoaded("cargBags_Nivaya") or IsAddOnLoaded("cargBags") or IsAddOnLoaded("Bagnon") or IsAddOnLoaded("Combuctor") or IsAddOnLoaded("TBag") or IsAddOnLoaded("BaudBag") or IsAddOnLoaded("Baganator") then return end
Stuffing[event](this, ...)
end)

Expand Down
2 changes: 1 addition & 1 deletion ShestakUI/Modules/Skins/Blizzard/Container.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if C.skins.blizzard_frames ~= true then return end
-- Bank/Container skin
----------------------------------------------------------------------------------------
local function LoadSkin()
if C.bag.enable == true or (IsAddOnLoaded("AdiBags") or IsAddOnLoaded("ArkInventory") or IsAddOnLoaded("cargBags_Nivaya") or IsAddOnLoaded("cargBags") or IsAddOnLoaded("Bagnon") or IsAddOnLoaded("Combuctor") or IsAddOnLoaded("TBag") or IsAddOnLoaded("BaudBag")) then return end
if C.bag.enable == true or (IsAddOnLoaded("AdiBags") or IsAddOnLoaded("ArkInventory") or IsAddOnLoaded("cargBags_Nivaya") or IsAddOnLoaded("cargBags") or IsAddOnLoaded("Bagnon") or IsAddOnLoaded("Combuctor") or IsAddOnLoaded("TBag") or IsAddOnLoaded("BaudBag") or IsAddOnLoaded("Baganator")) then return end

-- Container Frame
BagItemSearchBox:StripTextures(true)
Expand Down
2 changes: 1 addition & 1 deletion ShestakUI/Modules/Skins/Blizzard/Loot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ local function LoadSkin()
end)

-- Loot frame
if C.loot.lootframe == true or (IsAddOnLoaded("AdiBags") or IsAddOnLoaded("ArkInventory") or IsAddOnLoaded("cargBags_Nivaya") or IsAddOnLoaded("cargBags") or IsAddOnLoaded("Bagnon") or IsAddOnLoaded("Combuctor") or IsAddOnLoaded("TBag") or IsAddOnLoaded("BaudBag")) then return end
if C.loot.lootframe == true or (IsAddOnLoaded("AdiBags") or IsAddOnLoaded("ArkInventory") or IsAddOnLoaded("cargBags_Nivaya") or IsAddOnLoaded("cargBags") or IsAddOnLoaded("Bagnon") or IsAddOnLoaded("Combuctor") or IsAddOnLoaded("TBag") or IsAddOnLoaded("BaudBag") or IsAddOnLoaded("Baganator")) then return end

if T.Classic then
LootFrame:StripTextures()
Expand Down
2 changes: 1 addition & 1 deletion ShestakUI/Modules/Skins/Blizzard_Vanilla/Container.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if C.skins.blizzard_frames ~= true then return end
-- Bank/Container skin
----------------------------------------------------------------------------------------
local function LoadSkin()
if IsAddOnLoaded("AdiBags") or IsAddOnLoaded("ArkInventory") or IsAddOnLoaded("cargBags_Nivaya") or IsAddOnLoaded("cargBags") or IsAddOnLoaded("Bagnon") or IsAddOnLoaded("Combuctor") or IsAddOnLoaded("TBag") or IsAddOnLoaded("BaudBag") then return end
if IsAddOnLoaded("AdiBags") or IsAddOnLoaded("ArkInventory") or IsAddOnLoaded("cargBags_Nivaya") or IsAddOnLoaded("cargBags") or IsAddOnLoaded("Bagnon") or IsAddOnLoaded("Combuctor") or IsAddOnLoaded("TBag") or IsAddOnLoaded("BaudBag") or IsAddOnLoaded("Baganator") then return end

-- Container Frame
for i = 1, NUM_CONTAINER_FRAMES do
Expand Down

0 comments on commit 9419b98

Please sign in to comment.