Child elements' alpha incorrect when using opacity + showStates
ckaotik opened this issue ยท 4 comments
I encountered this while using tullaCC. The general procedure is this:
- display multiple bars (in my case bar 1 and 6)
- trigger a cooldown on both bars
- /reload
- notice: main action bar displays cooldown properly, while other bars do not (opacity issue)
These seem to be related to the combined use of opacity/fadedOpacity and showStates, which I use a combination of to achieve fully visible bars when in combat or hovered and faded otherwise:
Faded Opacity: 50 (to fade out when not hovered)
Opacity: 100
Show States: [combat]100;50 (to fade out when not in combat)
When causing cooldowns to be created sometime after /reload, everything works as expected. Only active cooldowns on /reload on non main bars are affected.
Side note:
Without using the Config sub-addon I also noticed a rather weird behavior. You can adjust the alpha of the bar simply by using the mouse wheel. Doing so takes the bar's current alpha which ignores showState settings.
My 100% opacity goes down to 30 (= 50 - 20) with a single mouse wheel down which might not be intended. A suggestion would be to use the opacity setting's value.
function Drag:OnMouseWheel(arg1)
local oldAlpha = self.owner.sets and self.owner.sets.alpha or 1
local newAlpha = min(max(oldAlpha + (arg1 * 0.1), 0), 1)
if newAlpha ~= self.owner:GetAlpha() then
self.owner:SetFrameAlpha(newAlpha)
self:OnEnter()
end
end
I've implemented your mousewheel opacity fix, but I'm still investigating the other issue.