Skip to content
p3lim edited this page Mar 2, 2012 · 24 revisions

oUF_Experience displays the current player experience as a statusbar.

Optional sub-elements

Rested

A background-layered bar to display the exhaustion the player currently have.
The layering is handled by the element.

Tags

A few basic tags are included:

  • [curxp] – Current experience of the player
  • [maxxp] – Maximum experience of the player
  • [perxp] – Percentage experience of the player
  • [currested] – Current rested of the player
  • [perrested] – Percentage rested of the player

Supported callbacks/hooks

  • Experience.PreUpdate(Experience, unit)
  • Experience.Override(self, event, unit)
  • Experience.PostUpdate(Experience, unit, min, max)

Notes

- Remember to set the plug-in as an optional dependency for the layout
- Rested bar must be parented to Experience if used
- Backgrounds/Backdrops and such must be parented to Rested if used

Example

-- Position and size
local Experience = CreateFrame('StatusBar', nil, self)
Experience:SetPoint('BOTTOM', 0, -50)
Experience:SetHeight(20)
Experience:SetWidth(200)

-- Position and size the Rested background-bar
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, '[curxp] / [maxxp]')

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

-- Register it with oUF
self.Experience = Experience
self.Experience.Rested = Rested
Clone this wiki locally