Download
(10 Kb)
Download
Updated: 04-02-10 08:46 AM
Pictures
File Info
Updated:04-02-10 08:46 AM
Created:unknown
Downloads:4,658
Favorites:40
MD5:
cargoShip (Display)
Version: 2.1.5
by: Cargor [More]
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
  • tooltip, OnTooltipShow
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

A short function reference (the complete one is on my GitHub repo):
  • 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.
2.1.5
* new option: textColor
* new options: shadowX, shadowY
- forgot to mention: option noText
- fixed tagString

2.1
* 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

2.0.5
- fixed the .toc and included the right lib-version, whew

2.0.3
* 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

2.0
- updated .toc to 30000
- fixed error with TipHooker-1.0
Optional Files (0)


Archived Files (5)
File Name
Version
Size
Author
Date
2.1
10kB
Cargor
03-08-10 11:44 AM
2.0.5
8kB
Cargor
08-26-09 06:32 AM
2.0.3
8kB
Cargor
08-24-09 08:01 AM
2.0
8kB
Cargor
07-02-09 09:28 AM
r311
8kB
Cargor
11-20-08 10:55 AM


Post A Reply Comment Options
Old 05-31-09, 12:09 PM  
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view AddOns

Forum posts: 199
File comments: 376
Uploads: 20
Well, display on mouseover is nothing that cargoShip does by itself, you would have to write your own functions for that in the layout. I would come up with a code snippet for you, but I'm very busy at the moment

/script cargoShip:PrintUnused() does it, you don't need /print before it, because the function already prints it to the default chatframe.
__________________
Website | GitHub

Oh hai!
xConStruct is offline Report comment to moderator  
Reply With Quote
Old 05-29-09, 01:20 AM  
Monolit
A Black Drake
AddOn Author - Click to view AddOns

Forum posts: 81
File comments: 430
Uploads: 8
Excellent addon, thanks for your work! 15 Kib vs 350-ish (ButtonBin)
I managed to fix my layout in about 10 minutes, though there is 1 feature I miss:
With ButtonBin I used to hide most of the config launchers on the bar which was only visible on mouseover, so is there a way to make my data blocks visible only when I mouseover certain region?

EDIT: also if I understood it correctly /print cargoShip:PrintUnused() should print the names of all unused LDB blocks in my chat frame, but it doesn't (returns nil). Am I missing something?
Last edited by Monolit : 05-29-09 at 02:20 AM.
Monolit is offline Report comment to moderator  
Reply With Quote
Old 11-18-08, 06:04 AM  
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view AddOns

Forum posts: 199
File comments: 376
Uploads: 20
Mhh okay, I'll look into it.

But a more detailed description of the problem could be helpful, what do you mean exactly by "breaking"?
__________________
Website | GitHub

Oh hai!
xConStruct is offline Report comment to moderator  
Reply With Quote
Old 11-17-08, 05:53 PM  
Gnarkill
A Kobold Labourer

Forum posts: 1
File comments: 8
Uploads: 1
RatingBuster

The addon breaks ratingbuster. More specifically TipHooker-1.0.

If theres any way to fix it, i would love to hear. =)
Gnarkill is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

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.