Thread Tools Display Modes
01-18-09, 11:46 AM   #521
Soulcleaver
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 65
Originally Posted by Bruners View Post
take deep breath and ignore what ever you have learned from using DogTags,
look at the tag code, you set [name] and [level] then difficulty color and white for [classification]
self:Tag(unitnames,'[name] | [smartlevel][difficulty]|cffffffff[classification]|r' or '[name]')
hm, sorry i still don't get the "lvl" to be how i want it.. i get name and "elite" but not lvl!

result:


and code for name:

Code:
self:Tag(unitnames,'[raidcolor][name]  [smartlevel][difficulty] |cffffffff[classification]|r' or '[name]')
	if unit=='player' or unit=='pet' then
		unitnames:Hide()
 
01-18-09, 12:07 PM   #522
Soulcleaver
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 65
well im thankfull for the help.. but i think if i do like im intending to maybe the level color will be like i want it.. now last question from me how do i move the lvl/elite from where it is to this..?



Code:

Code:
--[[	
This is a test for the newest version of oUF 1.3+

		Credits to Lyn and p3lim, and of course to Haste for making oUF
	      p3lim because I looked at your oUF Perfect to figure out how the tag system works.
		and Lyn because I love your unit frame layout, so I'm "copying" it a little bit, hope you dont 

mind.

	-- zp
]]

local LynFont = 'Interface\\AddOns\\oUF_zp\\media\\LynFont.ttf'
local bartexture = 'Interface\\AddOns\\oUF_zp\\media\\statusbar'
local bufftexture = 'Interface\\AddOns\\oUF_zp\\media\\border'
local comboTex = 'Interface\\Addons\\oUF_zp\\media\\combotexture'

local menu = function(self)
	local unit = self.unit:sub(1, -2)
	local cunit = self.unit:gsub('(.)', string.upper, 1)

	if(unit == 'party' or unit == 'partypet') then
		ToggleDropDownMenu(1, nil, _G['PartyMemberFrame'..self.id..'DropDown'], 'cursor', 0, 0)
	elseif(_G[cunit..'FrameDropDown']) then
		ToggleDropDownMenu(1, nil, _G[cunit..'FrameDropDown'], "cursor", 0, 0)
	end
end

--[[ custom tags ]]--
local function siVal(value)
	if(value >= 1e6) then
		return string.format('%.1fm', value / 1e6)
	elseif(value >= 1e4) then
		return string.format('%.1fk', value / 1e3)
	elseif value >= 1e3 then
		return string.format('%.1fk', value / 1e3)
	else
		return value
	end
end

oUF.Tags['[smartcurhp]'] = function(u) return siVal(UnitHealth(u)) end
oUF.TagEvents['[smartcurhp]'] = 'UNIT_HEALTH'

oUF.Tags['[smartcurpp]'] = function(u) return siVal(UnitPower(u)) end
oUF.TagEvents['[smartcurpp]'] = 'UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE'

--[[ auras ]]--
local auraIcon = function(self, button, icons)
	icons.showDebuffType = true
	
	button.icon:SetTexCoord(.07, .93, .07, .93)
	button.icon:SetPoint('TOPLEFT', button, 'TOPLEFT', 1, -1)
	button.icon:SetPoint('BOTTOMRIGHT', button, 'BOTTOMRIGHT', -1, 1)
	
	button.overlay:SetTexture(bufftexture)
	button.overlay:SetTexCoord(0,1,0,1)
	button.overlay.Hide = function(self) self:SetVertexColor(0.3, 0.3, 0.3) end
	
	button.cd:SetReverse()
	button.cd:SetPoint('TOPLEFT', button, 'TOPLEFT', 2, -2) 
	button.cd:SetPoint('BOTTOMRIGHT', button, 'BOTTOMRIGHT', -2, 2)     
end

