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 |
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. |
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?
|
Quote:
|
All times are GMT -6. The time now is 01:14 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI