Category: Data Broker
Addon Information
Works with 3.2
Download Latest Version.
To add favorites please register for a free account. If you already have one you need to login. How do I install this? (FAQ)
Author:
Version:
2.0.5
Date:
08-26-2009 08:32 AM
Size:
8.21 Kb
Downloads:
1,951
Favorites:
36
MD5:
Pictures
Click to enlarge
Sample layout (art is not included)
Click to enlarge
Example code (layout.lua)
cargoShip (Display)
Complete rewrite, it can now be as well be used as a lib - your old layout.lua will not work in this version without changes due to the new options.

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 (~13 kb mem. usage) 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 notice that I use most likely different LDB-data sources than you do

A short function reference (see core.lua comments for detailed overview):
  • cargoShip("name" [, options]) - returns a new info block of the specified LDB-data source
  • cargoShip:Get("name") - returns a table of all created blocks for this data source name
  • cargoShip:GetUnused() - returns a table of all unused data sources
  • cargoShip:PrintUnused() - prints all unused data sources in chat

Please drop a comment for your feedback, bug reports and/or suggestions.
  Change Log - cargoShip (Display)
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 - cargoShip (Display)
Sorry, there are currently no optional files available.
  Archived Versions - cargoShip (Display)
File Name
Version
Size
Author
Date
2.0.3
8kB
Cargor
08-24-2009 10:01 AM
2.0
8kB
Cargor
07-02-2009 11:28 AM
r311
8kB
Cargor
11-20-2008 12:55 PM
  Comments - cargoShip (Display)
Post A Reply Comment Options
Old 06-28-2009, 07:51 AM  
Cargor
A Flamescale Wyrmkin
 
Cargor's Avatar
Interface Author - Click to view interfaces

Forum posts: 127
File comments: 242
Uploads: 17
Sorry for the late response, had a lot to do

The frame disappears, because you basically "leave" the panel and "enter" the display-block. Blizz' API about entering/leaving is not very clever, so they don't really check if the panel is still underneath your mouse (and the block).