local function layout(self, unit)

	self.menu = menu
	self:RegisterForClicks('AnyUp')
	self:SetScript('OnEnter', UnitFrame_OnEnter)
	self:SetScript('OnLeave', UnitFrame_OnLeave)
	self:SetAttribute('*type2', 'menu')

	self:SetBackdrop({bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=], insets = {top = -2, left = -2, 

bottom = -5, right = -3}})
	self:SetBackdropColor(0, 0, 0, 0.5)
	-- test for focus and pet backdrops, they look a little off for some reason.
	if unit=='focus' or unit=='pet' then
		self:SetBackdrop({bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=], insets = {top = -2, left 

= -2, bottom = -5, right = -2}})
		self:SetBackdropColor(0, 0, 0, 0.5)
	end
	
	--test for newest version of oUF, lets see if we can force disable swapping of frames to Vehicles. Seems to 

be buggy still.
	self.disallowVehicleSwap = true

--[[ health bar ]]--
	self.Health = CreateFrame('StatusBar', nil, self)
	self.Health:SetStatusBarTexture(bartexture)
	self.Health:SetHeight(15)
        self.Health:SetStatusBarColor(.3,.3,.3)


	self.Health:SetParent(self)
	self.Health:SetPoint'TOP'
	self.Health:SetPoint'LEFT'
	self.Health:SetPoint'RIGHT'

	self.Health.colorClass = false
	self.Health.colorTapping = true
	self.Health.colorReaction = false
	self.Health.frequentUpdates = true
		
--[[ health bar bg ]]--
	self.Health.bg = self.Health:CreateTexture(nil, 'BORDER')
	self.Health.bg:SetAllPoints(self.Health)
	self.Health.bg:SetTexture(bartexture)
	self.Health.bg:SetAlpha(0)
	
--[[ power bar ]]--
	self.Power = CreateFrame('StatusBar', nil, self)
	self.Power:SetStatusBarTexture(bartexture)
	self.Power:SetHeight(5)
	self.Power:SetPoint("TOP", self.Health, "BOTTOM", 0, -1.45)

	self.Power:SetParent(self)
        self.Power:SetStatusBarColor(.3,.6,.9)

	self.Power:SetPoint'LEFT'
	self.Power:SetPoint'RIGHT'

	self.Power.colorPower = false
	self.Power.frequentUpdates = true
	if unit=='player' or unit=='target' then
		self.Power:Show()
	else
		self.Power:Hide()
	end

--[[ power bar bg ]]--
	self.Power.bg = self.Power:CreateTexture(nil, 'BORDER')
	self.Power.bg:SetAllPoints(self.Power)
	self.Power.bg:SetTexture(bartexture)
	self.Power.bg:SetAlpha(0)
	
--[[ health text ]]--
	local curhealth = self.Health:CreateFontString(nil, 'OVERLAY')
	curhealth:SetPoint('BOTTOM', self, 0, -20)
	curhealth:SetFont(LynFont, 12)
	self:Tag(curhealth,'[curhp]/[maxhp]')
	
	local perhealth = self.Health:CreateFontString(nil, 'OVERLAY')
	perhealth:SetPoint('BOTTOMLEFT', self, 0, -20)
	perhealth:SetFont(LynFont, 12)
	self:Tag(perhealth,'[perhp]%')
	if unit=='player' or unit=='target' then
		curhealth:Show()
		perhealth:Show()
	else
		curhealth:Hide()
		perhealth:Hide()
	end

--[[ health text bg ]]--
	local healthbg = self.Health:CreateTexture(nil, 'BORDER')
	healthbg:SetPoint('CENTER', curhealth, 'CENTER', 1, 0)
	healthbg:SetTexture(bartexture)
	healthbg:SetWidth(254)
	healthbg:SetHeight(13)
	healthbg:SetVertexColor(0, 0, 0, 1)
	if unit=='player' or unit=='target' then
		healthbg:Show()
	else
		healthbg:Hide()
	end

--[[ power text ]]--
	local curpower = self.Power:CreateFontString(nil, 'OVERLAY')
	curpower:SetPoint('BOTTOMRIGHT', self, 0, -20)
	curpower:SetFont(LynFont, 12)
        curpower:SetTextColor(.3,.6,.9)
	self:Tag(curpower,'[curpp]/[maxpp]')
	if unit=='player' then
		curpower:Show()
	else
		curpower:Hide()
	end

