1. #1

    LUA - Dynamic bars

    Hello,

    Wondering how people solve the dynamic bars situation? By design WoW locks down moving around drawn bars and the like during combat but I've been told addons like recount solve this by creating the bars then basically filling the values in on the fly. Anyone had experience with doing this and have any insight to it?

  2. #2
    You should look into statusbars. http://wowprogramming.com/docs/widgets/StatusBar

    Statusbars can have a statusbarTexture, value, minValue and maxValue.

    You can change the value of the statusbar at any time. The call can be initiated by an event or a timeout function. Once you change the value of the statusbar the texture will be adjusted automatically. Statusbars can be horizontal or vertical.

    Nothing is blocked in combat. Well not unless you try hacking Blizzard code while being in combat.
    | Simple is beautiful.
    | Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

    "I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

  3. #3
    Elemental Lord Elim Garak's Avatar
    Join Date
    Apr 2011
    Location
    DS9
    Posts
    8,857
    Quote Originally Posted by Flawless101 View Post
    Hello,

    Wondering how people solve the dynamic bars situation? By design WoW locks down moving around drawn bars and the like during combat but I've been told addons like recount solve this by creating the bars then basically filling the values in on the fly. Anyone had experience with doing this and have any insight to it?
    You can easily change the bar size during combat. Say you have background bar and foreground bar. Just change the foreground bar size - and that's it - or use built-in statusbar component and just pass a new value to it.

  4. #4
    Sorry, should have been more clear. The issue isn't with resizing but the positioning of the bars themselves so they move depending on when they are called. Currently, the bars are set at a fixed position and will always appear at a specific location, our goal is that the bars will stack themselves rather than have a set location.

    Think things like buff bars that always appear at the next available location (and reorder on timeleft). StatusBar is being used for the bars currently, we're just not sure of any simple way of setting locations as, we've been told, that moving the bars is blocked as this can lead to say reorder with lowest HP and being able to clicky and easily select heals and that the loop hole is to create empty bars and fill the values as needed.

  5. #5
    Elemental Lord Elim Garak's Avatar
    Join Date
    Apr 2011
    Location
    DS9
    Posts
    8,857
    Well, there's alpha = 0 trick. So you pre-create all the bars and hide them by setting there alpha to 0. And when you need to add a new bar above - you just set alpha to 1 (for the next bar) and set it to show what you need it to show.

  6. #6
    Ah, that's an interesting trick too. Thanks.

  7. #7
    You can only not move secure frames in combat (action buttons and the like).
    UI & AddOns expert | Interface & Macros moderator - My work

Posting Permissions

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