12.07.2015 Views

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

526 Part III ■ Advanced Addon TechniquesIt’s a relatively small amount <strong>of</strong> code to write <strong>for</strong> such a big change t<strong>of</strong>unctionality. Figure 26-8 shows a warlock without a pet <strong>and</strong> with an impsummoned <strong>and</strong> fighting.Figure 26-8: SquareUnitFrames <strong>for</strong> a warlock without a pet (left) <strong>and</strong> with a summonedpet (right).<strong>Creating</strong> a SecureGroupPetHeaderTemplateIf instead <strong>of</strong> adding pets to an existing frame, you just want to have a headerconsisting solely <strong>of</strong> pets, Blizzard has provided a template just <strong>for</strong> this purpose.In addition to the attributes allowed by the SecureGroupHeaderTemplate,thefollowing two attributes can be used to customize the display <strong>of</strong> party/raid pets:useOwnerUnit (boolean)—When true,theunit attribute on the createdframes corresponds to the owner’s unit instead <strong>of</strong> the pet’s unit.filterOnPet (boolean)—When true, the pet’s names are used whensorting <strong>and</strong> filtering.In addition to these specific attributes, the pet header accepts the sameattributes as the normal secure group header.SummaryAlthough stringent limitations exist as to what can be accomplished in anaddon, a number <strong>of</strong> powerful templates allow developers to make extremelyfunctional addons. This chapter introduced you to the group header templates,<strong>and</strong> created an extensive party/raid addon.The CodeSquareUnitFramesSquareUnitFrames.toc## Interface: 30300## Title: SquareUnitFrames## Notes: Square shaped party/raid framesSquareUnitFrames.xmlSquareUnitFrames.lua

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!