--[[ name text ]]--
	local unitnames = self.Health:CreateFontString(nil, 'OVERLAY')
	unitnames:SetPoint('LEFT', self, 0, 9)
	unitnames:SetFont(LynFont, 12, "THINOUTLINE")
	unitnames:SetJustifyH'LEFT'
        self:Tag(unitnames,'[raidcolor][name]  [smartlevel][difficulty]|cffffffff[classification]|r' or '[name]')
	if unit=='player' or unit=='pet' then
		unitnames:Hide()
	end
	if unit=='target' then
		unitnames:SetPoint('LEFT', self, -1, 21)
	end
	if unit=='targettarget' or unit=='focus' then
		unitnames:SetWidth(95)
		unitnames:SetHeight(18)
		unitnames:SetFont(LynFont, 11)
		unitnames:SetPoint('LEFT', self, 0, 0)
	end

--[[ raid icon ]]--
	self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
	self.RaidIcon:SetHeight(16)
	self.RaidIcon:SetWidth(16)
	self.RaidIcon:SetPoint('TOP', self, 0, 9)
	self.RaidIcon:SetTexture'Interface\\TargetingFrame\\UI-RaidTargetingIcons'
	
--[[ buffs ]]--
	self.Buffs = CreateFrame("Frame", nil, self)
	self.Buffs.size = 20
	self.Buffs:SetHeight(self.Buffs.size)
	self.Buffs:SetWidth(self.Buffs.size * 5)
	self.Buffs:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', -2, 20)
	self.Buffs.initialAnchor = 'BOTTOMLEFT'
	self.Buffs["growth-y"] = 'TOP'
	self.Buffs.num = 20
	self.Buffs.spacing = 2
	if unit ~= 'target' then
		self.Buffs:Hide()
	end

--[[ debuffs ]]--
	self.Debuffs = CreateFrame("Frame", nil, self)
	self.Debuffs.size = 20
	self.Debuffs:SetHeight(self.Debuffs.size)
	self.Debuffs:SetWidth(self.Debuffs.size * 12)
	self.Debuffs:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -25)
	self.Debuffs.initialAnchor = 'TOPLEFT'
	self.Debuffs["growth-y"] = 'DOWN'
	self.Debuffs.filter = false
	self.Debuffs.num = 11
	self.Debuffs.spacing = 2
	if unit ~= 'target' then
		self.Debuffs:Hide()
	end

--[[ combo points ]]--
	if unit=='target' then
	-- combo point code from oUF_Caellian, hope he doesn't mind if I use them. Credit here & on layout page 

changelog.
		self.CPoints = {}
		self.CPoints.unit = 'player'
		self.CPoints[1] = self.Health:CreateTexture(nil, 'OVERLAY')
		self.CPoints[1]:SetHeight(10)
		self.CPoints[1]:SetWidth(10)
		self.CPoints[1]:SetPoint('BOTTOMRIGHT', self, 0, -18)
		self.CPoints[1]:SetTexture(comboTex)

		self.CPoints[2] = self.Health:CreateTexture(nil, 'OVERLAY')
		self.CPoints[2]:SetHeight(10)
		self.CPoints[2]:SetWidth(10)
		self.CPoints[2]:SetPoint('RIGHT', self.CPoints[1], 'LEFT', 1)
		self.CPoints[2]:SetTexture(comboTex)

		self.CPoints[3] = self.Health:CreateTexture(nil, 'OVERLAY')
		self.CPoints[3]:SetHeight(10)
		self.CPoints[3]:SetWidth(10)
		self.CPoints[3]:SetPoint('RIGHT', self.CPoints[2], 'LEFT', 1)
		self.CPoints[3]:SetTexture(comboTex)

		self.CPoints[4] = self.Health:CreateTexture(nil, 'OVERLAY')
		self.CPoints[4]:SetHeight(10)
		self.CPoints[4]:SetWidth(10)
		self.CPoints[4]:SetPoint('RIGHT', self.CPoints[3], 'LEFT', 1)
		self.CPoints[4]:SetTexture(comboTex)

		self.CPoints[5] = self.Health:CreateTexture(nil, 'OVERLAY')
		self.CPoints[5]:SetHeight(10)
		self.CPoints[5]:SetWidth(10)
		self.CPoints[5]:SetPoint('RIGHT', self.CPoints[4], 'LEFT', 1)
		self.CPoints[5]:SetTexture(comboTex)
end

