07-31-2009, 01:59 AM
|
#1
|
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?
|
|
|
07-31-2009, 03:48 AM
|
#2
|
A Flamescale Wyrmkin
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.
|
|
|
10-03-2009, 09:59 PM
|
#3
|
A Defias Bandit
Join Date: Oct 2009
Posts: 2
|
Quote:
Originally Posted by Waverian
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?
|
|
|
10-03-2009, 10:55 PM
|
#4
|
A Flamescale Wyrmkin
Join Date: Dec 2006
Posts: 108
|
Quote:
Originally Posted by deffen
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:
<the rest of your layout> local ArenaStyle = function(self, unit) -- layout bits end oUF:RegisterStyle('MyLayoutArena', ArenaStyle) oUF:SetActiveStyle('MyLayoutArena') -- spawn arena frames
|
|
|
10-04-2009, 02:49 AM
|
#5
|
A Defias Bandit
Join Date: Oct 2009
Posts: 2
|
Quote:
Originally Posted by Waverian
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:
<the rest of your layout> local ArenaStyle = function(self, unit) -- layout bits end oUF:RegisterStyle('MyLayoutArena', ArenaStyle) oUF:SetActiveStyle('MyLayoutArena') -- spawn arena frames
|
Thanks alot, self:GetName():match"..." worked like a charm.
|
|
|
10-25-2009, 06:33 AM
|
#6
|
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?
|
|
|
11-07-2009, 08:32 AM
|
#7
|
A Chromatic Dragonspawn
Join Date: May 2006
Posts: 179
|
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.
|
|
|
11-07-2009, 02:18 PM
|
#8
|
A Theradrim Guardian
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
__________________
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|