Download
(10Kb)
Download
Updated: 04-02-10 08:46 AM
Pictures
File Info
Updated:04-02-10 08:46 AM
Created:unknown
Downloads:5,934
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 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
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 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 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 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 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, 08:19 AM  
atuin_wow
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 11
File comments: 29
Uploads: 2
Need help

Hi.
Help me please include addons "Ara_Broker_SpecSwitcher" and "Ara_Broker_Money" into your addon.
I wrote next strings, but it doesn`t showed in the game :

local spec = cargoShip{
name = "Ara_Broker_SpecSwitcher",
}
spec:SetPoint("CENTER", UIParent, "CENTER", 0, 0)

local money = cargoShip{
name = "Ara_Broker_Money",
}
money:SetPoint("CENTER", UIParent, "CENTER", 50, 0)
Report comment to moderator  
Reply With Quote
Unread 03-09-10, 03:18 PM  
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view AddOns

Forum posts: 199
File comments: 374
Uploads: 18
Yep, you can paste the lib in there, but make sure it is also referenced in the toc-file, before LibDataBroker-1.1.lua.
__________________
« Website | GitHub »

Oh hai!
Report comment to moderator  
Reply With Quote
Unread 03-09-10, 12:16 PM  
zohar101
A Cyclonian
 
zohar101's Avatar

Forum posts: 43
File comments: 188
Uploads: 0
Originally posted by Cargor
That seems to be a problem of Broker_MicroMenu (can't find the addon, so I cannot check it). Seems like it is missing the library CallbackHandler-1.0, which is needed for LibDataBroker-1.1

cargoShip comes bundled with this lib (like all other Broker addons), but because Broker_MicroMenu is loaded first by WoW, the client throws this error.

Check if Broker_MicroMenu includes the file CallbackHandler-1.0, otherwise report the problem to the author.
As a temporary fix, you can write "## RequiredDeps: cargoShip" into its .toc-file, this should load it after cargoShip, so the libs are present at load time.
The link is http://wow.curse.com/downloads/wow-a...icromenue.aspx
I've checked the folder and indeed it is missing callbackhandler-1.0.lua
I guess it was accidentally omitted from the pkg? Can I just ..like..paste it in there?:P
I will do what you suggested anyway though and post to the original author too. Thanks
edit: Your fix worked in that the lua error doesn't show. I still can't get the plugin to show though. Will keep fiddling with it..
Last edited by zohar101 : 03-09-10 at 03:10 PM.
Report comment to moderator  
Reply With Quote
Unread 03-09-10, 08:45 AM  
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view AddOns

Forum posts: 199
File comments: 374
Uploads: 18
That seems to be a problem of Broker_MicroMenu (can't find the addon, so I cannot check it). Seems like it is missing the library CallbackHandler-1.0, which is needed for LibDataBroker-1.1

cargoShip comes bundled with this lib (like all other Broker addons), but because Broker_MicroMenu is loaded first by WoW, the client throws this error.

Check if Broker_MicroMenu includes the file CallbackHandler-1.0.lua, otherwise report the problem to the author.
As a temporary fix, you can write "## RequiredDeps: cargoShip" into its .toc-file, this should load it after cargoShip, so the libs are present at load time.
__________________
« Website | GitHub »

Oh hai!
Report comment to moderator  
Reply With Quote
Unread 03-08-10, 02:34 PM  
zohar101
A Cyclonian
 
zohar101's Avatar

Forum posts: 43
File comments: 188
Uploads: 0
Originally posted by Cargor
You're spelling SetPoint() in both Broker-sections with a small 'p', but it should be a capital one
Do you have Lua errors enabled? The typo should normally print an error. Tested it on my client and they are working fine.

EDIT: Just saw that I have an unpublished major update to cargoShip lying around here for several months, coming soon!
Ahh so simple. Thank you! Have no idea how to enable lua error check in the editor I was using. But I'll find out.

So I corrected the spelling but still wasn't getting it. Decided to turn off all addons but this and suddenly I got this lua error:

Message: ...erface\AddOns\Broker_MicroMenu\LibDataBroker-1.1.lua:3: LibDataBroker-1.1 requires CallbackHandler-1.0
Time: 03/08/10 16:06:50
Count: 1
Stack: [C]: in function `assert'
...erface\AddOns\Broker_MicroMenu\LibDataBroker-1.1.lua:3: in main chunk

Locals: (*temporary) = nil
(*temporary) = "LibDataBroker-1.1 requires CallbackHandler-1.0"

I should add I downloaded and am using your new version 2.1
Is this a problem with the plugin? Should I post it to its author?
Last edited by zohar101 : 03-08-10 at 06:00 PM.
Report comment to moderator  
Reply With Quote
Unread 03-08-10, 11:40 AM  
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view AddOns

Forum posts: 199
File comments: 374
Uploads: 18
You're spelling SetPoint() in both Broker-sections with a small 'p', but it should be a capital one
Do you have Lua errors enabled? The typo should normally print an error. Tested it on my client and they are working fine.

EDIT: Just saw that I have an unpublished major update to cargoShip lying around here for several months, coming soon!
__________________
« Website | GitHub »

Oh hai!
Last edited by xConStruct : 03-08-10 at 11:41 AM.
Report comment to moderator  
Reply With Quote
Unread 03-08-10, 09:02 AM  
zohar101
A Cyclonian
 
zohar101's Avatar

Forum posts: 43
File comments: 188
Uploads: 0
Originally posted by Cargor
It should be compatible with every broker addon. Could you post your layout code, so that I can have a look at it?
Yeah course. I changed what my original settings were once things weren't working and just went with the simplest

--[[
### IMPORTANT ###
Set the value to 'false' to actually ENABLE THE LAYOUT:
]]

if false then return end -- We don't want to enable it for Lib-users

--[[
I think, the layout is fairly self-explanatory,
Here's a list of all available options:
noIcon, useLabel, formatting,
parent, width, height, scale, alpha
fontFamily, fontSize, fontStyle, fontObject, noShadow
]]

--local friends = cargoShip("picoFriends")
--friends:SetPoint("CENTER")

local gmotd = cargoShip("Broker_GuildMOTD")
gmotd:Setpoint("CENTER")

--local micromenu = cargoShip("Broker_Micromenu")
--micromenu:Setpoint("CENTER")

Picofriends works just fine but not the broker ones. I had more plugins in there I tested out but it was getting to be cluttered so I erased them.
I commented out one at a time every time so they wouldn't overlap.
Last edited by zohar101 : 03-08-10 at 09:14 AM.
Report comment to moderator  
Reply With Quote
Unread 03-08-10, 08:42 AM  
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view AddOns

Forum posts: 199
File comments: 374
Uploads: 18
It should be compatible with every broker addon. Could you post your layout code, so that I can have a look at it?
__________________
« Website | GitHub »

Oh hai!
Report comment to moderator  
Reply With Quote
Unread 03-07-10, 04:47 PM  
zohar101
A Cyclonian
 
zohar101's Avatar

Forum posts: 43
File comments: 188
Uploads: 0
So I'm trying this out since I need only 2 plugins to show and this is the simplest setup I could find. I have no programming experience at all but based on what you had in layout, it seemed simple enough so I gave it a try. I can get some plugins to show like picofriends but anything with broker in it like Broker_Daily or Broker_GuildMOTD etc. doesn't work. I'm setting it with no options, displaying dead center to test it out so there's no confusion. I'm probably missing something obvious. Is this not compatible with some plugins?
Thanks in advance, sorry for the noobness:P
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.