Added an option to use the default blizzard vehicle frame for vehicles (the art and all the fun)

This commit is contained in:
Hendrik Leppkes
2009-02-25 23:38:14 +01:00
parent 7b28cae101
commit 6adef77860
4 changed files with 90 additions and 16 deletions
+16 -1
View File
@@ -20,10 +20,15 @@ local defaults = { profile = Bartender4:Merge({
function VehicleBarMod:OnInitialize()
self.db = Bartender4.db:RegisterNamespace("Vehicle", defaults)
self:SetEnabledState(self.db.profile.enabled)
if self.blizzardVehicle then
self:SetEnabledState(false)
else
self:SetEnabledState(self.db.profile.enabled)
end
end
function VehicleBarMod:OnEnable()
if self.blizzardVehicle then return end
if not self.bar then
self.bar = setmetatable(Bartender4.ButtonBar:Create("Vehicle", self.db.profile, L["Vehicle Bar"], true), {__index = VehicleBar})
local buttons = {VehicleMenuBarLeaveButton, VehicleMenuBarPitchUpButton, VehicleMenuBarPitchDownButton}
@@ -61,6 +66,16 @@ function VehicleBarMod:OnEnable()
self:ApplyConfig()
end
function VehicleBarMod:OnDisable()
Bartender4.modulePrototype.OnDisable(self)
VehicleMenuBarPitchUpButton:SetParent(VehicleMenuBar)
VehicleMenuBarPitchUpButton:ClearAllPoints()
VehicleMenuBarPitchDownButton:SetParent(VehicleMenuBar)
VehicleMenuBarPitchDownButton:ClearAllPoints()
VehicleMenuBarLeaveButton:SetParent(VehicleMenuBar)
VehicleMenuBarLeaveButton:ClearAllPoints()
end
function VehicleBarMod:ApplyConfig()
self.bar:ApplyConfig(self.db.profile)
end