Try to use this script:
Code:
local updateFrame = CreateFrame"Frame"
updateFrame:SetScript("OnUpdate", function(self)
    if(not MouseIsOver(f1)) then
        HideTop()
        self:Hide()
    end
end
And add in ShowTop() the following to make use of it: updateFrame:Show()
This update-routine basically checks as soon as you entered the panel every time if your mouse is still over the frame and so bypasses the false OnLeave.

By the way, why don't you make all blocks in the panel as the panel's child with dominos:SetParent(f1) - Then you don't have to set the alpha-values for each block manually, because they inherit it from the panel.

Hope, this works, as I didn't test it
__________________
« Homepage | Git »

My blog is finally getting english!
Cargor is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 06-20-2009, 02:26 PM  
Monolit
A Deviate Faerie Dragon

Forum posts: 11
File comments: 18
Uploads: 0
Quote:
Originally posted by Cargor
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.
Hello, thanks for your reply. I actually managed to make that show-on-mouseover panel:

Code:
--------> TOP PANEL
local f1 = CreateFrame("frame")
f1:SetPoint("TOP", UIParent, "TOP", 0, 0)
f1:SetWidth(350) f1:SetHeight(12)
f1:SetBackdrop({bgFile = "interface\\Tooltips\\UI-Tooltip-Background"})
f1:EnableMouse(true) 
f1:Show()
f1:SetAlpha(0)

local bauderrors = cargoShip("aBroker_BaudErrorFrame")
bauderrors:SetWidth(70)
bauderrors:SetPoint("TOP", UIParent, "TOP", 50, -1)
bauderrors:SetScript("OnEnter",function() ShowTop() end)
bauderrors:SetScript("OnLeave",function() HideTop() end)

local dominos = cargoShip("Dominos")
dominos:SetWidth(10)
dominos:SetPoint("LEFT", bauderrors, "RIGHT",10,0)
dominos:SetScript("OnEnter",function() ShowTop() end)
dominos:SetScript("OnLeave",function() HideTop() end)

local classtimer = cargoShip("ClassTimer")
classtimer:SetWidth(10)
classtimer:SetPoint("LEFT", dominos, "RIGHT", 10, 0)
classtimer:SetScript("OnEnter",function() ShowTop() end)
classtimer:SetScript("OnLeave",function() HideTop() end)

local dbm = cargoShip("Deadly Boss Mods")
dbm:SetWidth(40)
dbm:SetPoint("LEFT", classtimer, "RIGHT", 10, 0)
dbm:SetScript("OnEnter",function() ShowTop() end)
dbm:SetScript("OnLeave",function() HideTop() end)

local panda = cargoShip("Panda")
panda:SetWidth(55)
panda:SetPoint("LEFT", dbm, "RIGHT", 10, 0)
panda:SetScript("OnEnter",function() ShowTop() end)
panda:SetScript("OnLeave",function() HideTop() end)

local volume = cargoShip("Volumizer")
volume:SetWidth(15)
volume:SetPoint("LEFT", bigwigs, "RIGHT", 10, 0)
volume:SetScript("OnEnter",function() ShowTop() end)
volume:SetScript("OnLeave",function() HideTop() end)

local ora = cargoShip("oRA2")
ora:SetWidth(50)
ora:SetPoint("RIGHT", bauderrors, "LEFT", -5, 0)
ora:SetScript("OnEnter",function() ShowTop() end)
ora:SetScript("OnLeave",function() HideTop() end)

local nametoggle = cargoShip("Broker_NameToggle")
nametoggle:SetWidth(80)
nametoggle:SetPoint("RIGHT", ora, "LEFT", -5, 0)
nametoggle:SetScript("OnEnter",function() ShowTop() end)
nametoggle:SetScript("OnLeave",function() HideTop() end)

local hatter = cargoShip("aBroker_Hatter")
hatter:SetWidth(55)
hatter:SetPoint("RIGHT", nametoggle, "LEFT")
hatter:SetScript("OnEnter",function() ShowTop() end)
hatter:SetScript("OnLeave",function() HideTop() end)

local buffet = cargoShip("Buffet")
buffet:SetWidth(20)
buffet:SetPoint("RIGHT", hatter, "LEFT")
buffet:SetScript("OnEnter",function() ShowTop() end)
buffet:SetScript("OnLeave",function() HideTop() end)

function ShowTop()
local a1 = 1
bauderrors:SetAlpha(a1)
dominos:SetAlpha(a1)
classtimer:SetAlpha(a1)
panda:SetAlpha(a1)
volume:SetAlpha(a1)
ora:SetAlpha(a1)
nametoggle:SetAlpha(a1)
hatter:SetAlpha(a1)
buffet:SetAlpha(a1)
dbm:SetAlpha(a1)
end

function HideTop()
local a1 = 0 
bauderrors:SetAlpha(a1)
dominos:SetAlpha(a1)
classtimer:SetAlpha(a1)
panda:SetAlpha(a1)
volume:SetAlpha(a1)
ora:SetAlpha(a1)
nametoggle:SetAlpha(a1)
hatter:SetAlpha(a1)
buffet:SetAlpha(a1)
dbm:SetAlpha(a1)
end

HideTop()
f1:SetScript("OnEnter",function() ShowTop() end)
f1:SetScript("OnLeave",function() HideTop() end)
It works fine, but there is some kind of conflict with couple of launchers like dominos and dbm in my case:

for some reason when I mouseover one of those launchers on that panel whole panel vanishes and tooltip spawns instead.

e.g.
pic1: mouseover any element in that screen area - my panel shows up
http://idfiles.homeip.net/UploadImag...009_001831.jpg

pic2: and when I mouseover dominos launcher the panel disappears
http://idfiles.homeip.net/UploadImag...009_002219.jpg

If I remove tooltip spawning code in those launchers (i.e. onEnter/Leave handlers) everything works fine, but without tooltips which is sad
Monolit is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 05-31-2009, 02:09 PM  
Cargor
A Flamescale Wyrmkin
 
Cargor's Avatar
Interface Author - Click to view interfaces

Forum posts: 127
File comments: 242
Uploads: 17
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.
__________________
« Homepage | Git »

My blog is finally getting english!
Cargor is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 05-29-2009, 03:20 AM  
Monolit
A Deviate Faerie Dragon

Forum posts: 11
File comments: 18
Uploads: 0
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-2009 at 04:20 AM.
Monolit is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 11-18-2008, 08:04 AM  
Cargor
A Flamescale Wyrmkin
 
Cargor's Avatar
Interface Author - Click to view interfaces

Forum posts: 127
File comments: 242
Uploads: 17
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"?
__________________
« Homepage | Git »

My blog is finally getting english!
Cargor is offline Report comment to moderator   Edit/Delete Message Reply With Quote
Old 11-17-2008, 07:53 PM  
Gnarkill
A Kobold Labourer

Forum posts: 0
File comments: 10
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   Edit/Delete Message Reply With Quote
Post A Reply



Category Jump:




The Network:
EQInterface | EQ2Interface | LoTROInterface | MMOInterface | War.MMOUI | WoWInterface | VGInterface | Allakhazam | Thottbot | Wowhead | Zam


©2009 MMOUI / ZAM Network
vBulletin - Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.