View Single Post
01-24-19, 10:16 AM   #1
Coldkil
A Cliff Giant
 
Coldkil's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2010
Posts: 70
Target Unitframe - dynamic statusbar layout

Ok, so i'm using something i call "splitbars" on my current ui - basically i created a method to create an array of statusbars that work as small segments of the same one and deplete/behave independently. Since every segment is a single statusbar it can be managed and changed in any way you can do with a single one without interfering with the others, making up for interesting concepts.

So the idea is this: i want to use for bosses a different hp bar layout that's inspired from old beat'em up games. Creating the "layered" bar is the easy part, what i'd like is to make it so when i'm targeting a boss it displays layout #1 and when i'm targeting something else it goes with layout #2.

Do i need to do this with an OnEvent/OnUpdate script called when target changes or if i define the target unitframe in oUF depending on target unit type the code alone will change the layout when i change target?

in pseudo code:

Code:
---target unitframe layout
if unit type == BOSS then
        --layout for boss
        else
        --other layout
        end
or:

Code:
target:SetScript(OnEvent, function()
      if unit type == BOSS then
        --layout for boss
        else
        --other layout
        end
end)
  Reply With Quote