1. #1

    CooldownFrame sometimes not working

    Hello,

    I'm writing my own debuff frames and so I'm using the CooldownFrameTemplate to get the cooldown effect that works nicely with other addons as well (namely OmniCC). However, sometimes, some of my frames are not doing the cooldown animation (omnicc still puts time on them though). This persists untill I reload UI, then sometimes the frames work, sometimes others don't, it's driving me nuts.

    All other addons that use cooldown frames and animations seem to be completely fine, so I doubt this is some taint issue.

    This is how I create my cooldown frames:

    Code:
    frame.cooldownFrames[i] = CreateFrame("Cooldown", "Dbfs"..i, frame, "CooldownFrameTemplate"); 
    frame.cooldownFrames[i]:ClearAllPoints();
    frame.cooldownFrames[i]:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", xoffset, yoffset);
    frame.cooldownFrames[i]:SetSize(settings.expandedX, settings.expandedY);
    frame.cooldownFrames[i]:SetReverse(true);
    frame.cooldownFrames[i]:SetDrawEdge(false);
    
    frame.cooldownFrames[i].texture = frame.cooldownFrames[i]:CreateTexture(nil);
    frame.cooldownFrames[i].texture:SetAlpha(1);
    frame.cooldownFrames[i].texture:SetAllPoints();
    Then, when I want to set a cooldown into one of them, I do it like so:

    Code:
    cdframe:SetCooldown(debuff.start, debuff.duration);
    local texture = cdframe.texture;
    texture:SetTexture(debuff.icon);
    texture:SetAllPoints();
    cdframe:Show();
    where debuff.start is expires - duration as returned by UnitDebuff.

    Has anyone else faced a similar issue? Am I doing something wrong? All help is appreciated. Thanks.

  2. #2
    It looks like you're creating a texture on top of your cooldown frame.
    It doesn't work, I've tried nothing!

  3. #3
    Quote Originally Posted by semlar View Post
    It looks like you're creating a texture on top of your cooldown frame.
    OOoooooh, I think you might be right. Thanks a bunch dude, I would have never figured that out. Whose idea was it to have same level elements be drawn in relatively random order between UI loads anyway!

  4. #4
    Quote Originally Posted by Cracked View Post
    OOoooooh, I think you might be right. Thanks a bunch dude, I would have never figured that out. Whose idea was it to have same level elements be drawn in relatively random order between UI loads anyway!
    If you create the texture on the same frame that you're parenting the cooldown frame to, the cooldown should always appear above it.

    Textures behave oddly in that their draw order is based on when they load rather than when they're "created" in the script, probably as a result of the streaming client, so there's no guarantee that textures drawn on the same level will always appear in the same order.
    It doesn't work, I've tried nothing!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •