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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 27 ■ API <strong>Reference</strong> 541Return:gemColor—The color <strong>of</strong> the given gem socket. (string)BlueYellowRedMetaUnder each section is a list <strong>of</strong> named arguments, followed by a description <strong>of</strong> theargument. After the description is an indicator that tells you which type <strong>of</strong> Lua valueto pass (or what type to expect from the function). In this case, the function accepts anumeric argument called index <strong>and</strong> returns a string that is the color <strong>of</strong> the socket. Ifthe argument is optional, this will be indicated in the argument listing as well as in thefunction signature.Common API FlagsThroughout the API, there are a number <strong>of</strong> common attributes that a given functionmight have, <strong>for</strong> example those functions that cannot be called by addons duringcombat. Table 27-1 shows a listing <strong>of</strong> the various API flags.When a function is flagged with one <strong>of</strong> the API flags, you will see a margin iconindicating this. Although most flags are self explanatory, you can always refer back toTable 27-1 <strong>for</strong> more in<strong>for</strong>mation.Table 27-1: API FlagsFLAGblizzarduiconfirmationhardwareluaapimaconlynocombatprotectedDESCRIPTIONThis function is not a C API but a Lua function declared inBlizzard’s default user interface. Its implementation can beviewed by extracting the addon data using the Addon Kitprovided by Blizzard.This function does not prompt the user <strong>for</strong> confirmationbe<strong>for</strong>e its results take effect -- that behavior is provided bythe default UI, <strong>and</strong> this function is called from theconfirmation dialogThis function requires a key or mouse press in order to beused, but may not be protected.This function is defined in the Lua st<strong>and</strong>ard librariesThis function is designed <strong>for</strong> the Mac OS X client only.This function cannot be called during combat.This function is protected <strong>and</strong> can only be called by theBlizzard user interface.

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

Saved successfully!

Ooh no, something went wrong!