Skip to content

Commit

Permalink
core: Hide frames during pet battles.
Browse files Browse the repository at this point in the history
  • Loading branch information
haste committed Oct 7, 2012
1 parent fd7df92 commit 4efb78c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions oUF.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@
</Attributes>
</Button>

<!-- Pet Battle Hider Frame -->
<Frame name="oUF_PetBattleFrameHider" inherits="SecureHandlerStateTemplate" parent="UIParent" setAllPoints="true">
<Scripts>
<OnLoad>
RegisterStateDriver(self, "visibility", "[petbattle] hide; show")
</OnLoad>
</Scripts>
</Frame>

<!--
Sub-object as a child of the parent unit frame:
<Button name="oUF_HeaderTargetTemplate" inherits="SecureUnitButtonTemplate" hidden="true" virtual="true">
Expand Down
4 changes: 2 additions & 2 deletions ouf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ do

local isPetHeader = template:match'PetHeader'
local name = overrideName or generateName(nil, ...)
local header = CreateFrame('Frame', name, UIParent, template)
local header = CreateFrame('Frame', name, oUF_PetBattleFrameHider, template)

header:SetAttribute("template", "oUF_ClickCastUnitTemplate")
for i=1, select("#", ...), 2 do
Expand Down Expand Up @@ -545,7 +545,7 @@ function oUF:Spawn(unit, overrideName)
unit = unit:lower()

local name = overrideName or generateName(unit)
local object = CreateFrame("Button", name, UIParent, "SecureUnitButtonTemplate")
local object = CreateFrame("Button", name, oUF_PetBattleFrameHider, "SecureUnitButtonTemplate")
Private.UpdateUnits(object, unit)

self:DisableBlizzard(unit)
Expand Down

0 comments on commit 4efb78c

Please sign in to comment.