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.

Chapter 27 ■ API <strong>Reference</strong> 545bit.b<strong>and</strong>(GetItemFamily(“Crystallized Air“), 0x0040)-- returns 64, or 0x0040: the item fits in an Enchanting Bagbit.b<strong>and</strong>(GetItemFamily(“Crystallized Air“), 0x0020)-- returns 0, or 0x0000: the item does not fit in an Herb BagbindingA binding is a string identifying one or more keyboard keys or mouse buttons, usedwith key binding <strong>and</strong> modified click API functions <strong>and</strong> the OnKeyDown/OnKeyUp scripth<strong>and</strong>lers. Most letter, number, <strong>and</strong> symbol keys are identified by their (uppercase)letter, number, or symbol.Other keys are identified by a series <strong>of</strong> global variables with names prefacedby KEY_; <strong>for</strong> instance, the localized name <strong>for</strong> the binding NUMPAD0 can be foundin _G[“KEY_NUMPAD0“]. Some keys have plat<strong>for</strong>m-specific names; <strong>for</strong> example, thelocalized name <strong>for</strong> the binding PRINTSCREEN can be found in _G[“KEY_PRINTSCREEN_MAC“] (revealing that it refers to the F13 key found on Mac extended keyboards).Modifier keys are identified as follows:LSHIFT, RSHIFT, SHIFT—Left, right, or generic Shift keyLCTRL, RCTRL, CTRL—Left, right, or generic Control keyLALT, RALT, ALT—Left, right, or generic Alt (or Option) keySTRG—German equivalent to CTRL keyMouse buttons are identified by the token BUTTON followed by the buttonnumber—BUTTON1 <strong>for</strong> the primary (left) button, BUTTON2 <strong>for</strong> the rightbutton, BUTTON3 <strong>for</strong> middle, <strong>and</strong> so on.For use in key bindings, several key/button identifiers can be strung togetherwith hyphens to indicate a key combination; e.g. CTRL-SHIFT-SPACE, RALT-F12,SHIFT-BUTTON1.chatMsgTypeThe chatMsgType is a string identifying the common type <strong>of</strong> a set <strong>of</strong> chat windowmessages; used in chat window functions <strong>for</strong> determining which windows displaywhich messages, <strong>and</strong> the colors <strong>for</strong> displaying each message type.Each CHAT_MSG event has a corresponding chatMsgType identified by the part <strong>of</strong>the event name following the initial CHAT_MSG_; e.g.thechatMsgType <strong>for</strong> CHAT_MSG_COMBAT_FACTION_CHANGE is COMBAT_FACTION_CHANGE. A list <strong>of</strong> pre-configuredchatMsgTypes can be found as keys in the global table ChatTypeInfo.colorStringFormatting used to colorize sections <strong>of</strong> text when being displayed in a FontString.A colorString takes the <strong>for</strong>m |c(colorvalue)(text)|r:colorvalue—A string <strong>of</strong> four hexadecimal <strong>for</strong>matted bytes describingcomponent values <strong>of</strong> the color. Each byte can be a value from 00 (representing

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

Saved successfully!

Ooh no, something went wrong!