Thread Tools Display Modes
02-06-09, 11:55 AM   #641
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
Originally Posted by Caellian View Post
Kinda true yeah
But then hmm... how ?
Hmm i think i got it to work but i'm not sure if it's right
Start by enlarging the amount of visible header frame, 5 pixels of border/padding spacing should provide sufficient amount space to mouse grab.

Also possiblly create a master frame for the raid, and as you spawn each group, parent it to the master frame.



Anyone who wants totemtimers a bit more customised, i found that this piece of code works great :

Code:
local playerClass = _,UnitClass("player")
if playerClass == "SHAMAN" then
	TotemFrame:ClearAllPoints()
	TotemFrame:SetPoint("BOTTOM",self,"TOP",0,0)
	TotemFrame:SetParent(self)
	TotemFrame:Show()

	for i=1,TotemFrame:GetNumChildren() do

		local totem = _G["TotemFrameTotem"..i]
		_G["TotemFrameTotem"..i.."Background"]:Hide()
		local totemIcon = _G["TotemFrameTotem"..i.."Icon"]
		local totemDuration = _G["TotemFrameTotem"..i.."Duration"]
		local _,oldTotemOverlay = totem:GetChildren()
		oldTotemOverlay:Hide()
		
		totemDuration:SetParent(TotemFrame)
		totemDuration:ClearAllPoints()
		totemDuration:SetFont(font, '11', "OUTLINE")
		totemDuration:SetPoint("BOTTOM",totemIcon,"TOP",0,2)
		local totemOverlay = totemIcon:CreateTexture(nil, "OVERLAY")
			  totemOverlay:SetTexture("Interface\\Addons\\<<YOURLAYOUTNAME>>\\<<NAMEOFYOURBORDERTEXTUREFILE>>")
			  totemOverlay:SetAllPoints(totemIcon)
			  totemOverlay:SetTexCoord(0, 1, 0, 1)
			  totemOverlay.Hide = function(self) self:SetVertexColor(0.25, 0.25, 0.25) end
		totem.overlay = totemOverlay

		totem:SetScale(1.4)
	end
end

Last edited by jadakren : 02-06-09 at 12:22 PM.
 
02-06-09, 12:04 PM   #642
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Allright, the code i have posted above works for party perfectly.
With raids, it moves group by group, i didn't manage to have it move the entire raid at once. is it possible and if so, how ?
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 02-06-09 at 01:13 PM.
 
02-06-09, 12:58 PM   #643
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
I've also started creating my own options interface using libSimpleOptions.
Only thing lacking from libSimpleOptions is a text entry field, but I can probably get round.

Anyway, here is a simple example of the oUF_Options.lua : http://pastey.net/107808, oUF_Options.toc : http://pastey.net/107807

Here is my layout that shows how i'm using the options setup : http://pastey.net/107811

I have my tags in another addon so that oUF_Freebgrid can access those same tags.
Keep in mind my real oUF_Options has alot more included positioning for each frame, tick boxes for things like "powerBar.classColors=true" etc.

Last edited by jadakren : 02-06-09 at 01:23 PM.
 
02-06-09, 01:09 PM   #644
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
Anyone have a clue for the problem in my previous post ?
 
02-06-09, 01:38 PM   #645
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Aight well think i'll have to give up on the whole move stuff thing, it's just fine when it's single frames like player, target and so on but as soon as it's party (with targets and pets) or raid it become really messy.

Here's my code:
Code:
	if(not unit) then
		self:SetMovable(true)
		self:RegisterForDrag("LeftButton")

		self:SetScript("OnDragStart", function(self)
			if (IsShiftKeyDown()) then
				self:ClearAllPoints()
				self:StartMoving()
			end
		end)

		self:SetScript("OnDragStop", function(self)
			self:StopMovingOrSizing()
		end)
	end
1. For the party, it works, but i can't get the partypets and partytargets to follow the party frames, parenting didn't seems to help.

2. For the raid, it works but group by group, not for the entire raid at once. Also whenever there is a raid update, the raid goes back to its initial position.

If anyone know how to fix those issue it would be really nice, else i don't think i'll go past the single frames
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-06-09, 02:40 PM   #646
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Your frames need to be anchored to each other using :SetPoint(), or else they wont move as they are anchored to UIParent.
 
02-06-09, 02:57 PM   #647
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by Slakah View Post
Your frames need to be anchored to each other using :SetPoint(), or else they wont move as they are anchored to UIParent.
They are anchored unless i don't understand it right

