Skip to content
Circle CI edited this page Aug 30, 2018 · 3 revisions

Element: Experience

Adds support for an element that updates and displays the player's experience or honor as a StatusBar widget.

Widgets

  • Experience A statusbar which displays the player's current experience or honor until the next level.
    Has drop-in support for AnimatedStatusBarTemplate.
  • Experience.Rested An optional background-layered statusbar which displays the exhaustion the player current has.
    Must be parented to the Experience widget if used.

Options

  • inAlpha - Alpha used when the mouse is over the element (default: 1)
  • outAlpha - Alpha used when the mouse is outside of the element (default: 1)
  • restedAlpha - Alpha used for the Rested sub-widget (default: 0.15)
  • tooltipAnchor - Anchor for the tooltip (default: "ANCHOR_BOTTOMRIGHT")

Extras

Colors

This plug-in adds colors for experience (normal and rested) as well as honor.
Accessible through oUF.colors.experience and oUF.colors.honor.

Notes

  • A default texture will be applied if the widget(s) is a StatusBar and doesn't have a texture set.
  • Tooltip and mouse interaction options are only enabled if the element is mouse-enabled.
  • Backgrounds/backdrops must be parented to the Rested sub-widget if used.
  • Toggling honor-tracking is done through the PvP UI
  • Remember to set the plug-in as an optional dependency for the layout if not embedding.

Example implementation

-- Position and size
local Experience = CreateFrame('StatusBar', nil, self)
Experience:SetPoint('BOTTOM', 0, -50)
Experience:SetSize(200, 20)
Experience:EnableMouse(true) -- for tooltip/fading support

-- Position and size the Rested sub-widget
local Rested = CreateFrame('StatusBar', nil, Experience)
Rested:SetAllPoints(Experience)

-- Text display
local Value = Experience:CreateFontString(nil, 'OVERLAY')
Value:SetAllPoints(Experience)
Value:SetFontObject(GameFontHighlight)
self:Tag(Value, '[experience:cur] / [experience:max]')

-- Add a background
local Background = Rested:CreateTexture(nil, 'BACKGROUND')
Background:SetAllPoints(Experience)
Background:SetTexture('Interface\\ChatFrame\\ChatFrameBackground')

-- Register with oUF
self.Experience = Experience
self.Experience.Rested = Rested