View Single Post
Old 05-27-11, 01:36 PM   #9
Rainrider
A Rage Talon Dragon Guard
Join Date: Nov 2008
Posts: 301
Sauerkraut,

in Zork's (and in mine) example you register an event and assign an event handler (that's setArrowColor in Zork's code) to it. You'll just pick the player frame for this. The handler has to be known before you assign it, meaning if you are using one file for all, setArrowColor has to be defined before your style function. If you are using different files, then the file that contains the declaration of setArrowColor has to be loaded before the file with your style function. By style function I mean the function set in oUF:RegisterStyle("style name", style_function). If you use the UnitSpecific table, you could register the event there, else it goes into the style function like this:

lua Code:
  1. if unit == "player" then
  2.     self:RegisterEvent("UNIT_DISPLAYPOWER", lib.setArrowColor)
  3. end

The same for the other events if they are needed.
Rainrider is offline   Reply With Quote