Originally Posted by Paopao001
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)