Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

WoW Addon - Addon quicklaunch bar

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 LibDataBroker-1.1
Octocat-spinner-32 CallbackHandler-1.0.lua
Octocat-spinner-32 LibStub.lua
Octocat-spinner-32 Quickie.lua
Octocat-spinner-32 Quickie.toc
Octocat-spinner-32 README.textile
Octocat-spinner-32 tekKonfigAboutPanel.lua
README.textile

Quickie is a ‘quicklaunch’ bar based off LibDataBroker-1.1 and Auctioneer’s Slidebar.
It is meant to be a common place for addons to register simple config-launching buttons, or other basic buttons.
Basically a replacement for creating a minimap button (herpes) or fubar plugin that does nothing more than open your addon’s config.

Adding support to your addon

The key design point of LibDataBroker is to implement the “Model, View, Controller” design in WoW.
This allows an addon to send out data, an OnClick action… all sorts of things, while remaining independent of the addon displaying the data or using the OnClick.
In short, this means an addon can provide data to display on FuBar without requiring FuBar to be present.
If the user doesn’t have an addon to display the data, they are not bothered by stuff they don’t want to see.

Along this line, we can implement buttons to open addon configs easily, without the need to embed a bunch of libraries to render frames for us.
If the user wishes to have access to the buttons, they need only install a display addon (like this one).
This also means many different display addons could be made, each addressing a certain design, and the user has the control of which design they use.
User choice is a good thing, I’ve been told.

So enough rambing, how do I add this into my addon? Two simple steps:

  1. Add the embed libs into your addon. You need LibStub, CallbackHandler-1.0 and LibDataBroker-1.1
    • If you use Ace3 in your addon, you probably already have the first two embeds. Just make sure they’re loaded before LibDataBroker
  2. Add a “dataobject” to LibDataBroker containing an icon, an OnClick function, and “launcher” set to true
    • The “launcher” key tells display addons that you do not provide any “data” to be rendered, simply an OnClick action to attach to a frame

Example:

LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MyAddonName", {
	launcher = true,
	icon = "Interface\\Icons\\Spell_Nature_StormReach",
	OnClick = function(clickedframe, button) InterfaceOptionsFrame_OpenToFrame(myconfigframe) end,
})

Extra features

Note that these features may not be implemented in other LDB-based quicklaunch addons!

Quickie will use the dataobject name to find addon metadata from the addon’s TOC and display it in the tooltip.
If your addon’s name (the folder name) does not match the name you give your dataobject, you can set the “tocname” key to your addon name.

If you want a custom tooltip instead of Quickie’s default (addon title and notes from the TOC), you can pass OnEnter and OnLeave functions into your dataobject.
These handlers will be called and passed the usual args (self for the frame that we were called from).
Make sure you include both script handlers!

If you don’t want an addon-specific tooltip, but instead a simple label, use a dataobject name that doesn’t match your addon name and set the “label” key in your dataobject to the text you wish to display.

Links

Visit my site for more info.
Please report all bugs and feature requests to my Google Code tracker
Please direct all feedback and questions to my Google Groups mailinglist

Something went wrong with that request. Please try again.