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.

670 Part IV ■ <strong>Reference</strong>Returns:action—Name <strong>of</strong> the action associated with the key, or the empty string (““) ifthe key is not bound to an action (string)GetBindingByKeyReturns the action bound to a key or key combination.action = GetBindingByKey(“key“)Arguments:key—A key or key combination (e.g. ‘‘CTRL-2‘‘) (string, binding)Returns:action—Name <strong>of</strong> the action associated with the key, or the empty string (““) ifthe key is not bound to an action (string)GetBindingKeyReturns the key combinations <strong>for</strong> a given binding comm<strong>and</strong>.key1, ... = GetBindingKey(“COMMAND“)Although the default UI only allows two combinations to be bound to acomm<strong>and</strong>, more than two can be set via the API.Arguments:COMMAND—Name <strong>of</strong> a binding comm<strong>and</strong> (string)Returns:key1—First key binding <strong>for</strong> the comm<strong>and</strong>, or nil if no key is bound (string,binding)...—A list <strong>of</strong> additional bindings <strong>for</strong> the comm<strong>and</strong> (list)GetBlockChanceReturns the player’s percentage chance to block with a shield.chance = GetBlockChance()Returns:chance—Percentage chance to block (number)GetBonusBarOffsetReturns the current ‘‘stance’’ <strong>of</strong>fset <strong>for</strong> use with the bonus action bar.<strong>of</strong>fset = GetBonusBarOffset()This value corresponds to what ‘‘stance’’ the player is currently in, <strong>and</strong> morespecifically which set <strong>of</strong> actions correspond to that stance. Action IDs <strong>for</strong>special stances start on action bar #7 (or NUM_ACTIONBAR_PAGES + 1), so the<strong>of</strong>fset returned by this function corresponds to the number to be added toNUM_ACTIONBAR_PAGES in calculating action IDs <strong>for</strong> these action bars.Note that the UI definition <strong>of</strong> ‘‘stance’’ includes not just warrior stances butalso druid shapeshift <strong>for</strong>ms, rogue/druid stealth, priest shadow<strong>for</strong>m, <strong>and</strong>various other cases, but does not necessarily include all states normallypresented in the default UI’s stance/shapeshift bar (notable exclusions arepaladin auras <strong>and</strong> death knight presences).

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

Saved successfully!

Ooh no, something went wrong!