1. #1
    Deleted

    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
    Deleted
    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.

  3. #3
    The Unstoppable Force Elim Garak's Avatar
    10+ Year Old Account
    Join Date
    Apr 2011
    Location
    DS9
    Posts
    20,297
    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
    Deleted
    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
    The Unstoppable Force Elim Garak's Avatar
    10+ Year Old Account
    Join Date
    Apr 2011
    Location
    DS9
    Posts
    20,297
    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
    Deleted
    Ah, that's an interesting trick too. Thanks.

  7. #7
    Deleted
    You can only not move secure frames in combat (action buttons and the like).

Posting Permissions

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