Hotkeys work properly again
This commit is contained in:
+17
-16
@@ -26,6 +26,7 @@ local KeyBound = LibStub("LibKeyBound-1.0")
|
|||||||
|
|
||||||
Bartender4.Button = {}
|
Bartender4.Button = {}
|
||||||
Bartender4.Button.prototype = Button
|
Bartender4.Button.prototype = Button
|
||||||
|
Button.BT4init = true
|
||||||
function Bartender4.Button:Create(id, parent)
|
function Bartender4.Button:Create(id, parent)
|
||||||
local absid = (parent.id - 1) * 12 + id
|
local absid = (parent.id - 1) * 12 + id
|
||||||
local name = ("BT4Button%d"):format(absid)
|
local name = ("BT4Button%d"):format(absid)
|
||||||
@@ -41,18 +42,6 @@ function Bartender4.Button:Create(id, parent)
|
|||||||
button.stateactions = {}
|
button.stateactions = {}
|
||||||
|
|
||||||
button:SetFrameStrata("MEDIUM")
|
button:SetFrameStrata("MEDIUM")
|
||||||
button:SetNormalTexture("")
|
|
||||||
|
|
||||||
local NormalTexture = button:GetNormalTexture()
|
|
||||||
NormalTexture:SetWidth(66)
|
|
||||||
NormalTexture:SetHeight(66)
|
|
||||||
NormalTexture:ClearAllPoints()
|
|
||||||
NormalTexture:SetPoint("CENTER", 0, -1)
|
|
||||||
NormalTexture:Show()
|
|
||||||
|
|
||||||
button.normalTexture = NormalTexture
|
|
||||||
button.pushedTexture = button:GetPushedTexture()
|
|
||||||
button.highlightTexture = button:GetHighlightTexture()
|
|
||||||
|
|
||||||
-- overwrite some scripts with out customized versions
|
-- overwrite some scripts with out customized versions
|
||||||
button:SetScript("OnEnter", onEnter)
|
button:SetScript("OnEnter", onEnter)
|
||||||
@@ -121,14 +110,13 @@ function Bartender4.Button:Create(id, parent)
|
|||||||
button:SetAttribute("special-" .. tostring(k), v.script)
|
button:SetAttribute("special-" .. tostring(k), v.script)
|
||||||
end
|
end
|
||||||
|
|
||||||
--button:RegisterButtonEvents()
|
|
||||||
|
|
||||||
if LBF and parent.LBFGroup then
|
if LBF and parent.LBFGroup then
|
||||||
local group = parent.LBFGroup
|
local group = parent.LBFGroup
|
||||||
group:AddButton(button)
|
group:AddButton(button)
|
||||||
end
|
end
|
||||||
|
|
||||||
--ActionButton_UpdateAction(button)
|
--self:UpdateAction(true)
|
||||||
|
button:UpdateHotkeys()
|
||||||
|
|
||||||
return button
|
return button
|
||||||
end
|
end
|
||||||
@@ -153,7 +141,7 @@ end
|
|||||||
|
|
||||||
function onEnter(self)
|
function onEnter(self)
|
||||||
if not (Bartender4.db.profile.tooltip == "nocombat" and InCombatLockdown()) and Bartender4.db.profile.tooltip ~= "disabled" then
|
if not (Bartender4.db.profile.tooltip == "nocombat" and InCombatLockdown()) and Bartender4.db.profile.tooltip ~= "disabled" then
|
||||||
ActionButton_SetTooltip(self)
|
self:SetTooltip(self)
|
||||||
end
|
end
|
||||||
KeyBound:Set(self)
|
KeyBound:Set(self)
|
||||||
end
|
end
|
||||||
@@ -262,6 +250,19 @@ function Button:UpdateAction(force)
|
|||||||
ActionButton_UpdateAction(self)
|
ActionButton_UpdateAction(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local orig_ActionButton_UpdateHotkeys = ActionButton_UpdateHotkeys
|
||||||
|
|
||||||
|
ActionButton_UpdateHotkeys = function(self, ...)
|
||||||
|
local name = self:GetName()
|
||||||
|
if name and name:find("^BT4Button") then
|
||||||
|
if self.BT4init then
|
||||||
|
self:UpdateHotkeys()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
orig_ActionButton_UpdateHotkeys(self, ...)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function Button:UpdateHotkeys()
|
function Button:UpdateHotkeys()
|
||||||
local key = self:GetHotkey() or ""
|
local key = self:GetHotkey() or ""
|
||||||
local hotkey = self.hotkey
|
local hotkey = self.hotkey
|
||||||
|
|||||||
Reference in New Issue
Block a user