Party to UIParent
Code:
local party = oUF:Spawn('header', 'oUF_Party')
party:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', 15, -15)
party:SetManyAttributes('yOffset', -20, 'showParty', true)
Party Targets to Party
Code:
local partytarget = {}
partytarget[1] = oUF:Spawn("party1target", "oUF_Party1Target")
partytarget[1]:SetPoint('TOPLEFT', party, 'TOPRIGHT', 5, 0)
for i =2, 4 do
	partytarget[i] = oUF:Spawn("party"..i.."target", "oUF_Party"..i.."Target")
	partytarget[i]:SetPoint("TOP", partytarget[i-1], "BOTTOM", 0, -20)
end
Party Pets to Party
Code:
local partypet = {}
partypet[1] = oUF:Spawn('partypet1', 'oUF_PartyPet1')
partypet[1]:SetPoint('TOPLEFT', party, 'TOPLEFT', 0, -24.5)
for i =2, 4 do
	partypet[i] = oUF:Spawn('partypet'..i, 'oUF_PartyPet'..i)
	partypet[i]:SetPoint('TOP', partypet[i-1], 'BOTTOM', 0, -32)
end
Yet when i move the party, the partypets and partytargets stays up there in their corner. And there's only an issue with those because my pet focus are correctly following the player frame, and my focustarget targetoftarget are correctly following the target frame.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 02-06-09 at 03:04 PM.
 
02-06-09, 08:46 PM   #648
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
I'm trying to add pvp icons to oUF_Lyn layout. Here's what I have so far - works for the player frame. How do I have it also apply to all other frames?

Code:
local pvp = self.Health:CreateTexture(nil, "OVERLAY")
pvp:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT", 18, -20)
pvp:SetHeight(28)
pvp:SetWidth(28)
self.PvP = pvp
Thanks.
 
02-07-09, 08:51 AM   #649
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
@Caellian: Just spawn the party pets/targets through the XML template and save yourself all the headaches ?

@Toran: It should work on all units without any additional code. My guess is that you have added the piece of code in a block which is restricted to the player unit or so.
 
02-07-09, 01:40 PM   #650
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
Just keeping waiting for some help because I really don't know what the problem is with the xml template haste talk about.
I have a problem with anchoring and sizing the partypet frames :
Putting whatever number in the AbsDimension doesn't seem to do anything and can we change the size of the partypet frame even if it inherits the size of the party frame ?

Thanks !
 
02-07-09, 01:47 PM   #651
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,711
Originally Posted by Rostok View Post
Just keeping waiting for some help because I really don't know what the problem is with the xml template haste talk about.
I have a problem with anchoring and sizing the partypet frames :
Putting whatever number in the AbsDimension doesn't seem to do anything and can we change the size of the partypet frame even if it inherits the size of the party frame ?

Thanks !
Code:
if(GetAttribute('unitsuffix') == 'target') then
     self.SetScale(1.2)
end
 
02-07-09, 05:49 PM   #652
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Originally Posted by haste View Post
@Toran: It should work on all units without any additional code. My guess is that you have added the piece of code in a block which is restricted to the player unit or so.
Yes, I have it in the player unit - how would I modify that code to work on all units? I have "self" in the code a few times, so would that be replaced with something more universal? Or would I replace the code elsewhere?
 
02-08-09, 04:27 AM   #653
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by haste View Post
@Caellian: Just spawn the party pets/targets through the XML template and save yourself all the headaches ?
Ok then, let's go with Tags, after all it's time to change

So far so good, everything's fine, shortening names with custom tags depending on frame size was what scared me the most but in the end it was the easiest.

There are just one or two things i need your lights on:

Code:
self:Tag(self.Info, '[shortlarge] [difficulty][smartlevel]')
First question: (shortlarge is a custom tag), my issue is with difficulty and smartlevel, i want them to use my own colouring function
Code:
local function GetDifficultyColor(level)
	if level == '??' then
		return  .69,.31,.31
	else
	local levelDiff = UnitLevel('target') - UnitLevel('player')
		if levelDiff >= 5 then
			return .69,.31,.31
		elseif levelDiff >= 3 then
			return .71,.43,.27
		elseif levelDiff >= -2 then
			return .84,.75,.65
		elseif -levelDiff <= GetQuestGreenRange() then
			return .33,.59,.33
		else
			return  .55,.57,.61
		end
	end
end
How do i do that please ?

Second question: In my updateName function i had this part
Code:
	elseif (unit == 'pet' and uName == 'Unknown') then
		self.Name:SetText('Pet')
How do i write the tag for this, if it's still necesary with tags ?

