User:Cogswobble/Addon Tutorial/Initial Plan

Before jumping into the coding, maybe we should take a moment a figure out roughly what we want our addon to do. In my case, I want to create two seperate addons.

SortingBag
The plan for this addon is to create a single frame for displaying the contents all of my bags (like OneBag), but with the items displaying in different sections based on various sorting criteria. For example, I'd like all of my quest items (those marked as quest items) in the first section along with any items needed for completing quests (they may not be marked as quest items). The next section might be for items green or better. The following section might be crafting items (reagents and finished product). So on and so on, until the last section which is all of the junk I can sell without thinking about it.

The basic idea would be that an item "dropped" into the top of this stack would fall through the layers until a filter snagged it. That is the section it will be displayed in. Unfiltered items would appear at the bottom.

Of course, we won't be dropping items into this frame, they'll be read from our inventory. So, either the filtering is done when the frame is opened or ongoing as we take normal actions that modify our inventory. We'll worry about implementation later, we just want to capture the desired behavior at this point.

Also, we'll probably need to be able to create and re-arrange filters through the UI, so we'll needs some kind of configuration dialog box.

MagicBox
Okay, I hate the name, but it gives me something to work with. The plan for this addon is to display a frame on the screen (centered and on the bottom just above the action bars). To the right will be buttons for Health Potion, Bandages, Food, Well Fed Food. To the left will be buttons for Mana Potion (or other class specific quaff) and Drink. It would look something like this: So, this is essentially an action bar, with health related items to the right and mana related items to the left. And speed of recovery goes from instant in the center to 30 seconds or so at the ends. Items need to be automatically updated on this action bar based on changes in the character's inventory. Item selection for each button position is based on:
 * 1) Highest quality usable item of that type
 * 2) Conjured food or water
 * 3) Item with least in a given stack

Right clicking a button should use the item. Left clicking a button should display a vertical bar of buttons listing the lower quality items of that type (in order).

Nice to have:
 * Item count
 * Block items when not effectively usable (e.g. block selecting bandages when you are poisoned and losing hit points)
 * Bar showing buff versus max for that stat (e.g. character with 1200 hit points with healing potion curing 600 would display a bar half way across the bottom of the button)