Support proper hotkeys and range coloring for the vehicle buttons.
This commit is contained in:
@@ -239,6 +239,7 @@ function onUpdate(self, elapsed)
|
||||
end
|
||||
end
|
||||
end
|
||||
Bartender4.Button.onUpdate = onUpdate
|
||||
|
||||
local function updateIcon(self)
|
||||
if self.action then
|
||||
|
||||
@@ -197,6 +197,22 @@ function Bartender4:UpdateBlizzardVehicle()
|
||||
]])
|
||||
end
|
||||
RegisterStateDriver(self.vehicleController, "vehicle", "[target=vehicle,exists,bonusbar:5]vehicle;novehicle")
|
||||
local btn = "VehicleMenuBarActionButton%d"
|
||||
for i=1,6 do
|
||||
local name = btn:format(i)
|
||||
local button = _G[name]
|
||||
button.UpdateUsable = Bartender4.Button.prototype.UpdateUsable
|
||||
button:SetScript("OnUpdate", Bartender4.Button.onUpdate)
|
||||
button.icon = _G[("%sIcon"):format(name)]
|
||||
button.border = _G[("%sBorder"):format(name)]
|
||||
button.cooldown = _G[("%sCooldown"):format(name)]
|
||||
button.macroName = _G[("%sName"):format(name)]
|
||||
button.hotkey = _G[("%sHotKey"):format(name)]
|
||||
button.count = _G[("%sCount"):format(name)]
|
||||
button.flash = _G[("%sFlash"):format(name)]
|
||||
button.BT4init = true
|
||||
button:SetParent(VehicleMenuBarActionButtonFrame)
|
||||
end
|
||||
else
|
||||
MainMenuBarArtFrame:UnregisterEvent("UNIT_ENTERING_VEHICLE")
|
||||
MainMenuBarArtFrame:UnregisterEvent("UNIT_ENTERED_VEHICLE")
|
||||
@@ -215,6 +231,13 @@ function Bartender4:UpdateBlizzardVehicle()
|
||||
if self.vehicleController then
|
||||
UnregisterStateDriver(self.vehicleController, "vehicle")
|
||||
end
|
||||
local btn = "VehicleMenuBarActionButton%d"
|
||||
for i=1,6 do
|
||||
local name = btn:format(i)
|
||||
local button = _G[name]
|
||||
button.BT4init = nil
|
||||
button:SetScript("OnUpdate", ActionButton_OnUpdate)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user