Dominos

Dominos

19M Downloads

Child elements' alpha incorrect when using opacity + showStates

ckaotik opened this issue ยท 4 comments

commented

I encountered this while using tullaCC. The general procedure is this:

  1. display multiple bars (in my case bar 1 and 6)
  2. trigger a cooldown on both bars
  3. /reload
  4. 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.

dominos_opacity_bug
Urgh. Sorry for the yellow font ...

commented

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
commented

I've implemented your mousewheel opacity fix, but I'm still investigating the other issue.

commented

Closing this, because there's a new issue to deal with now :)

commented

There's a slight chance this might be fixed with the WoD version, as I've switched from using the animation system to C_Timer for things.