Thread Tools Display Modes
09-24-10, 07:40 AM   #1
azsh
A Fallenroot Satyr
Join Date: May 2010
Posts: 21
Arena Frames spawn help

Hello. I have major problem with my oUF layout. im using this template http://wiki.github.com/haste/oUF/boilerplate-template.

My problem is that "arena frame target" look exactly like "arena frame" and i dont no where is the error or how to change that. I tried different ways and result it's still the same they do not appear or continue to look the same.

Mayby anyone can help me solve the problem ?

My template look like (It has removed some code because it is not important)

http://pastey.net/140895
  Reply With Quote
09-24-10, 07:55 AM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
I suggest changing your "match or match or match" segment into something a little bit more readable. The issue is that you check for "arena%d", then "arena%dtarget". You can either make the pattern stricter or swap the position of those two.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-24-10, 08:23 AM   #3
azsh
A Fallenroot Satyr
Join Date: May 2010
Posts: 21
It's working ! thank you very much I spent many hours to find a solution and did not realize that the change position can make a difference. Thanks !
  Reply With Quote
09-24-10, 03:20 PM   #4
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Another way to do it is this:

Code:
local UnitSpecific = {
	arenaframes = function(self)
	...........	
	end,
end
and spawn them

Code:
oUF:RegisterStyle('oUF_ArenaF', UnitSpecific.arenaframes)
oUF:SetActiveStyle('oUF_ArenaF')
local arena = {}
	for i = 1, 5 do
		arena[i] = oUF:Spawn("arena"..i, "oUF_Arena"..i)
		if i == 1 then
			arena[i]:SetPoint('RIGHT', UIParent, 'RIGHT', -100, 0)
		else
			arena[i]:SetPoint("BOTTOMRIGHT", arena[i-1], "TOPRIGHT", 0, 20)
		end
	end
Pretty clean way imho.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
09-25-10, 01:30 AM   #5
azsh
A Fallenroot Satyr
Join Date: May 2010
Posts: 21
Ok im using your template if you don't mind is much better and cleaner than other's Thanks for help


Code:
  -----------------------------
  -- FUNCTIONS
  -----------------------------
  .....
  -----------------------------
  -- LAYOUT
  -----------------------------
  local Shared = function(self,unit)
    ....
  end
  -----------------------------
  -- STYLE FUNCTIONS
  -----------------------------
  local UnitSpecific = {
    player = function(self)
        Shared(self)
        .......
    end,
    target = function(self)
        Shared(self)
        .......
    end,
    targettarget = function(self)
        .......
    end,
    pet = function(self)
        Shared(self)
        .......
    end,
    focus = function(self)
        Shared(self)
        .......
    end,
    focustarget = function(self)
        Shared(self)
        .......
    end,
    boss = function(self)
        Shared(self)
        .......
        end,

    arenaframes = function(self)
        Shared(self)
        .......
    end,    

    arenatargets = function(self)
        Shared(self)
        .......
    end,
 }
  -----------------------------
  -- SPAWN UNITS
  -----------------------------
  oUF:RegisterStyle("name", Shared)

  for unit,layout in next, UnitSpecific do
    oUF:RegisterStyle('name - ' .. unit:gsub("^%l", string.upper), layout)
  end
local spawnSpecific = function(self, unit, ...)
    if(UnitSpecific[unit]) then
        self:SetActiveStyle('name - ' .. unit:gsub("^%l", string.upper))
        local object = self:Spawn(unit)
        object:SetPoint(...)
        return object
    else
        self:SetActiveStyle'name'
        local object = self:Spawn(unit)
        object:SetPoint(...)
        return object
    end
end

oUF:RegisterStyle('oUF_name_Arena', UnitSpecific.arenaframes)
oUF:SetActiveStyle('oUF_name_Arena')
local arena = {}
local arenatarget = {}
    for i = 1, 5 do
        arena[i] = oUF:Spawn("arena"..i, "oUF_Arena"..i)
        if i == 1 then
            arena[i]:SetPoint('RIGHT', UIParent, 'RIGHT', -100, 0)
        else
            arena[i]:SetPoint("BOTTOMRIGHT", arena[i-1], "TOPRIGHT", 0, 20)
        end
    end
    
oUF:RegisterStyle("oUF_name_ArenaTarget", UnitSpecific.arenatargets)
oUF:SetActiveStyle("oUF_name_ArenaTarget")
for i = 1, 5 do
    arenatarget[i] = oUF:Spawn("arena"..i.."target", "oUF_Arena"..i.."target"):SetPoint("TOPLEFT",arena[i], "TOPRIGHT", 8, 0)
end

 oUF:Factory(function(self)
    spawnSpecific(self, 'target', "BOTTOM",  X, Y)
    spawnSpecific(self, 'player', "BOTTOM", X, Y)
    spawnSpecific(self, 'pet', "TOPRIGHT", self.units.player, "BOTTOMRIGHT", X, Y)
    spawnSpecific(self, 'targettarget', "TOPRIGHT", self.units.target, "BOTTOMRIGHT", X, Y)
    spawnSpecific(self, 'focus', "BOTTOM", X, Y)
    spawnSpecific(self, 'focustarget', "BOTTOM", X, Y)
    
    self:SetActiveStyle"name - Boss"
    local boss = {}
        for i = 1, MAX_BOSS_FRAMES do
            local unit = self:Spawn("boss"..i, "oUF_Boss"..i)

            if i==1 then
                unit:SetPoint("TOP", self.units.player, "BOTTOM", 750, 400)
            else
                unit:SetPoint("TOP", boss[i-1], "BOTTOM", 0, -12)
            end
            boss[i] = unit
        end
 end)
  Reply With Quote
09-25-10, 06:44 AM   #6
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
It's the same solution as used in Lily, so Dawn won't mind . I should really post it as a separate style boilerplate template, but I haven't gotten to that yet.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-25-10, 09:02 AM   #7
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Originally Posted by haste View Post
It's the same solution as used in Lily, so Dawn won't mind . I should really post it as a separate style boilerplate template, but I haven't gotten to that yet.
This.

The message you have entered is too short. Please lengthen your message to at least 10 characters.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Arena Frames spawn help


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