1. May 20, 2016  
    http://pastebin.com/StMXKkyL

    Contains code for creating statusbars, for both health or power. Didn't add arena support, but I'm sure if someone wants to he can add it easily.

    http://imgur.com/WyjOcsW

    Frames can be dragged via shift click. Dragging is enabled by double click on the frame.

    statusbar.classcolor = true

    to add classcolor for healthbars

    Examples to create bars like in screenshot are included in code. If you name the statusbar, blizzard UI remembers the spot without having to use savedvariables manually too.
    • "UpdatePowerType" doesn't check if target exists and causes an error when target frame is forcely shown or if it's hidden due to untargeting.
    • The power text has to be rounded (or floored) or you will end with floating-point numbers.
    • Why do you locally reference UnitHealth and UnitPower (which is good) and you use their global then? (f.statusbar.status_current = _G["Unit"..statusbar_type] )
    • Why do you locally reference _G? (since you don't really need it)
    • "(self, event,...)
      local unit = ... "
      Why, just why?


    Might have few bugs but I'm not too interested in maintaining this one. Should get anyone started who wants to create full Unitframe addon with full click support etc.
    Yeah, giving out a half-arsed code encouraging to create an UF AddOn of which there are 10 widely known working flawlessly and have an ingame config...
    Why even bother then?
    Edited: May 20, 2016

  2. May 21, 2016  
    f.statusbar.status_current is not global item anymore is it. Gave me easy way to handle call to either power or health, talking about fractions of microsecond if you want to argue about effiency.

    Nitpicking about locals... I dont want to even comment.

    Valid arguement on "local unit = ..." thing. To me it falls to category "do I want to optimize this by fraction of microsecond, or do I give a ****".

    And why I posted it, simple, there's not much of examples on how to great solid single unitframe, so I wanted to just gather things into 1 spot.

    Things in my example are usually spread into multiple modules in legit unitframe addons.

    Also there are people who might prefer just creating their own UI tailored to them, your "flawless" UF addons have so much unnecessary features in general that something local unit = ... doesnt come even close in terms of cpu time lost.

    Why even bother then?
    With your attitude, I'm certain not many people will bother with new things

  3. May 21, 2016  
    [...]
    EDIT: Cut out the BS, back to topic. Let us live in peace and harmony.
    - - -

    TLDR:
    I appreachiate your intention and work.
    My attitude is quite good according to the people I work/worked with. ;)

    The points I suggested would improve the code, make it more readable and therefore better for beginners to work with.

    The whole update functionality can be improved a bit, will post sth later.

    Your annotations are quite nice, though.
    Edited: May 21, 2016

  4. Hello! I need a simple code to display the HP bars of the team player party 1 party 2 without additional functions
    https://ibb.co/WsTjWWR

First 12

Posting Permissions

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