Thread Tools Display Modes
02-08-09, 06:49 AM   #661
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by haste View Post
Also, your wall of text doesn't answer my question . I wanted to know where it's called, not how it looks .
I'm not sure what you mean with "where it's called
this ? as for where, it's below health and power settings.

Code:
	self.Name = SetFontString(self.Health, font,(unit == 'player' or unit == 'target') and 11 or 9)
	if(self:GetParent():GetName():match'oUF_Raid') then
		self.Name:SetPoint('TOP')
	else
		self.Name:SetPoint('LEFT', 1, 1)
	end
Originally Posted by haste View Post
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
What exactly did you mean with this ?

Other than that, everything's fine now
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-08-09, 06:56 AM   #662
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
1: That's where it is created . oUF doesn't have any ":OverrideNameUpdate()", so I don't know how it ends up executing (ie. calling) your function. All I know is that it most likely happens at a point it shouldn't be doing it.

2: Just replace your returns with that, or the static strings for the color. The latter would be the best solution tho'.

codepad is a nice page if you don't have a Lua interpreter on your computer.
 
02-08-09, 07:40 AM   #663
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by haste
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).
Might sound like a noob question (or actually it is)
How exactly do you write this self.Health:SetFrameLevel(unit and 1 or 3) then ?

Originally Posted by haste
2: Just replace your returns with that, or the static strings for the color. The latter would be the best solution tho'.
I've updated my GetDifficultyColor function in the layout but how do i have to change the following so it uses it instead on the default [difficulty]
Code:
self:Tag(self.Info, '[shortlarge] [difficulty][smartlevel] [rare]')
And, that's it i guess
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-08-09, 07:48 AM   #664
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
1: This is probably the easiest way to do it:
Code:
if(unit) then
     :SetFrameLevel(1)
elseif(self:GetAttribute'unitsuffix') then
     :SetFrameLevel(3)
elseif(not unit) then
     :SetFrameLevel(2)
end
2: http://ixo.no/git/oUF_Classic.git/tree/classic.lua#n29.
 
02-08-09, 08:30 AM   #665
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by haste View Post
Just replace your returns with that, or the static strings for the color. The latter would be the best solution tho'.
Aight, thanks a lot haste, btw here's how the tag looks

Code:
oUF.Tags['[leveldiff]']  = function(u) local leveldiff = UnitLevel('unit')
	if level == '??' then
		r, g, b = .69,.31,.31
		return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
	else
	local levelDiff = UnitLevel('target') - UnitLevel('player')
		if levelDiff >= 5 then
			r, g, b = .69,.31,.31
			return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
		elseif levelDiff >= 3 then
			r, g, b = .71,.43,.27
			return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
		elseif levelDiff >= -2 then
			r, g, b = .84,.75,.65
			return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
		elseif -levelDiff <= GetQuestGreenRange() then
			r, g, b = .33,.59,.33
			return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
		else
			r, g, b = .55,.57,.61
			return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
		end
	end
	oUF.TagEvents['[leveldiff]'] = 'UNIT_LEVEL'
end
But you said it would be better if i used the static string for the color, do you mean the html color code like this '|cffD7BEA5|r' ?
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-08-09, 08:34 AM   #666
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Without the |r part. You also have r, g and b as globals in your tag .

You also do: local leveldiff = UnitLevel('unit') instead of UnitLevel(unit), another thing is that it is hardcoded to player only.
 
02-08-09, 08:42 AM   #667
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Nevermind, thanks and fixed

While you're around, maybe you can answer to this aswell. (note to self: do not abuse of haste)

It's been forever now since i had to use the UTF8 lib to fix an issue.

when i'm in a party/raid where there's a player with any special character in his name, it's replaced with a ?

Why, fixable ? (without the use of that HUGE lib)
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-08-09, 09:04 AM   #668
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
It's fixable, in exactly the same way as the utf-8 lib handles :sub(). The reason the library is "HUGE" is because it has the tables for converting utf-8 characters between upper- and lowercase.

The reason that your seeing a ? is simple however. All the string functions are byte based. This means that multi-byte characters such as 東京 are seen by Lua as more than two characters:
Code:
('東京'):len() -- returns: 6, instead of 2
If we look under the hood, the string consists of:
Code:
('東京'):byte(1, 6) -- returns: 230,     157,     177,     228,     186,     172
Now, when you run :sub() on a multi-byte string - you end up with chopping off some valuable information:
Code:
> return ('東京'):sub(1, 5)
東�
> return ('東京'):sub(1, 4)
東�
> return ('東京'):sub(1, 3)
東
In the two first subs we end up with invalid characters, and WoWs default behavior is to display these as a ?, unless the font actually can render them that is.

