WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Target Unitframe - dynamic statusbar layout (https://www.wowinterface.com/forums/showthread.php?t=56993)

Coldkil 01-24-19 10:16 AM

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)



All times are GMT -6. The time now is 06:42 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI