Titan Panel - Itemized Deductions (ReBorn) v3.2

This addon helps you to manage free space in your bags. If you ever searched through your inventory to find cheap junk to drop in favor of new loot or tired of manually stacking items that would take much less space, you will instantly understand how you can benefit from Itemized Deductions, because it does it all for you automatically.

Features:
- List of items in your bags sorted by price, allowing you to drop cheapest item or sell it if you happen to talk to vendor at the moment.
- Titan Panel integration: cheapest item and, optionally, its price and total price of all items matching your filter will be displayed on Titan Panel. Howering over will show you full list of items, sorted by price, while right-clicking on it will give you access to most of Itemized Deductions' functions.
- Filters to specify what items you want to consider for drop/sale: you can filter items by quality, item type (quest, consumable, etc), or soulbound status.
- Custom prices: you can set any item to use price other than vendor sell price. Right now Auctioneer buyout price is only option, but any number of those can be added on request.
- Mass selling options: with just a single click you can sell to vendor either all the poor quality items or all items that match your filter.
- Stacks combining: you can automatically combine all incomplete stacks of same items either in bags or in bank.
- Mass mailbox operation: a command available to get mass quantites of same item from your mailbox automatically. Additionally, if those items can be stacked, they'll be automatically stacked together. Just try it after you get back dozens of expired enchanting reagents from autction.

Interface:
- Titan Panel:
  Most of the functions and options are available from Titan Panel Itemized Deductions' button right-click menu. Some of those options only appear when necessary: for example selling commands only show when you're talking to vendor. Additionally you can click on Itemized Deductions to open all your bags, shift-click do destroy or sell cheapest item, alt-click to ignore cheapest item for this session and alt-doubleclick to ignore it completely.
- Slash commands:
  All slash commads start with /itemded, /tpid, or /tid - all those are just aliases and do exactly the same.
  * alwaysdrop (alias: ad) / alwaysignore (alias: ai): add or remove item from "always drop" or "always ignore list". This command is followed by word "add" for adding and "del" or "remove" or "delete" for removing for list, with item link or ID comming last. For example this command will make Ice Cold Milk always droppable, even if you've selected to drop only poor items or filtered consumables: /itemded ad add [Ice Cold Milk]. As another command this command will remove previously ignored Tough Hunk of Bread from list using its ID: /tid ai del 4540.
  * combine (aliases: combineall, combineallinv, combineinv) - combines all incomplete stacks in your bags, just like same function in menu.
  * combinebank (alias: combineallbank) - combines all incomplete stacks in your bank, just like same function in menu. Does nothing if you don't have bank window open, obviously.
  * getmail [ItemLink] (alias: gm) - retrieves all the selected items from mailbox, stacking them together in process. Does nothing if you don't have mailbox window open. In addition to item links you can also use item IDs if you want to put this command in macro or if you're just good at remembering them, as this can save your from finding item link every time. This command, for example, will pull all the Strange Dust out of your mailbox: /itemded gm 10940

Changes:
v3.2
-Updated TOC version for patch 2.4.
-Should be fully WOTLK compatable 
-Updated IDC (thanks to Brkrys)
-Minor bug fixes

v2.9
- Updated TOC version for patch 2.1.
- Empty slots and items are now processed in one loop, yielding minor performance improvement. Because of that logic to skip ammo bags previously used only in calculation of empty slots is now used for sorting items too for yet another small performance benefit.
- Soul pouches are now skipped just as ammo bags were skipped before.
- Minor performance/namespace pollution improvements with localization of some variables.
- Made slash command parser ignore exact number of spaces between commands. Helps greatly if you hit space extra time or insert and item link after typing space, since it seems that after last patch spaces are added to links automatically.
- Internal items database removed completely - it is far too obsolete by now and ItemDataCache knows most of in-game items already.

v2.8
- Fixed "do not use class settings with grey items" comparing with wrong quality. Now it should really work for grey items.

v2.7
- "Combine all", both bank and inventory version, now really select best moves.
- /itemded command now have one more alias: /tpid.
- Slash command added for "combine all": "/itemded combine". "combineall", "combineallinv", and "combineinv" all are aliases for "combine".
- Slash command added for "combine all in bank": "/itemded combinebank". "combineallbank" is alias for "combinebank".
- Slash command added for adding items to "always ignored" list: "/itemded alwaysignored". "alwaysignored" can be shortened to "ai". This command works exactly like "alwaysdrop", so to add item to "always ignored" list type: "/itemded alwaysignored add [ItemLink]" or use "remove" instead of "add" to remove item from this list.
- Use better handling of class/sub-class updates from new version of ItemDataCache. Updates are now delayed to prevent excessive requests to server. This may cause some elements not to appear in "Ignore item by class" menu after fresh WoW installation, patch or some similar event. They should automatically appear after several logins, when data is finally available.
- New option added for displaying total price of listed items directly in panel.
- Eliminated some unnecessary table lookups for small performance boost.
- New option to not use item classes for poor (grey) items. There are some poor items that would be ignored by some classes ("reagents", for example), but as far as I know those items are not actually used anywhere. With this option turned on, all grey items will be droppable, unless you add them to "always ignore" list, of course.
- New command: "/itemded getmail [ItemLink]". "getmail" can be shortened to "gm". This command will get all selected items from your mailbox and automatically stack them. You have to open mail window for it to work, of course. You can also use item ID instead of link if you want to use this in macro. Since inventory and mailbox management work asynchronously, you can run out of space in inventory before items placed there and "combine all" gets chance to work. In this case just repeat command until you get all items.
- Quiver/ammo pouch bags are now detected with same ItemDataCache class functionality and ignoring empty space in those bags should work correctly on any language of client.
- Internal database cut to 1296 entries.