--[[ frame size ]]--
	if unit=='player' or unit=='target' then
	    self:SetAttribute('initial-height', 20)
	    self:SetAttribute('initial-width', 250)
	end
	
	if unit=='focus' or unit=='pet' or unit=='targettarget' then
	    self:SetAttribute('initial-height', 12)
	    self:SetAttribute('initial-width', 100)
	end

--[[ end of layout ]]--
	self.PostCreateAuraIcon = auraIcon
	
	return self
	end

--[[ style settings ]]--
      oUF:RegisterStyle('zp', layout)
      oUF:SetActiveStyle('zp')

--[[ frame spawns ]]--
	oUF:Spawn('player'):SetPoint('CENTER', -200, -300)
	oUF:Spawn('target'):SetPoint('CENTER', 200, -300)
	oUF:Spawn('pet'):SetPoint('BOTTOMLEFT', oUF.units.player, 0, -35)
	oUF:Spawn('targettarget'):SetPoint('TOPRIGHT', oUF.units.target, 0, 30)
	oUF:Spawn('focus'):SetPoint('TOPLEFT', oUF.units.player, 0, 30)
 
01-18-09, 12:11 PM   #523
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Code:
self:Tag(unitnames, '[raidcolor][name]|r [difficulty][smartlevel]|r [classification]' or '[name]')
 
01-18-09, 12:16 PM   #524
Soulcleaver
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 65
Originally Posted by p3lim View Post
Code:
self:Tag(unitnames, '[raidcolor][name]|r [difficulty][smartlevel]|r [classification]' or '[name]')
ty m8 for helping but, on my code when i insert it i get white lvl, white elite(thats what i want) and i get when i target a boss i get "name: boss boss" so i get boss 2 times :/
 
01-18-09, 12:21 PM   #525
Bruners
A Flamescale Wyrmkin
 
Bruners's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 125
Originally Posted by Soulcleaver View Post
ty m8 for helping but, on my code when i insert it i get white lvl, white elite(thats what i want) and i get when i target a boss i get "name: boss boss" so i get boss 2 times :/
again look at ouf/elements/tags.lua, if you did the first time you would see that [smartlevel] does about the same as [classification]

Code:
["[smartlevel]"]  = function(u) return UnitClassification(u) == "worldboss" and "Boss" or tags["[level]"](u).. tags["[plus]"](u) end,
 
01-18-09, 12:22 PM   #526
Soulcleaver
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 65
Originally Posted by Bruners View Post
again look at ouf/elements/tags.lua, if you did the first time you would see that [smartlevel] does about the same as [classification]

Code:
["[smartlevel]"]  = function(u) return UnitClassification(u) == "worldboss" and "Boss" or tags["[level]"](u).. tags["[plus]"](u) end,

then how am i supose to get the level to be colored by the difficulty?:/ and maybe someone can answere on how i can move the lvevel/elite to where i want it on the pic i posted 2posts up or 3..?
 
01-18-09, 12:25 PM   #527
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Soulcleaver View Post
then how am i supose to get the level to be colored by the difficulty?:/ and maybe someone can answere on how i can move the lvevel/elite to where i want it on the pic i posted 2posts up or 3..?
[difficulty][level]|r

dont use smartlevel, as it merges level and classification (ish)

if you want to move the elite and level tag, make a new fontstring and register tags to it.
 
01-18-09, 12:33 PM   #528
Soulcleaver
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 65
Originally Posted by p3lim View Post
[difficulty][level]|r

dont use smartlevel, as it merges level and classification (ish)

if you want to move the elite and level tag, make a new fontstring and register tags to it.
hm sorry to be an ass in the but-.- but how do i create that:P?
 
01-18-09, 12:33 PM   #529
Bruners
A Flamescale Wyrmkin
 
Bruners's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 125
You remove [smartlevel] and replace it with [level] [pluss] [classification]

to move it you will have to make a new text string with the correct position

Code:
local levels = self.Power:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallRight')
levels:SetPoint("RIGHT", self.power, "RIGHT")
self:Tag(levels, "[difficulty][level]|r[classification]")
 
01-18-09, 12:34 PM   #530
Alkar
A Chromatic Dragonspawn
 
