WoWWiki Hosted AddOn Page
GTB-1.0 is a library for creating timers displayed as bars, graphically it's supposed to resemble CandyBar which is used by addons like BigWigs.
Example of a mod that uses GTB isAfflicted2
GTB SVN
Contents
1 GTB-1.0 API
2 GTB Object API
2.1 GTBObject:RegisterBar(id, text, seconds, startSeconds[, icon, r, g, b])
2.2 GTBObject:UnregisterBar(id)
2.3 GTBObject:UnregisterAllBars()
2.4 GTBObject:SetBarIcon(id, icon[, left, right, top, bottom])
2.5 GTBObject:SetRepeatingTimer(id, flag)
2.6 GTBObject:SetAnchorVisible(flag)
2.7 GTBObject:RegisterOnMove(handler[, func])
2.8 GTBObject:RegisterOnFade(handler[, func])
2.9 GTBObject:SetDisplayGroup(name)
2.10 GTBObject:GetDisplayGroup()
2.11 GTBObject:SetFadeTime(seconds)
2.12 GTBObject:SetFadeTime(seconds)
2.13 GTBObject:SetBaseColor(r, g, b)
2.14 GTBObject:SetIconPosition(position)
2.15 GTBObject:SetBarGrowth(position)
2.16 GTBObject:SetTexture(texture)
2.17 GTBObject:SetWidth(width)
2.18 GTBObject:SetScale(scale)
2.19 GTBObject:SetPoint(point, relativeFrame[, relativePoint, xOff, yOff])
2.20 GTBObject:EnableGradient(flag)
2.21 GTBObject:SetMaxBars(maxBars)
GTB-1.0 API Edit
:RegisterGroup(name, texture) Edit
Arg Type Details
name string Name of this group, this will be shown as the anchor name and must be unique to the anchor.
texture string Texture to use for the bars
Return Type Details
GTBObject table The GTB Object encapsulating the GTB API's.
GTB Object API Edit
GTBObject:RegisterBar(id, text, seconds, startSeconds[, icon, r, g, b]) Edit
Arg Type Details
id string Bar id, this MUST be unique as it's used for removing and modifying bars, conflicting ids will use the latest one registered.
text number Text to show inside the bar
seconds number How many seconds are left on this timer
startSeconds number/nil How many seconds this timer started as, if nothing is passed uses seconds.
icon string/nil Icon to display next to this bar
r number/nil Overriden background color for red, should be a 1.0 - 0.0 value
g number/nil Overriden background color for red, should be a 1.0 - 0.0 value
b number/nil Overriden background color for red, should be a 1.0 - 0.0 value
Starts a graphical timer bar, if the group is set to redirect to another group it'll check if the redirected group exists if it doesn't then it'll silently show it in the normal group without redirection.
GTBObject:UnregisterBar(id) Edit
Arg Type Details
id string Bar id
Return Type Details
removed boolean Returns true if we removed a bar, nil is nothing was found
GTBObject:UnregisterAllBars() Edit
Return Type Details
removed boolean Returns true if we removed any bars, nil if the group was empty of active bars
GTBObject:SetBarIcon(id, icon[, left, right, top, bottom]) Edit
Arg Type Details
id string Bar id
icon string/nil Icon to display next to this bar
left number/nil Left tex coord for the icon texture, defaults to 0.07
right number/nil Right tex coord for the icon texture, defaults to 0.93
top number/nil Top tex coord for the icon texture, defaults to 0.07
bottom number/nil Bottom tex coord for the icon texture, defaults to 0.93
GTBObject:SetRepeatingTimer(id, flag) Edit
Arg Type Details
id string Bar id
flag boolean Flag the timer as repeating or stop it from repeating
Flags the timer as repeating, meaning it'll keep restarting the timer when it hits 0 instead of removing. The only way to stop this is either flag the timer as not repeating, or to remove it through GTBObject:RemoveBar(id) or GTBObject:RemoveAllBars().
GTBObject:SetAnchorVisible(flag) Edit
Arg Type Details
flag boolean Changes the group anchor to be visible, and can be dragged around by the user.
GTBObject:RegisterOnMove(handler[, func]) Edit
Arg Type Details
handler string/function/table Function/method to call.
func string/function (Optional) Function to call if you're using a handler
Registers the passed handler/function to be called when the user stops moving the anchor (OnDragStop fires)
If you passed just a function it'll be called as func(anchorFrame, x, y)
If you passed a handler and a function it'll be called as handler[func](handler, anchorFrame, x, y)
GTBObject:RegisterOnFade(handler[, func]) Edit
Arg Type Details
handler string/function/table Function/method to call.
func string/function (Optional) Function to call if you're using a handler
Registers the passed handler/function to be called when a bar has ran out and is done fading, this is not called if the bar is removed through GTBObject:UnregisterBar(id)
If you passed just a function it'll be called as func(barId)
If you passed a handler and a function it'll be called as handler[func](handler, barID)
GTBObject:SetDisplayGroup(name) Edit
Arg Type Details
name string Group name to redirect to
Sets that this group should redirect all new bars created in it to the set one, if the set group does not exist when a bar is created it'll silently ignore this and put it in the group it was registered with.
When bars are redirected to another group, they will use the redirected groups configuration except for the callbacks when the bar fades.
GTBObject:GetDisplayGroup() Edit
Return Type Details
group string/nil Group name that this group is being redirected to, or nil if none
Returns the name of the group that all bars from this one will be redirected to, this does not check to make sure the group exists before returning the name.
GTBObject:SetFadeTime(seconds) Edit
Arg Type Details
seconds number How many seconds it should take for the bar to fade out when it ends
GTBObject:SetFadeTime(seconds) Edit
Arg Type Details
seconds number How many seconds it should take for the bar to fade out when it ends
GTBObject:SetBaseColor(r, g, b) Edit
Arg Type Details
r number How red the background color of bars will be, needs to be a 1.0 - 0.0 value
g number How green the background color of bars will be, needs to be a 1.0 - 0.0 value
b number How blue the background color of bars will be, needs to be a 1.0 - 0.0 value
GTBObject:SetIconPosition(position) Edit
Arg Type Details
position string Icon position, must either be LEFT or RIGHT
Positioning of the icon in relation to the bars, this only applies to newly created bars if you have one already running you must call GTBGroup:SetBarIcon(id, icon) or re-register the bar to see a change.
GTBObject:SetBarGrowth(position) Edit
Arg Type Details
position string Bar growth type, must either be UP or DOWN
How the bars should grow, up or down. Changes will take affect immeditially and bars will be repositioned (if needed).
GTBObject:SetTexture(texture) Edit
Arg Type Details
texture string Bar texture
GTBObject:SetWidth(width) Edit
Arg Type Details
width number Bar width
GTBObject:SetScale(scale) Edit
Arg Type Details
scale number Bar scale
GTBObject:SetPoint(point, relativeFrame[, relativePoint, xOff, yOff]) Edit
Sets the positioning of the bar group, and any bars attached to it.
See http://www.wowwiki.com/API_Region_SetPoint for more information on arguments as this directly passes the arguments to the anchor frames :SetPoint().
GTBObject:EnableGradient(flag) Edit
Arg Type Details
flag boolean Flag the group as using a gradient for the background color
By default this is enabled, the bar background color will change from the base color set to red based on how much time is left.
GTBObject:SetMaxBars(maxBars) Edit
Arg Type Details
maxBars number/nil Maximum number of bars that can be shown at one time, nil for no limit.
Read more
Querier is a small addon which will allow you to get Item and Spell links based off of ItemID or...
Querier
EventCatcher makes it easy to track events as they're called without having to reload your UI...
EventCatcher
GypsyMod was a suite of interface addons developed during the original World of Warcraft closed...
GypsyMod