Permalink
Browse files

Macro state powers activate

Added support for the stock vehicle bar
Dropped dominos vehicle bar
Replaced extra action bar proxy with [extractionbar]show;hide state
Updated possess bar macro conditional
  • Loading branch information...
Tuller committed Aug 4, 2012
1 parent e9f4194 commit 506010f84905fe75a44ef0a251eca12cf88f4597
Showing with 90 additions and 271 deletions.
  1. +7 −88 Dominos.lua
  2. +3 −4 Dominos.toc
  3. +1 −1 actionButton.lua
  4. +2 −2 barStates.lua
  5. +4 −8 extraActionBar.lua
  6. +16 −5 frame.lua
  7. +56 −13 menuBar.lua
  8. +1 −1 petBar.lua
  9. +0 −149 vehicleBar.lua
View
@@ -231,7 +231,6 @@ function Dominos:Load()
self.PetBar:New()
self.BagBar:New()
self.MenuBar:New()
- self.VehicleBar:New()
self.ExtraBar:New()
--load in extra functionality
@@ -253,7 +252,6 @@ function Dominos:Unload()
self.Frame:ForFrame('class', 'Free')
self.Frame:ForFrame('menu', 'Free')
self.Frame:ForFrame('bags', 'Free')
- self.Frame:ForFrame('vehicle', 'Free')
self.Frame:ForFrame('extra', 'Free')
--unload any module stuff
@@ -266,101 +264,22 @@ end
--[[ Blizzard Stuff Hiding ]]--
function Dominos:HideBlizzard()
- _G['ActionBarController']:UnregisterAllEvents()
- _G['ActionBarController']:RegisterEvent('UPDATE_EXTRA_ACTIONBAR')
+ local noop = _G['Multibar_EmptyFunc'] or function() end
+ -- _G['ActionBarController']:UnregisterAllEvents()
+ -- _G['ActionBarController']:RegisterEvent('UPDATE_EXTRA_ACTIONBAR')
+ -- _G['ActionBarController']:RegisterEvent('UPDATE_VEHICLE_ACTIONBAR')
+ -- _G['ActionBarController']:RegisterEvent('UPDATE_OVERRIDE_ACTIONBAR')
_G['MainMenuExpBar']:UnregisterAllEvents()
- _G['OverrideActionBar']:UnregisterAllEvents()
_G['MainMenuBarArtFrame']:UnregisterAllEvents()
_G['MainMenuBarArtFrame']:RegisterEvent('CURRENCY_DISPLAY_UPDATE')
_G['MainMenuBarArtFrame']:RegisterEvent('UNIT_LEVEL')
_G['MainMenuBar']:Hide()
- -- local uiHider = CreateFrame("Frame"); uiHider:Hide()
- -- self.uiHider = uiHider
-
- -- local newForAll = function(f)
- -- return function(...)
- -- for i = 1, select('#', ...) do
- -- f(select(i, ...))
- -- end
- -- end
- -- end
-
- -- local disableFrames = newForAll(function(name)
- -- local f = _G[name]
-
- -- if not f then
- -- print(string.format('Uknown frame name "%s"', name))
- -- else
- -- f:UnregisterAllEvents()
- -- f:SetParent(uiHider)
- -- f:Hide()
- -- end
- -- end)
-
- -- local nilFramePositions = newForAll(function(name)
- -- local f = _G[name]
-
- -- if not f then
- -- print(string.format('Uknown frame name "%s"', name))
- -- else
- -- f.ignoreFramePositionManager = true
- -- end
- -- end)
-
- -- disableFrames(
- -- 'MultiBarRight',
- -- 'MultiBarLeft',
- -- 'MultiBarBottomLeft',
- -- 'MultiBarBottomRight',
- -- 'MainMenuBar',
- -- 'MainMenuExpBar',
- -- 'MainMenuBarArtFrame'
- -- )
-
- -- nilFramePositions(
- -- 'MultiBarRight',
- -- 'MultiBarLeft',
- -- 'MultiBarBottomLeft',
- -- 'MultiBarBottomRight',
- -- 'MainMenuBar',
- -- 'ExtraActionBarFrame'
- -- )
-
- -- --register necessary main menu events
- -- MainMenuBarArtFrame:RegisterEvent('BAG_UPDATE') --needed to display the keyring
- -- MainMenuBarArtFrame:RegisterEvent('CURRENCY_DISPLAY_UPDATE') --needed to display stuff on the backpack button
-
- -- --hide some weird effects of loading the talent frame
- -- -- local talentFrame = _G['PlayerTalentFrame']
- -- -- if talentFrame then
- -- -- talentFrame:UnregisterEvent('ACTIVE_TALENT_GROUP_CHANGED')
- -- -- else
- -- -- hooksecurefunc('TalentFrame_LoadUI', function()
- -- -- _G['PlayerTalentFrame']:UnregisterEvent('ACTIVE_TALENT_GROUP_CHANGED')
- -- -- end)
- -- -- end
-
- -- --hack, to make sure the seat indicator is placed in the right spot
- -- if not _G['VehicleSeatIndicator']:IsUserPlaced() then
- -- _G['VehicleSeatIndicator']:SetPoint("TOPRIGHT", MinimapCluster, "BOTTOMRIGHT", 0, -13)
- -- end
-
- -- --unregister evil binding events
- -- -- for i = 1, 6 do
- -- -- _G['VehicleMenuBarActionButton' .. i]:UnregisterAllEvents()
- -- -- end
-
- -- -- for i = 1, 12 do
- -- -- _G['BonusActionButton' .. i]:UnregisterAllEvents()
- -- -- _G['MultiCastActionButton' .. i]:UnregisterEvent('UPDATE_BINDINGS')
- -- -- end
-
- -- --prevent multi actionbar grids from randomly showing
- -- MultiActionBar_UpdateGrid = Multibar_EmptyFunc
+ _G['ValidateActionBarTransition'] = noop
+ _G['MultiActionBar_UpdateGrid'] = noop
end
View
@@ -2,7 +2,7 @@
## Title: Dominos
## Notes: A main actionbar replacement
## Author: Tuller
-## Version: 5.0.1
+## Version: 5.0.2
## SavedVariables: DominosDB, DominosVersion
## OptionalDeps: Ace3, LibKeyBound-1.0, Masque, FlyPaper
embeds.xml
@@ -19,7 +19,6 @@ petBar.lua
classBar.lua
bagBar.lua
menuBar.lua
-vehicleBar.lua
minimap.lua
-bindingsUpdater.lua
-extraActionBar.lua
+extraActionBar.lua
+bindingsUpdater.lua
View
@@ -166,7 +166,7 @@ end
function ActionButton:Skin()
if not Dominos:Masque('Action Bar', self) then
_G[self:GetName() .. 'Icon']:SetTexCoord(0.06, 0.94, 0.06, 0.94)
- self:GetNormalTexture():SetVertexColor(1, 1, 1, 0.5)
+ self:GetNormalTexture():SetVertexColor(1, 1, 1, 1)
if _G[self:GetName() .. 'FloatingBG'] then
_G[self:GetName() .. 'FloatingBG']:Hide()
View
@@ -76,8 +76,8 @@ addState('modifier', 'alt', '[mod:alt]', ALT_KEY)
addState('modifier', 'ctrl', '[mod:ctrl]', CTRL_KEY)
addState('modifier', 'shift', '[mod:shift]', SHIFT_KEY)
---possession/vehicle
-addState('possess', 'possess', '[vehicleui]')
+--possession
+addState('possess', 'possess', '[possessbar]')
--paging
for i = 2, 6 do
View
@@ -7,14 +7,6 @@ Dominos.ExtraBar = ExtraBar
function ExtraBar:New()
local f = self.super.New(self, 'extra')
- local proxyShower = CreateFrame('Frame', nil, ExtraActionBarFrame, ' SecureHandlerShowHideTemplate')
- proxyShower:SetFrameRef('extraBar', f.header)
- proxyShower:SetAttribute('_onshow', [[ self:GetFrameRef('extraBar'):Show() ]])
- proxyShower:SetAttribute('_onhide', [[ self:GetFrameRef('extraBar'):Hide() ]])
- ExtraActionBarFrame:ClearAllPoints()
- ExtraActionBarFrame:SetParent(UIParent)
- ExtraActionBarFrame:EnableMouse(false)
-
f:LoadButtons()
f:Layout()
f:UpdateButtonsShown()
@@ -30,6 +22,10 @@ function ExtraBar:GetDefaults()
}
end
+function ExtraBar:GetShowStates()
+ return '[extrabar]show;hide'
+end
+
function ExtraBar:NumButtons(f)
return 1
end
View
@@ -7,17 +7,28 @@ local AddonName, Addon = ...
local FrameParent = CreateFrame('Frame', AddonName .. 'Frame', UIParent, 'SecureHandlerStateTemplate'); FrameParent:SetAllPoints(UIParent);
-FrameParent:SetAttribute('_onstate-display', [[
- local newstate = newstate or 'show'
- if newstate == 'show' then
+FrameParent:SetAttribute('_onstate-perspective', [[
+ local newstate = newstate or 'normal'
+
+ if newstate == 'normal' then
self:Show()
else
self:Hide()
- end
+ end
+
+ local overrideActionBar = self:GetFrameRef('OverrideActionBar')
+ if newstate == 'vehicle' or newstate == 'override' then
+ overrideActionBar:Show()
+ else
+ overrideActionBar:Hide()
+ end
]])
+
+FrameParent:SetFrameRef('OverrideActionBar', _G['OverrideActionBar'])
+RegisterStateDriver(FrameParent, 'perspective', '[vehicleui]vehicle;[overridebar]override;[petbattle]petbattle;normal')
+
Dominos.FrameParent = FrameParent
-RegisterStateDriver(FrameParent, 'display', '[petbattle]hide;show')
local Frame = Dominos:CreateClass('Frame')
View
@@ -32,20 +32,21 @@ local MENU_BUTTON_NAMES = {
--[[ Menu Bar ]]--
function MenuBar:New()
- local f = MenuBar.super.New(self, 'menu')
+ local bar = MenuBar.super.New(self, 'menu')
- f:Layout(true)
-
- return f
+ bar:Layout(true)
+ RegisterStateDriver(bar.header, 'perspective', '[vehicleui]override;[overridebar]override;[petbattle]petbattle;normal')
+
+ return bar
end
function MenuBar:Create(frameId)
local bar = MenuBar.super.Create(self, frameId)
local header = bar.header
-
- RegisterStateDriver(header, 'perspective', '[petbattle]petbattle;normal')
+ local overrideActionBar = _G['OverrideActionBar']
+
--[[ init any bar global variables ]]--
header:Execute([[
@@ -56,6 +57,8 @@ function MenuBar:Create(frameId)
WIDTH_OFFSET = 0
]])
+ header:SetFrameRef('OverrideActionBar', overrideActionBar)
+
--[[
after a layout value is altered, set a dirty bit indicating that we need to adjust the bar's layout
--]]
@@ -67,14 +70,14 @@ function MenuBar:Create(frameId)
]])
header:SetAttribute('layout-normal', [[
- if myButtons then
- for i, button in pairs(myButtons) do
- button:SetParent(self)
- end
-
- needsLayout = true
- self:RunAttribute('layout')
+ if not myButtons then return end
+
+ for i, button in pairs(myButtons) do
+ button:SetParent(self)
end
+
+ needsLayout = true
+ self:RunAttribute('layout')
]])
header:SetAttribute('layout-petbattle', [[
@@ -98,6 +101,31 @@ function MenuBar:Create(frameId)
end
]])
+ header:SetAttribute('layout-override', [[
+ if not(myButtons) then return end
+
+ local numButtons = #myButtons
+ local cols = ceil(numButtons / 2)
+ local spacing = -2
+
+ local b = myButtons[1]
+ local w = b:GetWidth() + spacing - WIDTH_OFFSET
+ local h = b:GetHeight() + spacing - HEIGHT_OFFSET
+ local offsetX = 72
+ local offsetY = -56
+
+ for i, b in pairs(myButtons) do
+ local col = (i-1) % cols
+ local row = ceil(i / cols) - 1
+
+ local b = myButtons[i]
+ b:ClearAllPoints()
+ b:SetParent(self:GetFrameRef('OverrideActionBar'))
+ b:SetPoint('TOPLEFT', '$parent', 'TOP', offsetX + (w*col) + WIDTH_OFFSET, offsetY + (h*row) + HEIGHT_OFFSET)
+ b:Show()
+ end
+ ]])
+
header:SetAttribute('_onstate-numButtons', [[ needsLayout = true ]])
header:SetAttribute('_onstate-columns', [[ needsLayout = true ]])
@@ -111,11 +139,13 @@ function MenuBar:Create(frameId)
--add button method
header:SetAttribute('addButton', [[
local button = self:GetFrameRef('addButton')
+
if button then
myButtons = myButtons or table.new()
table.insert(myButtons, button)
button:SetParent(self:GetFrameRef('buttonFrame') or self)
end
+
self:SetAttribute('maxLength', #myButtons)
]])
@@ -166,6 +196,19 @@ function MenuBar:Create(frameId)
end
end
loadButtons(bar, _G['MainMenuBarArtFrame']:GetChildren())
+ loadButtons(bar, overrideActionBar:GetChildren())
+
+ local wrapper = CreateFrame('Frame', nil, overrideActionBar, 'SecureHandlerShowHideTemplate')
+ wrapper:SetAllPoints(wrapper:GetParent())
+ header:SetFrameRef('OverrideActionBar', wrapper)
+ wrapper:SetFrameRef('header', header)
+
+ --pants hack:
+ --force the state handler for the header to update on the next frame by setting it to an arbitrary invalid state
+ --to ensure that we update micro button positions AFTER MoveMicroButtons is called
+ --would be much easier if we could simply secure wrap the OnShow handler of the OverrideActionBar
+ --however, we can't since its not a true protected frame
+ wrapper:SetAttribute('_onshow', [[ self:GetFrameRef('header'):SetAttribute('state-perspective', 'pants') ]])
return bar
end
View
@@ -86,7 +86,7 @@ function PetBar:New()
end
function PetBar:GetShowStates()
- return '[target=pet,exists,novehicleui]show;hide'
+ return '[@pet,exists,nopossessbar]show;hide'
end
function PetBar:GetDefaults()
Oops, something went wrong.

0 comments on commit 506010f

Please sign in to comment.