Permalink
Browse files

Added vehicle exit button bar & bugfixes

  • Loading branch information...
1 parent 101753a commit ab7b02db511aa65efbad7a165c481a8d180380b0 @Tuller Tuller committed Aug 30, 2012
Showing with 74 additions and 1 deletion.
  1. +2 −0 Dominos.lua
  2. +2 −1 Dominos.toc
  3. +18 −0 menuBar.lua
  4. +52 −0 vehicleBar.lua
View
@@ -232,6 +232,7 @@ function Dominos:Load()
self.BagBar:New()
self.MenuBar:New()
self.ExtraBar:New()
+ self.VehicleBar:New()
--load in extra functionality
for _,module in self:IterateModules() do
@@ -253,6 +254,7 @@ function Dominos:Unload()
self.Frame:ForFrame('menu', 'Free')
self.Frame:ForFrame('bags', 'Free')
self.Frame:ForFrame('extra', 'Free')
+ self.Frame:ForFrame('vehicle', 'Free')
--unload any module stuff
for _,module in self:IterateModules() do
View
@@ -2,7 +2,7 @@
## Title: Dominos
## Notes: A main actionbar replacement
## Author: Tuller
-## Version: 5.0.7
+## Version: 5.0.8
## SavedVariables: DominosDB, DominosVersion
## OptionalDeps: Ace3, LibKeyBound-1.0, Masque, FlyPaper
embeds.xml
@@ -21,4 +21,5 @@ bagBar.lua
menuBar.lua
minimap.lua
extraActionBar.lua
+vehicleBar.lua
bindingsUpdater.lua
View
@@ -30,6 +30,7 @@ function MenuBar:New()
bar:Layout(true)
RegisterStateDriver(bar.header, 'perspective', '[vehicleui]override;[overridebar]override;[petbattle]petbattle;normal')
+ bar:UpdateClickThrough()
return bar
end
@@ -363,6 +364,23 @@ function MenuBar:SetPadding(padW, padH)
self:Layout()
end
+function MenuBar:UpdateClickThrough()
+ local clickThrough = self:GetClickThrough()
+ if clickThrough then
+ self.header:Execute([[
+ for i = 1, #myButtons do
+ myButtons[i]:EnableMouse(false)
+ end
+ ]])
+ else
+ self.header:Execute([[
+ for i = 1, #myButtons do
+ myButtons[i]:EnableMouse(true)
+ end
+ ]])
+ end
+end
+
function MenuBar:DisableMenuButton(button, disabled)
local disabledButtons = self.sets.disabled or {}
View
@@ -0,0 +1,52 @@
+local VehicleBar = Dominos:CreateClass('Frame', Dominos.Frame)
+Dominos.VehicleBar = VehicleBar
+
+function VehicleBar:New()
+ local f = self.super.New(self, 'vehicle')
+
+ f:LoadButtons()
+ f:Layout()
+
+ return f
+end
+
+function VehicleBar:GetDefaults()
+ return {
+ point = 'CENTER',
+ x = -244,
+ y = 0,
+ }
+end
+
+function VehicleBar:GetShowStates()
+ return '[@vehicle,exists]show;hide'
+end
+
+function VehicleBar:NumButtons(f)
+ return 1
+end
+
+function VehicleBar:AddButton(i)
+ local b = self:GetLeaveButton()
+ b:UnregisterAllEvents()
+ if b then
+ b:SetParent(self.header)
+ b:Show()
+
+ self.buttons[i] = b
+ end
+end
+
+function VehicleBar:RemoveButton(i)
+ local b = self.buttons[i]
+ if b then
+ b:SetParent(nil)
+ b:Hide()
+
+ self.buttons[i] = nil
+ end
+end
+
+function VehicleBar:GetLeaveButton()
+ return _G['MainMenuBarVehicleLeaveButton']
+end

0 comments on commit ab7b02d

Please sign in to comment.