Permalink
Browse files

override bar fixes

  • Loading branch information...
1 parent 9eaa018 commit 36af710d2f4d1a53f4a4c0a9a995600914208942 @Tuller Tuller committed Sep 3, 2012
Showing with 39 additions and 9 deletions.
  1. +8 −4 Dominos.lua
  2. +1 −1 Dominos.toc
  3. +30 −4 frame.lua
View
@@ -340,12 +340,16 @@ function Dominos:UsingOverrideUI()
end
function Dominos:UpdateUseOverrideUI()
- local overrideFrame = _G['OverrideActionBar']
+ local usingOverrideUI = self:UsingOverrideUI()
- if self:UsingOverrideUI() then
- overrideFrame:SetParent(UIParent)
+ self.PerspectiveController:SetAttribute('state-useoverrideui', usingOverrideUI)
+
+ local oab = _G['OverrideActionBar']
+ oab:ClearAllPoints()
+ if usingOverrideUI then
+ oab:SetPoint('BOTTOM')
else
- overrideFrame:SetParent(self.UIHider)
+ oab:SetPoint('LEFT', oab:GetParent(), 'RIGHT', 100, 0)
end
end
View
@@ -2,7 +2,7 @@
## Title: Dominos
## Notes: A main actionbar replacement
## Author: Tuller
-## Version: 5.0.14
+## Version: 5.0.15
## SavedVariables: DominosDB, DominosVersion
## OptionalDeps: Ace3, LibKeyBound-1.0, Masque, FlyPaper
embeds.xml
View
@@ -7,14 +7,19 @@ local AddonName, Addon = ...
local PerspectiveController
do
- PerspectiveController = CreateFrame('Frame', nil, UIParent, 'SecureHandlerStateTemplate'); PerspectiveController:Hide()
+ PerspectiveController = CreateFrame('Frame', nil, UIParent, 'SecureHandlerStateTemplate')
+ PerspectiveController:Hide()
local OverrideUIWatcher = CreateFrame('Frame', nil, _G['OverrideActionBar'], 'SecureHandlerShowHideTemplate')
OverrideUIWatcher:SetFrameRef('PerspectiveController', PerspectiveController)
- OverrideUIWatcher:SetAttribute('_onshow', [[ self:GetFrameRef('PerspectiveController'):SetAttribute('state-overrideui', 'enabled') ]])
- OverrideUIWatcher:SetAttribute('_onhide', [[ self:GetFrameRef('PerspectiveController'):SetAttribute('state-overrideui', 'disabled') ]])
- PerspectiveController:SetAttribute('state-overrideui', OverrideUIWatcher:IsShown())
+ OverrideUIWatcher:SetAttribute('_onshow', [[
+ self:GetFrameRef('PerspectiveController'):SetAttribute('state-isoverrideuishown', true)
+ ]])
+
+ OverrideUIWatcher:SetAttribute('_onhide', [[
+ self:GetFrameRef('PerspectiveController'):SetAttribute('state-isoverrideuishown', false)
+ ]])
RegisterStateDriver(PerspectiveController, 'petbattleui', '[petbattle]enabled;disabled')
@@ -44,6 +49,23 @@ do
]])
end
+ PerspectiveController:SetAttribute('_onstate-useoverrideui', [[
+ self:RunAttribute('updateOverrideUI')
+ ]])
+
+ PerspectiveController:SetAttribute('_onstate-isoverrideuishown', [[
+ self:RunAttribute('updateOverrideUI')
+ ]])
+
+ PerspectiveController:SetAttribute('updateOverrideUI', [[
+ local isOverrideUIVisible = self:GetAttribute('useoverrideui') and self:GetAttribute('state-isoverrideuishown')
+ if isOverrideUIVisible then
+ self:SetAttribute('state-overrideui', 'enabled')
+ else
+ self:SetAttribute('state-overrideui', 'disabled')
+ end
+ ]])
+
PerspectiveController:SetAttribute('_onstate-overrideui', [[
local enabled = newstate == 'enabled'
@@ -59,6 +81,10 @@ do
frame:SetAttribute('state-petbattleui', enabled)
end
]])
+
+ PerspectiveController:SetAttribute('state-isoverrideuishown', OverrideUIWatcher:IsShown())
+
+ Dominos.PerspectiveController = PerspectiveController
end
local Frame = Dominos:CreateClass('Frame')

0 comments on commit 36af710

Please sign in to comment.