Alkar's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 195
Ok guess im gonna need some help again i spawn my party frames with the template but i want them to hide when in a raid and this is the code i used:

Code:
if(GetNumRaidMembers() > 5) then
  party:Hide()
else
  party:Show()
end
'

Seems to be giving me an error so how else would i make that work with different code?
But i dont have raid frames made in my oUF layout i use grid still until i can get a very very good replacement for it ..
__________________

Last edited by Alkar : 01-18-09 at 12:37 PM.
 
01-18-09, 01:04 PM   #531
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Alkar View Post
Ok guess im gonna need some help again i spawn my party frames with the template but i want them to hide when in a raid and this is the code i used:

Code:
if(GetNumRaidMembers() > 5) then
  party:Hide()
else
  party:Show()
end
'

Seems to be giving me an error so how else would i make that work with different code?
But i dont have raid frames made in my oUF layout i use grid still until i can get a very very good replacement for it ..
You still need to post how you spawn your party var.
 
01-18-09, 01:34 PM   #532
Soulcleaver
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 65
Originally Posted by Bruners View Post
You remove [smartlevel] and replace it with [level] [pluss] [classification]

to move it you will have to make a new text string with the correct position

Code:
local levels = self.Power:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallRight')
levels:SetPoint("RIGHT", self.power, "RIGHT")
self:Tag(levels, "[difficulty][level]|r[classification]")
Allright! ty alot, bruners and p3lim... but now i got 1 problem left still :P the "??" "level" "55" won't get colored to difficulty:/

Code:
--[[ name text ]]--
	local unitnames = self.Health:CreateFontString(nil, 'OVERLAY')
        local levels = self.Power:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallRight')
        levels:SetPoint("BOTTOMRIGHT", self, 0, -20)
        levels:SetFont(LynFont, 12)
	unitnames:SetPoint('LEFT', self, 0, 9)
	unitnames:SetFont(LynFont, 12, "THINOUTLINE")
	unitnames:SetJustifyH'LEFT'
        self:Tag(unitnames, '[raidcolor][name]' or '[name]')
	if unit=='player' or unit=='pet' then
		unitnames:Hide()
	end
	if unit=='target' then
		unitnames:SetPoint('LEFT', self, -1, 19)
                self:Tag(levels, "[difficulty][level]|r[classification]")
	end
	if unit=='targettarget' or unit=='focus' then
		unitnames:SetWidth(95)
		unitnames:SetHeight(18)
		unitnames:SetFont(LynFont, 11, "THINOUTLINE")
		unitnames:SetPoint('LEFT', self, 0, 0)
	end
 
01-18-09, 01:37 PM   #533
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Soulcleaver View Post
Allright! ty alot, bruners and p3lim... but now i got 1 problem left still :P the "??" "level" "55" won't get colored to difficulty:/

Code:
--[[ name text ]]--
	local unitnames = self.Health:CreateFontString(nil, 'OVERLAY')
        local levels = self.Power:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallRight')
        levels:SetPoint("BOTTOMRIGHT", self, 0, -20)
        levels:SetFont(LynFont, 12)
	unitnames:SetPoint('LEFT', self, 0, 9)
	unitnames:SetFont(LynFont, 12, "THINOUTLINE")
	unitnames:SetJustifyH'LEFT'
        self:Tag(unitnames, '[raidcolor][name]' or '[name]')
	if unit=='player' or unit=='pet' then
		unitnames:Hide()
	end
	if unit=='target' then
		unitnames:SetPoint('LEFT', self, -1, 19)
                self:Tag(levels, "[difficulty][level]|r[classification]")
	end
	if unit=='targettarget' or unit=='focus' then
		unitnames:SetWidth(95)
		unitnames:SetHeight(18)
		unitnames:SetFont(LynFont, 11, "THINOUTLINE")
		unitnames:SetPoint('LEFT', self, 0, 0)
	end
Only hostile mobs/players will be colored
 
01-18-09, 01:41 PM   #534
Alkar
A Chromatic Dragonspawn
 
Alkar's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 195
Originally Posted by haste View Post
You still need to post how you spawn your party var.

