View Single Post
10-02-12, 11:55 PM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Paopao001 View Post
Then should I divided it by PRIEST_BAR_NUM_ORBS for shadow priest, by 4 for monk, by 3 for warlock, by HOLY_POWER_FULL for paladin? I think that's different from the intent of combine them together in some way.
They're only combined into one element so Haste isn't copy/pasting the same code 3+ times and just changing the name. You don't have to treat them all exactly the same, all the time. ShadowOrbs isn't going to get upset if you pick HolyPower first for the team.

Simply updating the width in your PostUpdate should work, though you may need to set some kind of flag on the element, and update the width if it's set even if oUF didn't think the max changed, to catch that initial update:
Code:
self.ClassIcons.PostUpdate = ClassIconsPostUpdate
self.ClassIcons.forceUpdate = true
Then, in your ClassIconsPostUpdate function:
Code:
if maxchange or element.forceUpdate then
     element.forceUpdate = nil
     element[i]:SetWidth((oUF_MlightDB.width+3)/max-3)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote