Go to Page... |
Thread Tools | Display Modes |
06-03-09, 11:57 AM | #1 |
GroupHeader: PartyMembers, PartyTargets & PartyPets
I have some questions about spawning party target&pet frames, but first I shall show you roughly how I implement my setup.
The Situation Currently the desired method of spawning frames for partypets and partytargets is via a secureFramesTemplate. 1. create the template.xml your_ouf_layout/partyTemplate.xml Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/../FrameXML/UI.xsd"> <Button name="oUF_Smee2_Groups_Party" inherits="SecureUnitButtonTemplate" hidden="true" virtual="true"> <Frames> <Button name="$parent_Target" inherits="SecureUnitButtonTemplate"> <Anchors> <Anchor point="BOTTOM" relativePoint="TOP" relativeTo="$parent"> <Offset> <AbsDimension x="0" y="3"/> </Offset> </Anchor> </Anchors> <Attributes> <Attribute name="unitsuffix" type="string" value="target"/> <Attribute name="unitprefix" type="string" value="party"/> <Attribute name="useparent-unit" type="boolean" value="true"/> <Attribute name="type1" type="string" value="target"/> <Attribute name="initial-unitWatch" type="boolean" value="true"/> </Attributes> </Button> <Button name="$parent_Pet" inherits="SecureUnitButtonTemplate"> <Anchors> <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent"> <Offset> <AbsDimension x="0" y="-3"/> </Offset> </Anchor> </Anchors> <Attributes> <Attribute name="unitsuffix" type="string" value="pet"/> <Attribute name="unitprefix" type="string" value="party"/> <Attribute name="useparent-unit" type="boolean" value="true"/> <Attribute name="type1" type="string" value="pet"/> <Attribute name="initial-unitWatch" type="boolean" value="true"/> </Attributes> </Button> </Frames> </Button> </Ui> your_ouf_layout/your_ouf_layout.toc Code:
## Interface: 30100 ## Title: <<your_ouf_layout>> ## Author: <<your_name>> ## Version: 0.1 ## Notes: oUF layout. ## OptionalDeps: oUF_Banzai, oUF_HealComm, oUF_DebuffHighlight,oUF_SpellRange, oUF_ReadyCheck ## RequiredDeps: oUF ## DefaultState: enabled party-template.xml core.lua your_ouf_layout/core.lua Refer to it by the template name in your spawn function. specifying that it is the template which we wish to use in order to define aspects about our group frames. Code:
local party = oUF:Spawn("header", "oufparty") party:SetPoint(anchorFromPoint, UIParent, anchorToPoint, anchorX, anchorY) party:SetManyAttributes( "template", "oUF_Smee2_Groups_Party", "showRaid", false, "showParty", true, "showPlayer", true, "yOffSet", partySettings.unit.yOffSet, "xOffSet", partySettings.unit.xOffSet, "point", partySettings.unit.anchorFromPoint, "initial-height", partySettings.unit.height, "initial-width", partySettings.unit.width) The Question As you see above, the xml template names each child frame based on the framename of the parent. (a pet frame of the party3 frame becomes part3_pet) I am trying to work out if it is also possible to send in other variables. i want to be able to control the x y coord of the child frames after spawning (out of combat of course). perhaps something like : Code:
party:SetManyAttributes( "target_xOffset", 0, "target_yOffset", -24, "pet_xOffset", 0, "pet_yOffset", -24) Code:
<Button name="$parent_Pet" inherits="SecureUnitButtonTemplate"> <Anchors> <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent"> <Offset> <AbsDimension x="$pet_xOffset" y="$pet_yOffset"/> </Offset> </Anchor> </Anchors> <Attributes> <Attribute name="unitsuffix" type="string" value="pet"/> <Attribute name="unitprefix" type="string" value="party"/> <Attribute name="useparent-unit" type="boolean" value="true"/> <Attribute name="type1" type="string" value="pet"/> <Attribute name="initial-unitWatch" type="boolean" value="true"/> </Attributes> </Button> |
|
06-03-09, 12:10 PM | #2 |
If your template also inherits from SecureHandlerAttributeTemplate, you may also be able to reposition child frames accroding to certain circumstances, including doing so during combat. I'm not sure off the top of my head what attributes the header would set on the template that you'd want to respond to, though, other than perhaps "unit".
|
|
06-03-09, 04:46 PM | #3 |
The reason I wanted to be able to use the SetAttributes function of the template header was that doing so makes it a simple matter of fire and forget.
Code:
function addon:UpdatePartyFrames(dbSettings) for key,value in pairs(dbSettings)do party:SetAttributes(key,value) end end Code:
function addon:UpdatePartyFrames(dbSettings) for name,frame in pairs(oUF.units)do if (name:gmatch("party")) then if (name:gmatch("target")) then --update frame according to partytarget frame settings elseif (name:gmatch("pet")) then --update frame according to partypet frame settings end end end end |
|
WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » GroupHeader: PartyMembers, PartyTargets & PartyPets |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|