A library for creating and updating blocks of LibDataBroker objects. It currently supports the following attributes:
- icon, iconR, iconB, iconG, iconCoords
- text, label, value, suffix
- OnEnter, OnLeave, OnClick
- tooltip, OnTooltipShow
Licensed under the open-source GPL 2
Fetch the library
Creates a new block from the DataObject of the same name. The name can either be delivered as arg #1, making the options-table optional, or defined in options.name, where options is passed as arg #1
- name: the name of the dataObject to be used (optional)
- options: table holding additional style options
Returns a table of all current blocks using the defined dataObject
- dataObject: the dataObject to be used (either object or name)
Convenience function, returns the first blocks using the defined dataObject
- dataObject: the dataObject to be used (either object or name)
Returns a table of all unused dataObjects
- verbose: print the names to the chatframe (optional)
Embeds the library functions in your own frame/table
- target: your target frame or table
-
parent (default: UIParent)
-
width (default: 70)
-
height (default: 12)
-
scale (default: 1)
-
alpha (default: 1)
-
fontObject (default: nil)
-
font ( default: "Fonts\FRIZQT__.TTF")
-
fontSize (default: 10)
-
fontStyle (default: nil)
-
textColor (default: { 1, 1, 1, 1 } = white)
-
noShadow (default: nil)
-
shadowX (default: 1)
-
shadowY (default: -1)
-
noIcon (default: nil)
-
noText (default: nil)
Sets the prototype's displayed dataObject
- dataObject: the dataObject to be used (either object or name; optional)
Update one or all attributes from the dataobject
- attribute: the name of the dataobjects attribute; if not defined, all attributes will be updated
Callback to initialize and style the block
- options: table holding additional options
local LCS = LibStub("LibCargoShip-2.1")
local friends = LCS{
name = "picoFriends",
noIcon = true,
scale = 1.5,
}
friends:SetPoint("BOTTOM", 0, 10)
Creates a block of picoFriends at the bottom of the screen, scaled 1.5 with no icon
local LCS = LibStub("LibCargoShip-2.1")
local friends = LCS:CreateBlock("picoFriends", {
noIcon = true,
scale = 1.5,
})
friends:SetPoint("BOTTOM", 0, 10)
Same example with a more clear form of spelling
local LCS = LibStub("LibCargoShip-2.1")
local block = LCS:CreateBlock{
noIcon = true,
scale = 1.5,
}
block:SetDataObject("picoFriends")
block:SetPoint("BOTTOM", 0, 10)
Another one. You can change the dataObject even after the block was created. Carousel anyone?