WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Dynamic Unitframes (https://www.wowinterface.com/forums/showthread.php?t=32082)

Grai 04-24-10 07:27 PM

Dynamic Unitframes
 
Hello folks, I have a pretty in-depth question here, so please read it through prior to flaming me :P


I'm actually using a heavily modified version of oUF, and what I'm attempting to do is relocate / recreate the unitframes based on class.

I.E., if I'm on a rogue, I'd like the unitframes to spawn 30 pixels from the top, versus on a druid, I'd like them to spawn 110 pixels from the bottom. And other options.


Any ideas? I've looked into doing it around the ouf:spawn tags, but I can't seem to figure out how to do it conditionally, it just doesnt spawn the frames at all if i do it based on a Unitclass("player")=="Rogue" type line.


HALP

kokomala 04-24-10 08:52 PM

Spawn the unit frames as you would normally, then use the setpoint() to change the position based on class.

eg:
local pClass = select(2, UnitClass('player'))

local player = oUF:Spawn('player', 'oUF_MyPlayerFrame')

if pClass == 'rogue' then
player:SetPoint('topright', -30, -250)
else
player:SetPoint('center', 0, -250)
end


change names and points etc around. The above code is just written off the top of my head, but I've done something similar in an older layout of mine.

Grai 04-25-10 10:54 PM

Right, but the question becomes, will it do this JUST the first time ouf is run on that particular toon, or will it do it every time for every toon?

Mokane 04-25-10 11:07 PM

Quote:

Originally Posted by Grai (Post 185934)
Right, but the question becomes, will it do this JUST the first time ouf is run on that particular toon, or will it do it every time for every toon?

It would do it anytime you log in or reload your ui. It calls the spawn function whenever those events happen.


All times are GMT -6. The time now is 01:14 AM.

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