Skip to content

Commit ad7f2a4

Browse files
committed
Disable Bartender4 bindings when housing editor is active
Fixes #254
1 parent 2827488 commit ad7f2a4

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

ActionBars.lua

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ function BT4ActionBars:OnEnable()
176176

177177
LAB10:RegisterCallback("OnFlyoutButtonCreated", function(event, button) button:AddToMasque(self.MasqueFlyoutGroup) end)
178178
end
179+
180+
if EventRegistry then
181+
EventRegistry:RegisterCallback("HouseEditor.StateUpdated", function(_, state) self:HousingStateChanged(state) end, self)
182+
end
179183
end
180184

181185
function BT4ActionBars:SetupOptions()
@@ -259,9 +263,23 @@ local function MigrateKeybindBindings(target, ...)
259263
return needSaving
260264
end
261265

266+
function BT4ActionBars:HousingStateChanged(state)
267+
self.InHousing = state
268+
if state and self.actionbars then
269+
for id in pairs(BINDING_MAPPINGS) do
270+
local frame = self.actionbars[id]
271+
if frame then
272+
ClearOverrideBindings(frame)
273+
end
274+
end
275+
elseif not state then
276+
self:ReassignBindings()
277+
end
278+
end
279+
262280
local s_inReassignBindings = false
263281
function BT4ActionBars:ReassignBindings()
264-
if InCombatLockdown() or s_inReassignBindings then return end
282+
if InCombatLockdown() or s_inReassignBindings or self.InHousing then return end
265283
s_inReassignBindings = true
266284

267285
if self.actionbars then

0 commit comments

Comments
 (0)