Download
(10Kb)
Download
Updated: 04-02-10 08:46 AM
Pictures
File Info
Updated:04-02-10 08:46 AM
Created:unknown
Downloads:5,941
Favorites:39
MD5:

cargoShip (Display)  Popular! (More than 5000 hits)

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)


Post A Reply Comment Options
Unread 04-24-10, 11:15 AM  
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view AddOns

Forum posts: 199
File comments: 374
Uploads: 18
Sometimes the actual names of the dataobjects differ from the name of their containing addons (it's up to the authors) - in your case, you need to use

|cFFFFB366Ara|r SpecSwitcher
|cFFFFB366Ara|r Money

You can find out the real names of the data objects if you look into the addons' files and search for "NewDataObject".
__________________
« Website | GitHub »

Oh hai!
Last edited by xConStruct : 04-24-10 at 11:17 AM.
Report comment to moderator  
Reply With Quote
Unread 04-24-10, 03:09 PM  
atuin_wow
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 11
File comments: 29
Uploads: 2
Originally posted by Cargor
Sometimes the actual names of the dataobjects differ from the name of their containing addons (it's up to the authors) - in your case, you need to use

|cFFFFB366Ara|r SpecSwitcher
|cFFFFB366Ara|r Money

You can find out the real names of the data objects if you look into the addons' files and search for "NewDataObject".
Thx alot, m8!
Work great now =)
Report comment to moderator  
Reply With Quote
Unread 03-06-11, 12:07 PM  
Draigars
A Murloc Raider
 
Draigars's Avatar
AddOn Compiler - Click to view compilations

Forum posts: 4
File comments: 42
Uploads: 1
I'd like to add Broker_SocialSlate in your addon... Is it possible ?
http://wow.curse.com/downloads/wow-a...cialstate.aspx
Report comment to moderator  
Reply With Quote
Unread 03-10-11, 04:18 AM  
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view AddOns

Forum posts: 199
File comments: 374
Uploads: 18
Well, try it So far cargoShip has been working with any broker addon.
Just make sure you use "SocialState" as the name.
__________________
« Website | GitHub »

Oh hai!
Report comment to moderator  
Reply With Quote
Unread 07-31-14, 04:33 AM  
Sylen
A Wyrmkin Dreamwalker
AddOn Author - Click to view AddOns

Forum posts: 50
File comments: 65
Uploads: 4
Hey there! You are still around? I can't get this Broker AddOn to work.
http://www.curse.com/addons/wow/broker_oqueue

No Error notifications. It just won't show up.

Code:
local oqueue = cargoShip{
name = ..name..,
noIcon = false,
font = normal_font,
fontStyle = "OUTLINE MONOCHROME",
fontSize = 6
}

oqueue:SetPoint("CENTER", UIParent, "TOPRIGHT", -27, -160)
I got a feeling it has something to do with the registration of the name.

Broker Addon Code
Code:
local name, oQueueLDB = ...

-- stolen without permission from SlashIn
local MacroEditBox = MacroEditBox
local MacroEditBox_OnEvent = MacroEditBox:GetScript("OnEvent")


LibStub("LibDataBroker-1.1"):NewDataObject(name, oQueueLDB)

oQueueLDB.type = "launcher"
oQueueLDB.icon = "Interface\\AddOns\\oQueue\\art\\oq_button"
oQueueLDB.text = "oQueue"


function oQueueLDB:OnClick(button)
	if IsShiftKeyDown() then
		MacroEditBox_OnEvent(MacroEditBox, "EXECUTE_CHAT_LINE", "/oq mini")
	else
		OQ_buttonShow(self, button, false)

		if button == "RightButton" then
			oqmenu:SetClampedToScreen(true)
		end
	end
end

function oQueueLDB:OnEnter()
	GameTooltip:SetOwner(self, "ANCHOR_NONE")
	GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT")
	GameTooltip:ClearLines()

	GameTooltip:SetText("oQueue")
	GameTooltip:AddLine("|cffeda55fLeft-click|r to toggle main UI.")
	GameTooltip:AddLine("|cffeda55fShift-click|r to toggle minimap button.")
	GameTooltip:AddLine("|cffeda55fRight-click|r for menu.")

	GameTooltip:Show()
end


oQueueLDB.OnLeave = GameTooltip_Hide
Report comment to moderator  
Reply With Quote
Unread 09-19-14, 01:01 PM  
MoonWitch
A Firelord
AddOn Author - Click to view AddOns

Forum posts: 455
File comments: 162
Uploads: 9
Originally Posted by Sylen
Code:
local oqueue = cargoShip{
name = ..name..,
noIcon = false,
font = normal_font,
fontStyle = "OUTLINE MONOCHROME",
fontSize = 6
}

oqueue:SetPoint("CENTER", UIParent, "TOPRIGHT", -27, -160)
Your name is wrong....

Lua Code:
  1. local oqueue = cargoShip{
  2. name = 'Broker oQueue',
  3. noIcon = false,
  4. font = normal_font,
  5. fontStyle = "OUTLINE MONOCHROME",
  6. fontSize = 6,
  7.   }
  8. oqueue:SetPoint("CENTER", UIParent, "TOPRIGHT", -27, -160)
__________________
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.