Thread Tools Display Modes
02-09-09, 06:06 AM   #681
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
Originally Posted by p3lim View Post
Code:
if(GetAttribute('unitsuffix') == 'target') then
     self.SetScale(1.2)
end
Thanks p3lim, but i don't know where i must put that code.
And is it possible to set an attribute with this ?
 
02-09-09, 08:03 AM   #682
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by Rostok View Post
Thanks p3lim, but i don't know where i must put that code.
And is it possible to set an attribute with this ?
About anywhere in your style function, in my case it's the last thing i do in that function.

See for example i have this

Code:
	elseif(self:GetAttribute('unitsuffix') == 'pet') then
		self:SetAttribute('initial-height', 10)
		self:SetAttribute('initial-width', 109.5)


Now a question, a stupid one, i can't figure out the syntax for this, must have had a brainwash or something.
I've mentioned it before and even though it shouldn't happen, it does to me, when i login sometime or when i zone in a battleground often.
How do i get my stoopid pet renamed to Pet instead of Unknown ?

Code:
oUF.Tags['[shortmedium]']  = function(unit)
	local name = UnitName(unit)
	if(unit == 'pet' and name == 'Unknown') then
		return name == 'Pet'
	elseif (name:len() > 12) then
		return (name:sub(1, 12)..'...')
	else
		return name
	end
end
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-09-09, 08:31 AM   #683
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Caellian View Post
Now a question, a stupid one, i can't figure out the syntax for this, must have had a brainwash or something.
I've mentioned it before and even though it shouldn't happen, it does to me, when i login sometime or when i zone in a battleground often.
How do i get my stoopid pet renamed to Pet instead of Unknown ?

Code:
oUF.Tags['[shortmedium]']  = function(unit)
	local name = UnitName(unit)
	if(unit == 'pet' and name == 'Unknown') then
		return name == 'Pet'
	elseif (name:len() > 12) then
		return (name:sub(1, 12)..'...')
	else
		return name
	end
end
Code:
if(unit == 'pet' and name == 'Unknown') then
	return 'Pet'
 
02-09-09, 08:35 AM   #684
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by p3lim View Post
Code:
if(unit == 'pet' and name == 'Unknown') then
	return 'Pet'
Whaaa, i've tried everything, from SetText to gsub (trying to replace a pattern), and it was that simple, i knew it would be a stupid question
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-09-09, 03:35 PM   #685
Hannes
A Murloc Raider
Join Date: May 2007
Posts: 7
Hello, I got a question,
I'd like to make my target's health go from right to left (like right = 0% HP, left = 100% HP), while my player's healthbar stays from left to right. How can I do this with oUF?
I'm sorry if this has been asked before, but I searched and looked a bit around and couldn't find anything.

Thanks in advance!
 
02-09-09, 03:39 PM   #686
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You will have to implement a custom statusbar in the layout, and just feed that to oUF.
 
02-09-09, 04:33 PM   #687
Hannes
A Murloc Raider
Join Date: May 2007
Posts: 7
Okay.. But what's the code needed then to make oUF aware of the "mirrored" unit frame?
 
02-10-09, 02:47 AM   #688
Bruners
A Flamescale Wyrmkin
 
Bruners's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 125
Originally Posted by Caellian View Post
Still in progress with tags, i've recieved an error.

I'm replacing my updateColor function with this

Hex function
...

Code:
oUF.Tags['[colorinfo]'] = function(u)
	local _, class = UnitClass(unit)

	if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
		return Hex(colors.tapped)
	elseif(UnitIsDead(unit) or UnitIsGhost(unit) or not UnitIsConnected(unit)) then
		return Hex(colors.disconnected)
	elseif(unit == 'pet' and GetPetHappiness()) then
		return Hex(colors.happiness[GetPetHappiness()])
	elseif(UnitIsPlayer(unit)) then
		return Hex(colors.class[class])
	else
		return Hex(FACTION_BAR_COLORS[UnitReaction(unit, 'player')])
	end
