LootCount plug-in API

LootCount have a very small and simple API for use by plug-ins. The API itself consists of three parts:
1. Plug-in register entry
2. Plug-in forced update
3. LootCount requests update


Register your plug-in at load-time
This is done by calling the LootCount API function:
    LootCountAPI.Register
The supplied argument is a table with information about your plug-in, and must
look like this:

MyPlugin_Information = {
    -- Mandatory information
    Name    = "Your plugin name or ID",
    Texture = "Path to texture for your plugin's icon",

    -- Optional information
    MenuText    = "Menu-text for your plugin in the LootCount menu",
    Update      = The function that LootCount will call when an update is needed,
    Tooltip     = The function LootCount will call for your plugin to display a tooltip on mouse-over,
    Clicker     = The function LootCount will call when your plug-in's icon has been clicked by the user
    ColorTop    = { r=0.7, g=0.7, b=0.7 },    Color-table for the upper number
    ColorBottom = { r=1, g=1, b=1 },          Color-table for the bottom number
}

A bare minimum for registering you plug-in will then be to call once:
    LootCountAPI.Register( { Name="MyPluginName", Texture="Path-to-texture" } );


Force an update of your plug-in information
To update your LootCount icon with your count, you must call:
    LootCountAPI.Update("MyPluginName",bottom,top);

"bottom" and "top" refers to the position of the two available numbers in the LootCount interface. These can be numbers or text. If text is supplied, it will be printed as it is. If a number is supplied, it will be printed as it is up to 999, and converted to 1.0k numbers above 1000.


LootCount requested update
If you supplied the "Update" function when registering your plug-in, LootCount will call that function whenever LootCount needs to do a global redraw of its interface.


Tooltip
If you supplied a function for the "Tooltip" entry, LootCount will call that function whenever the players holds the mouse over an icon containing your plug-in. The supplied argument to this function is the handle for the icon. You can use this to anchor your tooltip to the icon.


Click-handler
When a plug-in's icon is clicked by the user, LootCount will call that plug-in's click-handler if that was supplied when the plug-in was registered with LootCount. This handler will receive the call with these parameters:
    MyPlugin_Click_Handler(button,LR,count)
        button = Handle of your plug-in's icon
		LR     = Native WoW "LeftButton" or "RightButton" identifiers depending on which mouse-button the user pressed
		count  = This will be '1' for a single click, and '2' for a double-click.

Please note:
- Your plug-in will never be called with a double-click for the right mouse-button as this is reserved for LootCount to remove items from the interface.
- Double-click is not a native WoW message. This has been generated by LootCount and is therefore subject to inconsistencies purely because WoW timing will not be accurate all the time. This is more visible when the user's computer is slow or very busy.
