Permalink
Browse files

Added support for toggling override ui

  • Loading branch information...
1 parent 6fbe166 commit 8490bb067fc8fec1bb2671882e8374cad90ebd7b @Tuller Tuller committed Sep 3, 2012
Showing with 74 additions and 13 deletions.
  1. +36 −0 Dominos.lua
  2. +1 −1 Dominos.toc
  3. +5 −7 actionBar.lua
  4. +32 −5 frame.lua
View
@@ -114,6 +114,7 @@ function Dominos:GetDefaults()
showTooltips = true,
showTooltipsCombat = true,
showMinimap = true,
+ useVehicleUI = true,
ab = {
count = 10,
@@ -205,6 +206,19 @@ function Dominos:UpdateSettings(major, minor, bugfix)
end
end
end
+
+ --inject new roll bar defaults
+ if major == '5' and minor == '0' and bugfix < '14' then
+ for profile,sets in pairs(self.db.sv.profiles) do
+ if sets.frames then
+ local rollBarFrameSets = sets.frames['roll']
+ if rollBarFrameSets then
+ rollBarFrameSets.showInPetBattleUI = true
+ rollBarFrameSets.showInOverrideUI = true
+ end
+ end
+ end
+ end
end
function Dominos:UpdateVersion()
@@ -273,6 +287,7 @@ function Dominos:HideBlizzard()
-- Hidden parent frame
local UIHider = CreateFrame("Frame"); UIHider:Hide()
+ self.UIHider = UIHider
_G['MultiBarBottomLeft']:SetParent(UIHider)
_G['MultiBarBottomRight']:SetParent(UIHider)
@@ -311,6 +326,27 @@ function Dominos:HideBlizzard()
_G['PetActionBarFrame']:Hide()
_G['PetActionBarFrame']:SetParent(UIHider)
+
+ self:UpdateUseOverrideUI()
+end
+
+function Dominos:SetUseOverrideUI(enable)
+ self.db.profile.useOverrideUI = enable and true or false
+ self:UpdateUseOverrideUI()
+end
+
+function Dominos:UsingOverrideUI()
+ return self.db.profile.useOverrideUI
+end
+
+function Dominos:UpdateUseOverrideUI()
+ local overrideFrame = _G['OverrideActionBar']
+
+ if self:UsingOverrideUI() then
+ overrideFrame:SetParent(UIParent)
+ else
+ overrideFrame:SetParent(self.UIHider)
+ end
end
View
@@ -2,7 +2,7 @@
## Title: Dominos
## Notes: A main actionbar replacement
## Author: Tuller
-## Version: 5.0.13
+## Version: 5.0.14
## SavedVariables: DominosDB, DominosVersion
## OptionalDeps: Ace3, LibKeyBound-1.0, Masque, FlyPaper
embeds.xml
View
@@ -248,14 +248,12 @@ function ActionBar:LoadStateController()
--handle override states
if state == 'possess' or state == 'override' or state == 'vehicle' or state == 'sstemp' then
- local pageController
- if self:GetAttribute('state-overrideui') then
- pageController = self:GetFrameRef('OverrideActionBarController')
- else
- pageController = self:GetFrameRef('MainActionBarController')
+ local actionPage = self:GetFrameRef('OverrideActionBarController'):GetAttribute('actionpage')
+ if actionPage == 0 then
+ actionPage = self:GetFrameRef('MainActionBarController'):GetAttribute('actionpage')
end
-
- self:SetAttribute('override-page', pageController:GetAttribute('actionpage'))
+
+ self:SetAttribute('override-page', actionPage or 0)
control:ChildUpdate('action', 'override')
return
end
View
@@ -93,19 +93,22 @@ function Frame:Create(id, alwaysVisible)
f.header:SetAttribute('id', id)
- if alwaysVisible then
- f.header:SetAttribute('state-showinpetbattleui', true)
- f.header:SetAttribute('state-showinoverrideui', true)
- end
-
f.header:SetAttribute('_onstate-overrideui', [[
self:RunAttribute('updateShown')
]])
+ f.header:SetAttribute('_onstate-showinoverrideui', [[
+ self:RunAttribute('updateShown')
+ ]])
+
f.header:SetAttribute('_onstate-petbattleui', [[
self:RunAttribute('updateShown')
]])
+ f.header:SetAttribute('_onstate-showinpetbattleui', [[
+ self:RunAttribute('updateShown')
+ ]])
+
f.header:SetAttribute('_onstate-display', [[
self:RunAttribute('updateShown')
]])
@@ -205,6 +208,9 @@ function Frame:LoadSettings(defaults)
end
self:UpdateShowStates()
+
+ self:ShowInOverrideUI(self:ShowingInOverrideUI())
+ self:ShowInPetBattleUI(self:ShowingInPetBattleUI())
end
--[[ Layout ]]--
@@ -591,6 +597,27 @@ function Frame:FrameIsShown()
end
+--[[ Perspectives Visibility ]] --
+
+function Frame:ShowInOverrideUI(enable)
+ self.sets.showInOverrideUI = enable and true or false
+ self.header:SetAttribute('state-showinoverrideui', enable)
+end
+
+function Frame:ShowingInOverrideUI()
+ return self.sets.showInOverrideUI
+end
+
+function Frame:ShowInPetBattleUI(enable)
+ self.sets.showInPetBattleUI = enable and true or false
+ self.header:SetAttribute('state-showinpetbattleui', enable)
+end
+
+function Frame:ShowingInPetBattleUI()
+ return self.sets.showInPetBattleUI
+end
+
+
--[[ Clickthrough ]]--
function Frame:SetClickThrough(enable)

0 comments on commit 8490bb0

Please sign in to comment.