Home

Adrian L Lange edited this page Sep 13, 2016 · 14 revisions
Clone this wiki locally

oUF_Experience displays the current player experience or honor as a statusbar.

Experience bar

A statusbar which displays the player’s current experience or honor until the next level.

Rested bar

A background-layered statusbar which displays the exhaustion the player currently have.

Tags

A few basic tags are included:

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

Supported callbacks/hooks

  • Experience.PreUpdate(Experience, unit)
  • Experience.Override(self, event, unit)
  • Experience.OverrideVisibility(self, event, unit)
  • Experience.OverrideUpdateColor(Experience, showHonor)
  • Experience.PostUpdate(Experience, unit, cur, max, level, showHonor)

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
- Enabling honor-tracking is done from the TalentUI, and is only available at max level

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