v2.6
- Complete code rewrite. Scanning, tooltip generation, G/S/C coloring code are optimized for performance and reduced garbage generation with lazy calculations and caching of results. UI generation creates menus only once and keeps them instead of trashing old copies every time. Core bag scanning no longer saves all the data it can find on item on every scan, but now stores only 3 elements: price and bag/slot location - everything else is retrieved as necessary. Bag scanning - both core and new "combine all" function - reuse all generated tables, since they all happen to be fixed 3-elements width.
- New items database. Itemized Deductions now have dependency on "ItemDataCache". It is a new ID-based (and thus, locale-independent, unlike old one) database of item data and dynamic data scanner that I wrote to replace old database. This database will make Itemized Deductions work on any language of client, always have up-to-date prices and use less memory for price data. Old database is still here, but all items that are present in new database are removed from old one, leaving only 1/5 of items in it. Old database will be shrinked every time new one grows and eventually will be removed completely.
- Locked items support. The items are now correctly ignored when they are locked (grayed out in your bag when it is about to sell, be moved or anything like). This will make you see results of selling or dropping immediately when you click command and not when action is complete.
- Added "combine all" command. It appears in menu when you have at least two incomplete stacks of some item in inventory (which most often happens when you clear your mailbox) and clicking on it will cause all found stacks to be combined together. Since WoW locks items you move until server responds with "move successful" message, it does not move all items in one go, but finds the best moves until all items are locked, so if you inventory have many incomplete stacks, you may have to click it several times to combine all of them. Items are combined towards last slot of bag because when you use item from hotbar or as ammo, you use first found item in your inventory, so if they were combined towards first slot, you would have new incomplete stack on first use. Another similar command appears for banked items if you have bank window open. BTW, I said "finds the best moves", but current version sometimes fails to find best move and performs less optimal move instead. This is minor, as you can just click combine again, so I postponed fix to next release.
- Threshold levels are moved to submenu and their names are now automagically localized.
- New options for ignore added: "Ignore item class" submenu that lists some classes of items that are often carried around for use and not for sale. Those will appear localized in your client language as well. This feature depends on experimental support of item class/subclass IDs in new version of "ItemDataCache". Please read notes about possible problems with this feature in "ItemDataCache" documentation. If everything works well, next versions will have support for more classes requested by users.
- Tooltip with items available for sale now lists total price for all items.
- New option "Show item price in panel" allow you to turn on display of price for cheapest item in panel near its name. This allows you to immediately see if you should thrash cheapest item in favor of new loot or not without looking at tooltip for current cheapest item price.
- Minor improvement: "item deleted" message now lists number of items in deleted stack and G/S/C colors its worth.
- Due to number of different available ignoring options, "always droppable" setting on item now takes precendence. Items added to this list will always appear in drop/sell list, no matter if they match any ignore filters or not.

v2.5
- Removed some more old dead code.
- Added "sell all listed" command that appears in menu when you have vendor panel open. It is similar to old "sell all junk" command, but instead of all gray items it sells all items listed in ItemDed, taking in account your threshold and ignore settings. Additionally, it won"t sell item if it has custom price set (for example from Auctioneer).
- Fixed misnamed string, "always ignore" now works correctly with chat feedback on.
- Internal support for setting custom price for item that can be obtained from another source dynamically (like from Auctioneer) or just be set by player. There"s no access to manual override from UI yet. All items set to custom price will have corresponding tag in list that is displayed when you hover over ItemDed button. If price cannot be fetched (for example when you request Auctioneer price and item was never seen at auction) tag will have "N/A" before it and normal vendor price will be used.
- Auctioneer support. You can set any item to use Auctioneer suggested price (tag: buyout).
- Always droppable/sellable items: you can mark any item to be always eligible for drop/sale, no matter what quality it have and what threshold is set in your option right now. You may want to use this feature to mark as sellable junk food that does not give bonuses or cheap shaman spell reagents, etc. You can mark item from ItemDed button right click menu, but since you can normally only change options for cheapest listed item this will only be of use for removing this setting from item. To add/remove any item to list you can use a new slash command: "/itemded alwaysdrop add [Item Link]". Item links, as always, can be inserted in command line by shift-clicking any item. If you don"t have item at hand but know its ID, you can use that too. "/tid" is synonym to "/itemded". "alwaysdrop" can be shortened to "ad". To remove item from replace "add" with "remove" or "del" or, as already mentioned, just uncheck this option in ItemDed right-click menu. Note that "ignore/always ignore" have higher precedence. If you have some item in both "always drop" and "ignore/always ignore" list, it won"t appear in ItemDed list of droppable items.

v2.4
- Updated TOC version.
- Added check before calling ContainerIDToInventoryID to insure it is only called on bags.

v2.3
- Removed all hardcoded item rarity colors, table is now generated with GetItemQualityColor.
- Item rarity index now simply queried from GetItemInfo instead of parsing it from link color.
- Moved all UI text strings to Localization.lua. TitanItemDed is now ready for localization.
- Replaced english-only ammo bag detection by name with item type query to GetItemInfo.
- Ignored items list now stores IDs instead of names to be language independent (and use less memory).
- Added optional dependency on "Informant". TitanItemDed built-in database is name based and only usable on english client. If Informant is installed, prices will be retrieved from Infomant by ID, making TitanItemDed work on non-english client.
