Thread Tools Display Modes
04-24-10, 07:27 PM   #1
Grai
A Defias Bandit
Join Date: Apr 2010
Posts: 2
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
  Reply With Quote
04-24-10, 08:52 PM   #2
kokomala
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 29
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.
  Reply With Quote
04-25-10, 10:54 PM   #3
Grai
A Defias Bandit
Join Date: Apr 2010
Posts: 2
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?
  Reply With Quote
04-25-10, 11:07 PM   #4
Mokane
A Deviate Faerie Dragon
 
Mokane's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 16
Originally Posted by Grai View Post
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.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Dynamic Unitframes


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off