-
Posted by Shefki on Sat, 17 May 2008 23:34:44
XSSFilter could not parse (X)HTML: <p>Part of the example code at:</p> <p>http://www.wowprogramming.com/docs/api/GetItemFamily</p> <p>contains:</p> <p><span style="line-height: 19px;"> <pre style="font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.5; font-weight: inherit; padding: 0px; border: 0px initial initial;"><code style="font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.5; font-weight: inherit; color: #996633; padding: 0px; border: 0px initial initial;"> -- If the item is a container, then the itemFamily should be 0 local itemType = select(6, GetItemInfo(item)) if itemType == "Container" or itemType == "Quiver" then itemFamily = 0 end</code></pre> <p>The 6th return of GetItemInfo() returns the localized name of the category of a given item. As a result the code will fail on non-English locales. This is a locale independent way of doing the same thing:</p> <p> <pre style="font-style: inherit; vertical-align: baseline; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.5; font-weight: inherit; padding: 0px; border: 0px initial initial;"><code style="font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; margin-top: 1.5em; margin-right: 0px; margin-bottom: 1.5em; margin-left: 0px; white-space: pre; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; line-height: 1.5; font-weight: inherit; color: #996633; padding: 0px; border: 0px initial initial;"> -- If the item is a container, then the itemFamily should be 0 local equipSlot = select(9, GetItemInfo(item)) if equipSlot == "INVTYPE_BAG" then itemFamily = 0 end</code></pre> </p> <p> </p> <p></span></p></p> -
Posted by morlando on Sat, 17 May 2008 23:34:43
Thanks for the tip! I'll update it.
-
Posted by jnwhiteh on Sat, 17 May 2008 23:34:44
These pages are fully editable as well, so feel free to click the "Edit" button and alter the documentation directly if you find any issues with it (or continue to post them here and we'll update).
Cheers!