Third and last question: to have my highlight texture to work with my healthbar i had to do this:
Code:
self.Health:SetFrameLevel(unit and 1 or 2)
And here's the highlight texture code:
Code:
	self.Highlight = self:CreateTexture(nil, 'HIGHLIGHT')
	self.Highlight:SetAllPoints(self.Health)
	self.Highlight:SetBlendMode('ADD')
	self.Highlight:SetTexture(highlightTex)
	if(self:GetParent():GetName():match'oUF_Raid') then
		self.Highlight:SetTexture(highlightTexV)
	end
Now since i moved my partytargets and partypets to .xml, if i leave the line above, my partytargets/partypets healthbar is all back. If i remove that line the frames are fine but i can't see the mouseover highlight anymore.

How could i fix that ?
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 02-08-09 at 05:15 AM.
 
02-08-09, 06:13 AM   #654
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
1:
Code:
Lua 5.1.3  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> r, g, b = 1, .5, .75
> return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
|cffff7fbf
2: I don't see why you would need that at all. UNIT_UPDATE_NAME should fire when the client gets the name information and the string should update.

3: You will probably have to use 3 as the level on the pets and targets as they are children of the party frame.

I don't really see why you would _have_ to convert over to tags to use the XML template tho'. The only change is that you have to check the unitsuffix for information instead of the unit.
 
02-08-09, 06:22 AM   #655
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Toran View Post
Yes, I have it in the player unit - how would I modify that code to work on all units? I have "self" in the code a few times, so would that be replaced with something more universal? Or would I replace the code elsewhere?
You don't understand. self.PvP _is_ universal. I don't know how the rest of your code looks like, and I don't plan on playing the guessing game when it comes to suggestions.
 
02-08-09, 06:25 AM   #656
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by haste View Post
I don't really see why you would _have_ to convert over to tags to use the XML template tho'. The only change is that you have to check the unitsuffix for information instead of the unit.
Because of an error i had with my updateName

it was working fine but whenever i was trying to switch to .xml i had something about this
Code:
	local uName = UnitName(unit)
saying, usage is UnitName("unit") instead, can't tell exactly.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 02-08-09 at 06:32 AM.
 
02-08-09, 06:27 AM   #657
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by haste View Post
You don't understand. self.PvP _is_ universal. I don't know how the rest of your code looks like, and I don't plan on playing the guessing game when it comes to suggestions.
@Rostok
I can missunderstand but my guess would be that you have to place it elsewhere than below a if(unit == 'player')
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-08-09, 06:30 AM   #658
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Caellian View Post
Because of an error i had with my updateName

it was working fine but whenever i was trying to switch to .xml i had something about this
Code:
	local uName = UnitName(unit)
saying, usage is UnitName("unit") instead, can't tell exactly.
When do you execute it?
 
02-08-09, 06:33 AM   #659
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by haste View Post
When do you execute it?
Ghaa i hate to post walls of text, well here's what was my updateName, i don't need it anymore though, if i can fix the highlight stuff to work, everything will be fixed

Code:
local function OverrideUpdateName(self, event, unit)
	if(self.unit ~= unit or not self.Name) then return end

	local uName = UnitName(unit)
	if(unit == 'player') then
		self.Name:Hide()
	elseif(unit == 'target') then
		local level = not UnitIsConnected(unit) and '??' or UnitLevel(unit) < 1 and '??' or UnitLevel(unit)
		local r, g, b = GetDifficultyColor(level)
		if(uName:utf8len() > 18) then
			self.Name:SetFormattedText(classification[UnitClassification(unit)], uName:utf8sub(1, 18)..'...', r*255,g*255,b*255, level)
		else
			self.Name:SetFormattedText(classification[UnitClassification(unit)], uName, r*255,g*255,b*255, level)
		end
	elseif (unit == 'pet' and uName == 'Unknown') then
		self.Name:SetText('Pet')
	elseif(self:GetParent():GetName():match'oUF_Raid') then
		self.Name:SetFormattedText(uName:utf8sub(1, 5))
	else
		if(uName:utf8len() > 12) then
			self.Name:SetFormattedText(uName:utf8sub(1, 12)..'...')
		else
			self.Name:SetText(uName)
		end
	end
	UpdateColor(self.Name, unit, 'SetTextColor')
end


Oh and (1 or 3) helps a bit, the highlight works on almost all the frames now, just not the party
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-08-09, 06:42 AM   #660
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You can't use 1 or 3. You have to use them all :p.
1 - Frames anchored to the UIParent directly (ie. player, target, focus, etc - anything spawned as a single unit).
2 - Frames anchored to a header frame (ie. raid, party).
3 - Frames anchored to a frame on a header frame (ie. partypet/target).

Also, your wall of text doesn't answer my question :D. I wanted to know where it's called, not how it looks :p.
 

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