Home

Adrian L Lange edited this page Sep 3, 2017 · 11 revisions
Clone this wiki locally

oUF_Reputation displays the current player reputation as a statusbar.

Widgets

Reputation

A statusbar which displays the player’s currently watched reputation.

Reputation.Reward (optional sub-element)

Widget that will be displayed if a “paragon” faction has a pending reward.
A default texture will be set if the widget is a texture and a texture has not been set.

Options

  • colorStanding – Boolean that will enable/disable automatic coloring of the bar based on current standing
  • inAlpha – Alpha used when mouse is over the element (defaults to 1)
  • outAlpha – Alpha used when mouse is outside the element (defaults to 1)
  • tooltipAnchor – Anchor for the tooltip (defaults to ANCHOR_BOTTOMRIGHT)

Tags

A few basic tags are included:

  • [repuration:cur] – Current reputation
  • [reputation:max] – Maximum reputation
  • [reputation:per] – Percentage reputation
  • [reputation:standing] – Current standing with watched reputation
  • [reputation:faction] – Name of watched reputation

Supported callbacks/hooks/overrides

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

Notes

Remember to set the plug-in as an optional dependency for the layout

Example

-- Position and size
local Reputation = CreateFrame('StatusBar', nil, self)
Reputation:SetPoint('BOTTOM', 0, -50)
Reputation:SetHeight(20)
Reputation:SetWidth(200)
Reputation:EnableMouse(true) -- Enable mouse support for tooltips/fading/clicks

-- Add a texture widget to display reward status
local Reward = Reputation:CreateTexture(nil, 'ARTWORK')
Reward:SetPoint('RIGHT')
Reward:SetSize(15, 18)
Reputation.Reward = Reward

-- Color the bar by current standing
Reputation.colorStanding = true

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

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

-- Register it with oUF
self.Reputation = Reputation