Quantcast WoWInterface - View Single Post - Need help coloring "widget"
View Single Post
05-27-11, 01:36 PM   #9
A Scalebane Royal Guard
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 438

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.
  Reply With Quote