Originally Posted by Coldkil
I have a similar problem with druids. (i hate they multiple forms)
I have made the combobar as a simple frame with 5 text strings, that stay at .2 alpha when not up, then go at alpha 1 when the combo builds up.
The fact is that i want to register the shapeshift events for make them disappear completely when the druid isn't in cat form.
Same would be good for eclipse bar, displaying it only when in moonkin form.
Is it possible or it's something that i canot achieve? thanks.
|
No, I didn't want to suggest an altering of oUF's core! At least not on parts, that are working perfectly.
On the other hand, the cpoints-module doesn't include a PostUpdate (hint at haste!), so you'll have to put some effort into it!
Go and style your CPoints in your layout as you want them to be. Don't include any conditions to them, though.
The oUF-module DOES include the possibility to override the original update-function, and this would be the way to go!
You can merely use, what you already got and put it into a function inside of your layout
lua Code:
local function CPointsOverride(self, event, unit)
if (unit == 'pet') then return end
local cp = nil
if(UnitHasVehicleUI'player') then
cp = GetComboPoints('vehicle', 'target')
else
cp = GetComboPoints('player', 'target')
end
local cpoints = self.CPoints
if (cp) then
cpoints:Show()
for i=1, MAX_COMBO_POINTS do
if(i <= cp) then
cpoints[i]:SetAlpha(1)
else
cpoints[i]:SetAlpha(0.2)
end
end
else
cpoints:Hide()
end
end
This way, you're getting your CPoints shown everytime, when CPoints are on the target, regardless of your class. If there is at least one combo point, the whole element is shown and updated as you want it with the alpha settings.
Note: You don't have to include those cpoints:Show() / :Hide() stuff, it would be my approach.
If you want your CPoints always visible if you're in cat-form or on an rogue, just show them all the time (rogue) or if you're in cat (drood).
Create a frame and register the "UPDATE_SHAPESHIFT_FORM"-event and apply a script to this event
lua Code:
local function ShapeshiftControl()
if (currentform == CAT) then
ShowCPoints()
else
HideCPoints()
end
end
This is of course pseudo-code, you will have to fill it with life.
edit: Second approach is easily modified to handle eclipse-bar, too!