end
the first line to color name by class local _, class = UnitClass(unit) gives me an error:
Code:
Interface\AddOns\oUF_Caellian\oUF_cMain.lua:91: Usage: UnitClass("unit")
It was working just fine with the old way, what's wrong putting it in a tag ?

try with changing your oUF.Tags['[colorinfo]'] = function(u) to function(unit)
 
02-10-09, 05:44 AM   #689
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Hannes View Post
Okay.. But what's the code needed then to make oUF aware of the "mirrored" unit frame?
oUF doesn't validate that you feed it a StatusBar, but it expect the frame to have the following methods:
- :GetParent()
- :SetMinMaxValues()
- :SetValue()
- :SetStatusBarColor()
- :SetScript() - used for setting OnUpdate's only.
 
02-10-09, 07:02 AM   #690
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by Bruners View Post
try with changing your oUF.Tags['[colorinfo]'] = function(u) to function(unit)
Yeah, i almost instantly deleted my message as i found what was wrong, didn't expect someone had seen it so early.

Oh and i messed up with the delete function of the forum, sorry about that.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-10-09, 11:25 AM   #691
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Now this is weird, everything's just fine, but sometimes i get an error, it's "random" as in, it can take an hour of play for it to appear. I can't manage to trigger it manually, weirdest thing is, it says the error is in haste's hex function but ofc that can't be right.

The error:

Code:
Interface\AddOns\oUF_Caellian\oUF_cTags.lua:16: attempt to perform arithmetic on local 'r' (a nil value)
The file:

oUF_cTags.lua Pastey
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-10-09, 11:37 AM   #692
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Take a look at the debug stack and see what function feeds the Hex function a nil value.

Oh hi, edit: My guess is line 25. UnitReaction() can return nil, but so can GetPetHappiness() if I remember correctly.
 
02-10-09, 11:46 AM   #693
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
This is the full error report

Code:
Interface\AddOns\oUF_Caellian\oUF_cTags.lua:16: attempt to perform arithmetic on local 'r' (a nil value)

[C]: ?
Interface\AddOns\oUF_Caellian\oUF_cTags.lua:16: in function <Interface\AddOns\oUF_Caellian\oUF_cTags.lua:12>
(tail call): ?
Interface\AddOns\oUF\elements\tags.lua:269: in function `UpdateTag'
Interface\AddOns\oUF\elements\tags.lua:145: in function `func'
Interface\AddOns\oUF\ouf.lua:452: in function <Interface\AddOns\oUF\ouf.lua:447>
[C]: in function `Show'
Interface\FrameXML\SecureStateDriver.lua:72: in function <Interface\FrameXML\SecureStateDriver.lua:62>
Interface\FrameXML\SecureStateDriver.lua:109: in function <Interface\FrameXML\SecureStateDriver.lua:79>
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-10-09, 11:57 AM   #694
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Well that didn't help much .

I still put my cash on line 25 however.
 
02-10-09, 11:59 AM   #695
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
GetPetHappiness() will return nil if the pet aint a hunter pet
 
02-10-09, 12:03 PM   #696
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
That's checked for however .
 
02-10-09, 12:03 PM   #697
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Hmm how can i prevent this error from showing, or even fix it, and keeping the same tag functionalities, if it's possible ofc.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-10-09, 12:06 PM   #698
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
This change assumes that the table you use have an index for all the returns that UnitReaction() might have.
 
02-10-09, 12:10 PM   #699
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by haste View Post
This change assumes that the table you use have an index for all the returns that UnitReaction() might have.
Ok thanks, dinner time then i try it, biggest problem is to trigger an eventual error, might take a while

Edit: Well, so far after 5-6 AB and 2-3 SotA no more errors, it seems to be working just fine now.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 02-10-09 at 05:02 PM.
 
02-11-09, 05:21 AM   #700
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
There seems to be a problem with the range feature of oUF.

Code:
	if(not unit or unit == 'pet') then
		self.outsideRangeAlpha = .35
		self.inRangeAlpha = 1
		self.Range = true
	end
No matter how i try to write it, or to exclude partytarget and partypet those 2 always seems to inherit the alpha of the party frames.
Is it possible to prevent that from happening ?
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 

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