Skip to content

Commit

Permalink
Overall general fixes and improvements (#865)
Browse files Browse the repository at this point in the history
* Fixed addon taint when hitting esc to close windows in combat.

* Fixed a bug where toggling all bank bags didn't open all bags.

* Fix for tutorial windows that do not close.

* Added quality overlay for items.

* Fixed profession tool tutorial that causes bags to close when selling items.
  • Loading branch information
Cidan authored Jan 5, 2023
1 parent 8272e2a commit 86e15e9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
13 changes: 9 additions & 4 deletions core/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ function addon:OnInitialize()
end
--@end-alpha@

-- Disable the reagent bag tutorial
C_CVar.SetCVarBitfield("closedInfoFrames", LE_FRAME_TUTORIAL_EQUIP_REAGENT_BAG, true)
C_CVar.SetCVarBool("professionToolSlotsExampleShown", true)
C_CVar.SetCVarBool("professionAccessorySlotsExampleShown", true)

self:Debug('Initialized')
end

Expand Down Expand Up @@ -179,15 +184,15 @@ end

function addon:EnableHooks()
self:RawHook("OpenAllBags", true)
self:RawHook("CloseAllBags", true)
self:SecureHook("CloseAllBags")
self:RawHook("ToggleAllBags", true)
self:RawHook("ToggleBackpack", true)
self:RawHook("ToggleBag", true)
self:RawHook("OpenBag", true)
self:RawHook("CloseBag", true)
self:SecureHook("CloseBag")
self:RawHook("OpenBackpack", true)
self:RawHook("CloseBackpack", true)
self:RawHook('CloseSpecialWindows', true)
self:SecureHook("CloseBackpack")
self:SecureHook('CloseSpecialWindows')
end

function addon:DisableHooks()
Expand Down
6 changes: 5 additions & 1 deletion core/Hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ do

function IterateBuiltInContainers()
if addon:GetInteractingWindow() == "BANKFRAME" then
return iter, NUM_BAG_SLOTS + NUM_BANKBAGSLOTS, -1
if addon.isRetail then
return iter, NUM_TOTAL_EQUIPPED_BAG_SLOTS+1 + NUM_BANKBAGSLOTS, -1
else
return iter, NUM_BAG_SLOTS + NUM_BANKBAGSLOTS, -1
end
else
return iter, NUM_BAG_SLOTS, -1
end
Expand Down
8 changes: 7 additions & 1 deletion widgets/ItemButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ else
buttonClass, buttonProto = addon:NewClass("ItemButton", "Button", "ContainerFrameItemButtonTemplate", "ABEvent-1.0")
end

local childrenNames = { "Cooldown", "IconTexture", "IconQuestTexture", "Count", "Stock", "NormalTexture", "NewItemTexture" }
local childrenNames = { "Cooldown", "IconTexture", "IconQuestTexture", "Count", "Stock", "NormalTexture", "NewItemTexture", "IconOverlay2" }

function buttonProto:OnCreate()
local name = self:GetName()
Expand Down Expand Up @@ -341,6 +341,7 @@ function buttonProto:Update()
self:UpdateNew()
if addon.isRetail then
self:UpdateUpgradeIcon()
self:UpdateOverlay()
end
if self.UpdateSearch then
self:UpdateSearch()
Expand Down Expand Up @@ -477,6 +478,11 @@ function buttonProto:UpdateBorder(isolatedEvent)
end
end

function buttonProto:UpdateOverlay()
local _, _, _, quality = GetContainerItemInfo(self.bag, self.slot)
SetItemButtonOverlay(self, self.itemId or self.itemLink or 0, quality)
end

--------------------------------------------------------------------------------
-- Item stack button
--------------------------------------------------------------------------------
Expand Down

0 comments on commit 86e15e9

Please sign in to comment.