Code:
local party = oUF:Spawn('header', 'oUF_Party')
party:SetPoint('TOP', UIParent, 'BOTTOM', 0, 100)
party:SetManyAttributes(
	"showParty", true,   
	"showRaid", false,   
	"columnSpacing", 10,   
	"unitsPerColumn", 1,   
	"maxColumns", 4,   
	"columnAnchorPoint", "LEFT",   
	"xOffset", 20   
)
party:SetAttribute("template", "oUF_Party")

if(GetNumPartyMembers() > 5) then
  party:Hide()
else
  party:Show()
end
__________________
 
01-18-09, 01:43 PM   #535
Soulcleaver
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 65
Originally Posted by p3lim View Post
Only hostile mobs/players will be colored
ah.. hehe sorry my bad, ty u guys alot for ur amazing help ill post a screen of my ui when its done^^ Appriciate it^^ this is gonna be a realy leightwight ui^^
 
01-18-09, 01:54 PM   #536
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Alkar View Post
Code:
party:SetAttribute("template", "oUF_Party"
That's incorrect. It will try to set the frame you created as the template. And if you named your template oUF_Party in the XML... well, then you failed to named it something unique like I recommended.

A good practice would always be to use your own layout's name in the global. It prevents possible collisions, and most likely stuff like this .
 
01-18-09, 02:03 PM   #537
Alkar
A Chromatic Dragonspawn
 
Alkar's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 195
Originally Posted by haste View Post
That's incorrect. It will try to set the frame you created as the template. And if you named your template oUF_Party in the XML... well, then you failed to named it something unique like I recommended.

A good practice would always be to use your own layout's name in the global. It prevents possible collisions, and most likely stuff like this .
Ok this is what i have here now:

XML
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/../FrameXML/UI.xsd">
	<Button name="oUF_Moo" inherits="SecureUnitButtonTemplate" hidden="true" virtual="true">
		<Frames>
			<Button name="$parentTarget" inherits="SecureUnitButtonTemplate">
				<Anchors>
					<Anchor point="TOP" relativePoint="TOPLEFT" relativeTo="$parent">
						<Offset>
							<AbsDimension x="60" y="40"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Attributes>
					<Attribute name="unitsuffix" type="string" value="target"/>
					<Attribute name="useparent-unit" type="boolean" value="true"/>
					<Attribute name="type1" type="string" value="target"/>
					<Attribute name="initial-unitWatch" type="boolean" value="true"/>
				</Attributes>
			</Button>
			<Button name="$parentPet" inherits="SecureUnitButtonTemplate">
				<Anchors>
					<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" relativeTo="$parent"/>
				</Anchors>
				<Attributes>
					<Attribute name="unitsuffix" type="string" value="pet"/>
					<Attribute name="useparent-unit" type="boolean" value="true"/>
					<Attribute name="type1" type="string" value="pet"/>
					<Attribute name="initial-unitWatch" type="boolean" value="true"/>
				</Attributes>
			</Button>
		</Frames>
	</Button>
</Ui>
Code:
local party = oUF:Spawn('header', 'oUF_Moo')
party:SetPoint('TOP', UIParent, 'BOTTOM', 0, 100)
party:SetManyAttributes(
	"showParty", true,   
	"showRaid", false,   
	"columnSpacing", 10,   
	"unitsPerColumn", 1,   
	"maxColumns", 4,   
	"columnAnchorPoint", "LEFT",   
	"xOffset", 20   
)
party:SetAttribute("template", "oUF_Moo")

if(GetNumPartyMembers() > 5) then
  party:Hide()
else
  party:Show()
end
Still wrong???
__________________
 
01-18-09, 02:06 PM   #538
Bruners
A Flamescale Wyrmkin
 
Bruners's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 125
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/../FrameXML/UI.xsd">
	<Button name="oUF_Moo" inherits="SecureUnitButtonTemplate" hidden="true" virtual="true">
		<Frames>
			<Button name="$parentTarget" inherits="SecureUnitButtonTemplate">
				<Anchors>
					<Anchor point="TOP" relativePoint="TOPLEFT" relativeTo="$parent">
						<Offset>
							<AbsDimension x="60" y="40"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Attributes>
					<Attribute name="unitsuffix" type="string" value="target"/>
					<Attribute name="useparent-unit" type="boolean" value="true"/>
					<Attribute name="type1" type="string" value="target"/>
					<Attribute name="initial-unitWatch" type="boolean" value="true"/>
				</Attributes>
			</Button>
			<Button name="$parentPet" inherits="SecureUnitButtonTemplate">
				<Anchors>
					<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" relativeTo="$parent"/>
				</Anchors>
				<Attributes>
					<Attribute name="unitsuffix" type="string" value="pet"/>
					<Attribute name="useparent-unit" type="boolean" value="true"/>
					<Attribute name="type1" type="string" value="pet"/>
					<Attribute name="initial-unitWatch" type="boolean" value="true"/>
				</Attributes>
			</Button>
		</Frames>
	</Button>
</Ui>
Code:
local party = oUF:Spawn('header', 'oUF_Party')
party:SetPoint('TOP', UIParent, 'BOTTOM', 0, 100)
party:SetManyAttributes(
	"showParty", true,   
	"showRaid", false,   
	"columnSpacing", 10,   
	"unitsPerColumn", 1,   
	"maxColumns", 4,   
	"columnAnchorPoint", "LEFT",   
	"xOffset", 20,
	"template", "oUF_Moo"
)

if(GetNumPartyMembers() > 5) then
  party:Hide()
else
  party:Show()
end
 
01-18-09, 02:09 PM   #539
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Alkar View Post
Ok this is what i have here now:

XML
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/../FrameXML/UI.xsd">
	<Button name="oUF_Moo" inherits="SecureUnitButtonTemplate" hidden="true" virtual="true">
		<Frames>
			<Button name="$parentTarget" inherits="SecureUnitButtonTemplate">
				<Anchors>
					<Anchor point="TOP" relativePoint="TOPLEFT" relativeTo="$parent">
						<Offset>
							<AbsDimension x="60" y="40"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Attributes>
					<Attribute name="unitsuffix" type="string" value="target"/>
					<Attribute name="useparent-unit" type="boolean" value="true"/>
					<Attribute name="type1" type="string" value="target"/>
					<Attribute name="initial-unitWatch" type="boolean" value="true"/>
				</Attributes>
			</Button>
			<Button name="$parentPet" inherits="SecureUnitButtonTemplate">
				<Anchors>
					<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" relativeTo="$parent"/>
				</Anchors>
				<Attributes>
					<Attribute name="unitsuffix" type="string" value="pet"/>
					<Attribute name="useparent-unit" type="boolean" value="true"/>
					<Attribute name="type1" type="string" value="pet"/>
					<Attribute name="initial-unitWatch" type="boolean" value="true"/>
				</Attributes>
			</Button>
		</Frames>
	</Button>
</Ui>
Code:
local party = oUF:Spawn('header', 'oUF_Moo')
party:SetPoint('TOP', UIParent, 'BOTTOM', 0, 100)
party:SetManyAttributes(
	"showParty", true,   
	"showRaid", false,   
	"columnSpacing", 10,   
	"unitsPerColumn", 1,   
	"maxColumns", 4,   
	"columnAnchorPoint", "LEFT",   
	"xOffset", 20   
)
party:SetAttribute("template", "oUF_Moo")

if(GetNumPartyMembers() > 5) then
  party:Hide()
else
  party:Show()
end
Still wrong???
Yes.

oUF:Spawn('header', 'oUF_Moo') - The oUF_Moo here is what global reference the frame should have.
party:SetAttribute("template", "oUF_Moo") - Is what template it should inherit.

Your code just overwrites the template oUF_Moo with the header oUF_Moo. Then it tries to inherit itself onto the frames it spawns.

So do this. In spawn you do 'oUF_<nameofyourlayout>Party', and in the XML you do 'oUF_<nameofyourlayout>PartyTemplate'. In the template attribute you then do 'oUF_<nameofyourlayout>PartyTemplate'.

You can also move the template var into the list in :SetManyAttributes().
 
01-18-09, 02:31 PM   #540
Alkar
A Chromatic Dragonspawn
 
Alkar's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 195
Haste thank u soo much for ur help this has been a huge learning exp for me and i finaly got all this stuff working.. Bruners thank u also u have been a huge help here also P3Lim always a big help here to thank all of u guys so much it has all come into the light for me


thank u guys
__________________
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF - Layout discussion


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