Skip to content

Commit e370982

Browse files
committed
Work around a Blizzard bug with the button highlighting when mouseovering
the bag buttons by keeping BagSlot.OnEnter and BagSlot.OnLeave registere. always. Fix #49
1 parent 237cfcc commit e370982

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

ContainerPanel.lua

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,16 @@ function LiteBagContainerPanelMixin:OnHide()
160160
LB.db.UnregisterAllCallbacks(self)
161161

162162
ContainerFrameCombinedBagsMixin.OnHide(self)
163+
-- Reregister these to keep them registered. Work around a Blizzard bug where
164+
-- closing the bags with a keybind while the mouse is over a bagbutton will leave
165+
-- the slots highlighted forever.
166+
EventRegistry:RegisterCallback("BagSlot.OnEnter", self.OnBagSlotEnter, self)
167+
EventRegistry:RegisterCallback("BagSlot.OnLeave", self.OnBagSlotLeave, self)
163168

164169
-- UpdateNewItemList is broken in DF 10.0 and only clears the backpack
165170
-- on a combined frame. Fix it up ourselves.
166171
for _, itemButton in self:EnumerateValidItems() do
167-
C_NewItems.RemoveNewItem(itemButton:GetBagID(), itemButton:GetID());
172+
C_NewItems.RemoveNewItem(itemButton:GetBagID(), itemButton:GetID())
168173
end
169174

170175
self:UnregisterEvent("PLAYERBANKSLOTS_CHANGED")
@@ -364,7 +369,7 @@ function LiteBagContainerPanelMixin:UpdateMiscellaneousFrames()
364369
if self:MatchesBagID(Enum.BagIndex.Bank) then
365370
self:GetParent():SetPortraitToUnit('npc')
366371
elseif self:MatchesBagID(Enum.BagIndex.Backpack) then
367-
self:GetParent():SetPortraitToAsset("Interface/Icons/Inv_misc_bag_08");
372+
self:GetParent():SetPortraitToAsset("Interface/Icons/Inv_misc_bag_08")
368373
else
369374
self:GetParent():SetPortraitToBag(self.bagIDs[1])
370375
end
@@ -384,7 +389,7 @@ function LiteBagContainerPanelMixin:OnTokenWatchChanged()
384389
end
385390

386391
function LiteBagContainerPanelMixin:SetTokenTracker(tokenFrame)
387-
-- tokenFrame:SetParent(self);
392+
-- tokenFrame:SetParent(self)
388393
-- tokenFrame:SetIsCombinedInventory(true)
389394
end
390395

Core.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ local REPLACEMENT_GLOBALS = {
8181
end
8282

8383
OpenBackpack()
84-
EventRegistry:TriggerEvent("ContainerFrame.OpenAllBags");
84+
EventRegistry:TriggerEvent("ContainerFrame.OpenAllBags")
8585
end,
8686

8787
ToggleAllBags =
@@ -131,7 +131,7 @@ local HOOKED_GLOBALS = {
131131
FRAME_THAT_OPENED_BAGS = nil
132132

133133
local wasShown = CloseBackpack()
134-
EventRegistry:TriggerEvent("ContainerFrame.CloseAllBags");
134+
EventRegistry:TriggerEvent("ContainerFrame.CloseAllBags")
135135
return wasShown
136136
end,
137137

Frame.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function LiteBagFrameMixin:ShowPanel(n)
167167
end
168168

169169
function LiteBagFrameMixin:OnLoad()
170-
self:SetPortraitTextureSizeAndOffset(36, -4, 1);
170+
self:SetPortraitTextureSizeAndOffset(36, -4, 1)
171171
self.Tabs[1]:SetText(self.panels[1].Title)
172172
PanelTemplates_SetNumTabs(self, 1)
173173
PanelTemplates_SetTab(self, 1)

0 commit comments

Comments
 (0)