Perl Lite

45 - Add a Castbar

The following commits port over a config option + default settings for a castbar, and the castbar frame itself.

There are no options for castbar features, like showing the safezone, the icon, or cast time. The castbar also takes up more space than it should, I need to make it live better within the frame scheme.

User When Change
Morsker Aug 05, 2012 at 17:31 UTC Changed status from Accepted to Fixed
Morsker Aug 01, 2012 at 15:44 UTC Changed milestone from None to Ready For Beta
Morsker Jul 31, 2012 at 22:40 UTC Changed status from New to Accepted
DavidTheMachine Jul 30, 2012 at 08:18 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of Morsker Morsker Aug 05, 2012 at 17:30 UTC - 0 likes

    Ok, I thought about this. Icons are supposed to show and hide themselves without being asked. To make them stop you'd have to do like self:DisableElement("PvPTimer") every time the castbar shows, and I don't like that. I currently only disable or enable elements when the user changes settings.

    You can suppress showing of the icons by using self.NameFrame:DisableDrawLayer("OVERLAY") as long as all the icons are children of NameFrame, which I think they are. But the names are in there too, including the spell name. I don't like having the spell name in NameFrame instead of Castbar, but I needed it to be visible, and still fading out, after the Castbar hides itself. Maybe I should have replaced Castbar's OnUpdate handler with a different one for the end-cast flash animation, to keep Castbar from auto-hiding itself. Then the spell name wouldn't be in NameFrame, and hiding NameFrame's OVERLAY layer would get rid of the icons.

    I'm going to close this and make new tickets for improvements to how icons are shown.

  • Avatar of Morsker Morsker Aug 05, 2012 at 03:57 UTC - 0 likes

    I pushed an awful lot of changes just now before I saw this, and was about to call it finished. Getting the colors and alphas right required moving a lot of things around; some couldn't be in Castbar itself or they'd get too much alpha, or would hide too soon when Castbar hides, instead of sticking around to fade out.

    I don't know what to do with the icon. I made it movable and put it outside the frame but I'm not that happy with it. I'll take a look at what you did tomorrow.

  • Avatar of DavidTheMachine DavidTheMachine Aug 05, 2012 at 01:10 UTC - 0 likes

    I did some more tweaking in my DArc branch. I originally set out to deal with the castbar overlapping the various icons, but instead worked on other visual tweaks:

    • the cast icon now fits in the castbar
    • added in the castbar spark, only let it show for player
    • only show the cast shield for target/targettarget/focus/focustarget
    • only show the safezone for player

    For the icons, there are 2 approaches I envision:

    1. have the castbar in the same layer as NameFrame, replace the Name text with the spellname, and handle the tradeoff with the Post(Cast|Channel)(Start|Stop) functions
    2. make all the icons their own standalone frames, attach them a couple of levels above the UnitFrame

    I tried 1, but I'll have to toy around with the Post* functions some more.

    Edit: End -> Stop, derp

    I continued on with the various update functions, and I'm nearly able to hide()/show() the conflicting elements. The work isn't complete, the PvPTimer is still showing up, maybe because its update function needs to get temporarily shut down; plus I now realize there are several other icons, like master looter, party leader and raid icons that need to be accounted for.

    Last edited Aug 05, 2012 by DavidTheMachine
  • Avatar of Morsker Morsker Aug 03, 2012 at 03:29 UTC - 0 likes

    Frame alphas round down. Color alphas round half up. So 0.85 becomes 216/255 in a frame, and 217/255 in a color.

    Last edited Aug 03, 2012 by Morsker
  • Avatar of Morsker Morsker Aug 03, 2012 at 02:08 UTC - 0 likes

    I officially hate cast bars now. I've spent like an hour trying to get the colors to come out right, with no luck. X-Perl layers so many random alphas onto other alphas, and I can't find where it's coming from...

  • Avatar of Morsker Morsker Aug 02, 2012 at 17:34 UTC - 0 likes

    I accidentally pushed castbar to origin/master instead of origin/castbar; I'm not going to try undoing it since I've heard it's a huge pain to revert merges. I wanted to make it feel more "Perl" before pushing it though, so I'll try to finish that today.

    Also I fixed the image initializing to the wrong texture.

  • Avatar of Morsker Morsker Aug 01, 2012 at 19:13 UTC - 0 likes

    So shields display correctly on my mage, for Hearthstone / Mount, but not on my druid. And it's not addon-related, even just doing /dump select(9,UnitCastingInfo("target")) will output "true" for the Hearthstone on my mage, but not my druid.

    Makes a lot of sense, right???

  • Avatar of Morsker Morsker Aug 01, 2012 at 17:08 UTC - 0 likes

    TargetFrameSpellBar is using spark & border graphics that I want to take a look at later. It also has the "red interrupted, then fade" behavior I like.

    ... Actually, TargetFrameSpellBar behaves an awful lot like X-Perl. I haven't looked at X-Perl's implementation yet but I wonder if it isn't just copying TargetFrameSpellBar.

    Last edited Aug 01, 2012 by Morsker
  • Avatar of Morsker Morsker Aug 01, 2012 at 16:37 UTC - 0 likes

    Ok, castbar.lua is just using Blizzards "not interruptable" return from UnitCastingInfo, and it doesn't put up shields on hearthstone and mounts. It's just this basically:

    /dump select(9,UnitCastingInfo("target")) and "NOT interruptable" or "might be interruptable"

    But you're the third person who told me it works, so maybe there are different oUF versions, or plugins that change the behavior.

  • Avatar of Morsker Morsker Aug 01, 2012 at 16:21 UTC - 0 likes

    They actually don't work for me, and I don't know why. I don't get the Shield graphic on them. But someone found me this mob and he has Steady Shot that does it:

    If you're getting shields on Hearthstone and I'm not, that makes no sense to me and I'm going to have to go read the oUF castbar.lua and see what's going on.


Last updated
Aug 05, 2012
Jul 30, 2012
Fixed - Developer made requested changes. QA should verify.
Enhancement - A change which is intended to better the project in some way
Medium - Normal priority.
Ready For Beta

Reported by

Possible assignees