Reply
 
Thread Tools Display Modes
Old 07-31-2009, 01:59 AM   #1
camelot10
A Kobold Labourer
Join Date: Sep 2008
Posts: 1
Arena targets - need help

Anyone know ouf layout or maybe documentation or link somewhere where i can read how to add arena enemys frames into my ouf layout?
camelot10 is offline   Reply With Quote
Old 07-31-2009, 03:48 AM   #2
Waverian
A Flamescale Wyrmkin
Interface Author - Click to view interfaces
Join Date: Dec 2006
Posts: 108
Code:
local arena = {}
for i = 1, 5 do
	arena[i] = oUF:Spawn("arena"..i, "oUF_Stiletto_Arena"..i)
	if i == 1 then
		arena[i]:SetPoint("CENTER", 400, -100)
	else
		arena[i]:SetPoint("TOP", arena[i-1], "BOTTOM", 0, -10)
	end
end
Might be a cleaner way to do it but I couldn't find headers or anything like that. It works fine, though.
Waverian is online now   Reply With Quote
Old 10-03-2009, 09:59 PM   #3
deffen
A Defias Bandit
Join Date: Oct 2009
Posts: 2
Quote:
Originally Posted by Waverian View Post
Code:
local arena = {}
for i = 1, 5 do
	arena[i] = oUF:Spawn("arena"..i, "oUF_Arena"..i)
	if i == 1 then
		arena[i]:SetPoint("CENTER", 400, -100)
	else
		arena[i]:SetPoint("TOP", arena[i-1], "BOTTOM", 0, -10)
	end
end
Might be a cleaner way to do it but I couldn't find headers or anything like that. It works fine, though.
I've been trying this for a few hours now, but I cant get it spawned.

My oUF_Arena looks like this:

Code:
if(self:GetParent():GetName():match"oUF_Arena") then
		self:SetWidth(160)
		self:SetHeight(20)
		self.Health:SetHeight(15)
		self.Power:SetHeight(3)
		self.Power.value:Hide()
		self.Health.value:SetPoint("RIGHT", 0 , 9)
		self.Name:SetPoint("LEFT", 0, 9)
end
Anyone who can help?
deffen is offline   Reply With Quote
Old 10-03-2009, 10:55 PM   #4
Waverian
A Flamescale Wyrmkin
Interface Author - Click to view interfaces
Join Date: Dec 2006
Posts: 108
Quote:
Originally Posted by deffen View Post
I've been trying this for a few hours now, but I cant get it spawned.

My oUF_Arena looks like this:

Code:
if(self:GetParent():GetName():match"oUF_Arena") then
		self:SetWidth(160)
		self:SetHeight(20)
		self.Health:SetHeight(15)
		self.Power:SetHeight(3)
		self.Power.value:Hide()
		self.Health.value:SetPoint("RIGHT", 0 , 9)
		self.Name:SetPoint("LEFT", 0, 9)
end
Anyone who can help?
I think the problem is your conditional. You'd use :GetParent():GetName() on headers, but the arena frames when spawned this way aren't constructed by a header. The layout function is called 5 times, one for each arena frame, with the 'self' being a reference to the actual frame (self:GetName():match"...").

Alternatively you can use a separate layout function entirely (I used this method since my arena frames varied a lot from my normal frames):

lua Code:
  1. <the rest of your layout>
  2.  
  3. local ArenaStyle = function(self, unit)
  4. -- layout bits
  5. end
  6.  
  7. oUF:RegisterStyle('MyLayoutArena', ArenaStyle)
  8. oUF:SetActiveStyle('MyLayoutArena')
  9.  
  10. -- spawn arena frames
Waverian is online now   Reply With Quote
Old 10-04-2009, 02:49 AM   #5
deffen
A Defias Bandit
Join Date: Oct 2009
Posts: 2
Quote:
Originally Posted by Waverian View Post
I think the problem is your conditional. You'd use :GetParent():GetName() on headers, but the arena frames when spawned this way aren't constructed by a header. The layout function is called 5 times, one for each arena frame, with the 'self' being a reference to the actual frame (self:GetName():match"...").

Alternatively you can use a separate layout function entirely (I used this method since my arena frames varied a lot from my normal frames):

lua Code:
  1. <the rest of your layout>
  2.  
  3. local ArenaStyle = function(self, unit)
  4. -- layout bits
  5. end
  6.  
  7. oUF:RegisterStyle('MyLayoutArena', ArenaStyle)
  8. oUF:SetActiveStyle('MyLayoutArena')
  9.  
  10. -- spawn arena frames
Thanks alot, self:GetName():match"..." worked like a charm.
deffen is offline   Reply With Quote
Old 10-25-2009, 06:33 AM   #6
davee
A Kobold Labourer
Join Date: Oct 2008
Posts: 1
How do I make it so that when someone in arena stealth, the frame does not disappear?
davee is offline   Reply With Quote
Old 11-07-2009, 08:32 AM   #7
Dawn
A Chromatic Dragonspawn
 
Dawn's Avatar
Interface Author - Click to view interfaces
Join Date: May 2006
Posts: 182
I included arena frames to my layout. I also added arena frame targets like this...

Code:
	if(unit and unit:find('arena%dtarget')) then
... style of arena targets ... 
end

I spawn them like this...

Code:
local arenaTarget = {}
for i = 1, 5 do
	arenaTarget[i] = oUF:Spawn('arena'..i..'target', 'oUF_Arena'..i..'Target')
	if i == 1 then
	arenaTarget[i]:SetPoint('TOP', arena[1], 'BOTTOM', 0, -4)
	elseif i == 2 then
	arenaTarget[i]:SetPoint('TOP', arena[2], 'BOTTOM', 0, -4)
	elseif i == 3 then
	arenaTarget[i]:SetPoint('TOP', arena[3], 'BOTTOM', 0, -4)
	elseif i == 4 then
	arenaTarget[i]:SetPoint('TOP', arena[4], 'BOTTOM', 0, -4)
	elseif i == 5 then
	arenaTarget[i]:SetPoint('TOP', arena[5], 'BOTTOM', 0, -4)	
	end
end

For some funny reason, those frames seem to inherit their layout code from "some" (not sure which, maybe target, maybe focus, maybe party ... it looks by default like one of those) other unit frame. Which means I basically do have to override the code to be able to change it (i.e. ClearSetPoints() to move things or Hide() things that shouldn't be there, but are there on another frame). Strange, I've never seen that happen before, for any other frames. Am I addressing them wrong or how/why does this happen?

Last edited by Dawn : 11-07-2009 at 08:34 AM.
Dawn is online now   Reply With Quote
Old 11-07-2009, 02:18 PM   #8
Soeters
A Theradrim Guardian
 
Soeters's Avatar
Interface Author - Click to view interfaces
Join Date: Aug 2008
Posts: 65
What you could do is create different layout (very different by style just for the test) and see what arena targets looks like in order to know which layout they imitate.


Maybe that will become easier to see what's misplaced, and from which layout it comes, when you have very different layouts
__________________
Soeters is online now   Reply With Quote
Reply

Go BackWoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Arena targets - need help

Thread Tools
Display Modes

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




The Network:
EQInterface | EQ2Interface | LoTROInterface | MMOInterface | War.MMOUI | WoWInterface | VGInterface | Allakhazam | Thottbot | Wowhead | Zam


©2009 MMOUI / ZAM Network
vBulletin - Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.