This is valid for all characters outside the ASCII scope.

You have a couple solution to solve this ofc:
a) use the utf-8 lib.
b) strip out the sub function from the utf-8 lib and use only that.
c) set a width on the strings and let the internal font string code handle it.
d) ignore the issue.
 
02-08-09, 09:11 AM   #669
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
I'll take either c or d, most likely c then, thanks a lot, again !
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-08-09, 10:13 AM   #670
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Hmm i can't figure out why the world bosses like Thrall '??' level appear in gray instead of red even though ?? is set to red.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-08-09, 10:34 AM   #671
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Some code would probably be useful :).
 
02-08-09, 10:38 AM   #672
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by haste View Post
Some code would probably be useful .
He posted it a bit earlier


Originally Posted by Caellian View Post
Aight, thanks a lot haste, btw here's how the tag looks

Code:
oUF.Tags['[leveldiff]']  = function(u) local leveldiff = UnitLevel('unit')
	if level == '??' then
		r, g, b = .69,.31,.31
		return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
	else
	local levelDiff = UnitLevel('target') - UnitLevel('player')
		if levelDiff >= 5 then
			r, g, b = .69,.31,.31
			return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
		elseif levelDiff >= 3 then
			r, g, b = .71,.43,.27
			return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
		elseif levelDiff >= -2 then
			r, g, b = .84,.75,.65
			return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
		elseif -levelDiff <= GetQuestGreenRange() then
			r, g, b = .33,.59,.33
			return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
		else
			r, g, b = .55,.57,.61
			return string.format('|cff%02x%02x%02x', r*255, g*255, b*255)
		end
	end
	oUF.TagEvents['[leveldiff]'] = 'UNIT_LEVEL'
end
But you said it would be better if i used the static string for the color, do you mean the html color code like this '|cffD7BEA5|r' ?
 
02-08-09, 10:39 AM   #673
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Same as above, didn't want to repost the same, i've tried different ways, all leads to the same result, ?? is grey (.55, .57, .61)

I was trying to fix this before replacing with the html codes.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-08-09, 10:41 AM   #674
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
well, level isn't the same variable as leveldiff.
 
02-08-09, 10:44 AM   #675
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by haste View Post
well, level isn't the same variable as leveldiff.
I know, replacing it with leveldiff was one of the thing i've tried, still grey.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 02-08-09 at 10:47 AM.
 
02-08-09, 11:21 AM   #676
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Pastey your code, or anything.
 
02-08-09, 11:26 AM   #677
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by haste View Post
Pastey your code, or anything.
http://www.pastey.net/107923
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
02-08-09, 01:24 PM   #678
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
UnitLevel never returns a string, only numbers.
For a unit that the level is unknown UnitLevel returns -1

oUF's tags does handle this and returns the ?? instead of -1 value.

Here is a diff file:
http://www.pastey.net/107929-4ak8:107923-32wz
 
02-08-09, 01:42 PM   #679
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Originally Posted by Caellian View Post
@Rostok
I can missunderstand but my guess would be that you have to place it elsewhere than below a if(unit == 'player')
Thank you Caellian, for the push in the right direction. I lifted the code out of the (unit == 'player') section and it applies to all now.

I am modifying oUF_Lyn and am surprised to see other icons in that same section including resting icon, leader icon, and raid target icons. Does that mean I need to pull all of them out of that section also? Odd that Lyn would have put these icons in the (unit == 'player') section if that makes them only show in the player frame.
 
02-08-09, 02:22 PM   #680
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by p3lim View Post
UnitLevel never returns a string, only numbers.
For a unit that the level is unknown UnitLevel returns -1

oUF's tags does handle this and returns the ?? instead of -1 value.

Here is a diff file:
http://www.pastey.net/107929-4ak8:107923-32wz
how can i not think about that, scratching my head for hours, thanks a lot p3lim

Originally Posted by Toran View Post
Thank you Caellian, for the push in the right direction. I lifted the code out of the (unit == 'player') section and it applies to all now.

I am modifying oUF_Lyn and am surprised to see other icons in that same section including resting icon, leader icon, and raid target icons. Does that mean I need to pull all of them out of that section also? Odd that Lyn would have put these icons in the (unit == 'player') section if that makes them only show in the player frame.
Well, resting icon will only apply to the player anyway.
Leader and raid target it's a matter of 'taste' i guess, i myself don't display the raidleader/masterlooter on smaller frames like focus and target for example, i only show them on myself, party and raid.
I can be mistaken but i think there are even some icons that have their own unit restriction build in oUF itself.
__________________
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