Yet another rewrite! For compatibility with old layouts of version 2.0.5 and older, you have to add local cargoShip = LibStub("LibCargoShip-2.1") to the top of your file!.
cargoShip is a LibDataBroker display-addon and library which can only be configured through changing the Lua-code. It was designed to provide a lightweight and flexible framework for creating info blocks based on data objects.
It provides support for the following attributes (you can add more if you like):
icon, iconR, iconB, iconG, iconCoords
text, label, value, suffix
OnEnter, OnLeave, OnClick
You can add more of them (or change existing) by providing your custom functions in cargoShip.UpdateFunctions["attributeName"] = function(self, attribute, dataobj) end.
The addon comes with a sample layout which gives you a good start on creating and positioning your elements (in the layout.lua - with comments). Please note that I most likely use different LDB-data sources than you do
block = cargoShip("name" [, options]) - returns a new info block of the specified LDB-data source
block = cargoShip(options) - returns a new info block of the specified LDB-data source in options.name
blocks = cargoShip:Get(dataObject) - returns a table of all created blocks for this data source
block = cargoShip:GetFirst(dataObject) - returns a table of all created blocks for this data source
cargoShip:GetUnused(verbose) - returns a table of all unused data sources, and optionally prints it to chat
block:SetDataObject(dataObject) - set a new data source for the block
Please drop a comment for your feedback, bug reports and/or suggestions.
* new option: textColor
* new options: shadowX, shadowY
- forgot to mention: option noText
- fixed tagString
* major rewrite
* your old layout.lua should be still compatible, but you have to add "local cargoShip = LibStub("LibCargoShip-2.1")" at the top.
* new function: block:SetDataObject(dataObject) - change the data object after the creation!
* new function: cargoShip:GetFirst(dataObject) - returns the first block for this data object
* changed function: cargoShip:GetUnused(verbose) - if set to true, it prints out the unused dataobjects
- removed: options.Formatting (use tagStrings for this purpose!)
- removed: global 'cargoShip' variable
- removed: cargoShip:PrintUnused() - see cargoShip:GetUnused(true)
- you can now make your own block prototypes, see the library embedding functions
- fixed the .toc and included the right lib-version, whew
* simple tag-system included:
* format your layouts by defining options.tagString, e.g. "[Name]: [value][suffix]"
- fixed: not updating if only dataObj.iconB changes
- new: creation by name is now optional, you can specify the name in the options
- new: creation asserts if no name was found
- updated .toc to 30000
- fixed error with TipHooker-1.0
Okay, well, to be honest, the only reason I still play WoW is because of addon development. The rest became boring after four years of active playing =P
And since I write them in my free time and also release them for free, there are of course the subscription fee's ... so if you want to support me, here's your chance!
And ... umm ... there's still the habit of eating lots of chocolate while thinking of addons :/
You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.
*Clicking the donate button above will take you to PayPal.com
*Clicking the donate button above will take you to Pledgie.com