Quantcast oUF - Layout discussion - Page 10 - WoWInterface
Thread Tools Display Modes
11-01-08, 06:02 AM   #181
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,668
Originally Posted by zork View Post
Is it possible to do 2D portraits?

3D portraits working just fine but it would add another option.

http://zorktdmog.zo.funpic.de/rothui...108_225210.jpg

I love oUF .
If you use a texture frame instead of a Model frame it will create 2D pictures instead of 3D. oUF automatically handles that
 
11-01-08, 04:44 PM   #182
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,720
Thanks p3lim, worked wonderfully.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
 
11-02-08, 11:04 PM   #183
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Hi, i'm having an issue with my name coloring, not like it's really important but i really wonder what's going wrong.

Pre Patch my own pet name was happiness colored, and still is now, but once i was targetting my own pet, or someone else pet it was hostility colored.
Now i can't manage to get that behavior back, i've tried different way but never got it to work.

Here's my current coloring system, could anyone take a quick look please.

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

	local r, g, b, t
	local _, class = UnitClass(unit)

	if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
		t = self.colors.tapped
	elseif(UnitIsDead(unit) or UnitIsGhost(unit) or not UnitIsConnected(unit)) then
		t = self.colors.disconnected
	elseif(unit =='pet' and GetPetHappiness()) then
		t = self.colors.happiness[GetPetHappiness()]
	elseif(UnitIsPlayer(unit)) then
		t = self.colors.class[class]
	elseif(not UnitIsPlayer(unit)) then
		r, g, b = UnitSelectionColor(unit)
	end

	if(t) then
		r, g, b = t[1], t[2], t[3]
	end

	self.Name:SetTextColor(r,g,b)
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
11-03-08, 02:39 AM   #184
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 79
I have a question i think not brought up yet. How would i implement a threat display in my layout? I would like to have a tiny vertical frame on the side of my UF displaying the color of my threatlevel witch blizzard implemented. I see that this is implemented in oUF with threat.lua, but i don't quite understand properly how i would do this.

Any help would be greatly appreciated as i think it would help the majority of oUF users/authors to display threat. Keep up all the good work!

Originally Posted by Caellian View Post
Hi, i'm having an issue with my name coloring, not like it's really important but i really wonder what's going wrong.

Pre Patch my own pet name was happiness colored, and still is now, but once i was targetting my own pet, or someone else pet it was hostility colored.
Now i can't manage to get that behavior back, i've tried different way but never got it to work.

Here's my current coloring system, could anyone take a quick look please.

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

    local r, g, b, t
    local _, class = UnitClass(unit)

    if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
        t = self.colors.tapped
    elseif(UnitIsDead(unit) or UnitIsGhost(unit) or not UnitIsConnected(unit)) then
        t = self.colors.disconnected
    elseif(unit =='pet' and GetPetHappiness()) then
        t = self.colors.happiness[GetPetHappiness()]
    elseif(UnitIsPlayer(unit)) then
        t = self.colors.class[class]
    elseif(not UnitIsPlayer(unit)) then
        r, g, b = UnitSelectionColor(unit)
    end

    if(t) then
        r, g, b = t[1], t[2], t[3]
    end

    self.Name:SetTextColor(r,g,b)
can't you do this in your pet code(?);
Code:
<snip>
if unit == "pet" then
    self.Name.ColorHappiness = true
<snip>
end
I'm in school so i can't try it yet, but imo, it wouldn't hurt to try.. =)
__________________
Being boring is fine too.

Last edited by hipjipp : 11-03-08 at 02:59 AM.
 
11-03-08, 03:33 AM   #185
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,025
Originally Posted by hipjipp View Post
can't you do this in your pet code(?);
Code:
<snip>
if unit == "pet" then
    self.Name.ColorHappiness = true
<snip>
end
I'm in school so i can't try it yet, but imo, it wouldn't hurt to try.. =)
No, only .Power and .Health have such. .Name will also be removed in the next release.
 
11-03-08, 06:15 AM   #186
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by haste View Post
No, only .Power and .Health have such. .Name will also be removed in the next release.
Even if this was possible that wouldn't fix the issue, happiness color isn't a problem, i just can't get the old behavior back, to have pet's name reaction colored when i target them.

My own pet frame: name happiness colored (currently working)
target frame: pet's name reaction colored (green or red)(currently not working)


And as Haste said, don't use "or", but then what, and expecially how ?
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 11-03-08 at 06:18 AM.
 
11-03-08, 10:13 AM   #187
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,668
Originally Posted by Caellian View Post
Hi, i'm having an issue with my name coloring, not like it's really important but i really wonder what's going wrong.

Pre Patch my own pet name was happiness colored, and still is now, but once i was targetting my own pet, or someone else pet it was hostility colored.
Now i can't manage to get that behavior back, i've tried different way but never got it to work.

Here's my current coloring system, could anyone take a quick look please.

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

	local r, g, b, t
	local _, class = UnitClass(unit)

	if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
		t = self.colors.tapped
	elseif(UnitIsDead(unit) or UnitIsGhost(unit) or not UnitIsConnected(unit)) then
		t = self.colors.disconnected
	elseif(unit =='pet' and GetPetHappiness()) then
		t = self.colors.happiness[GetPetHappiness()]
	elseif(UnitIsPlayer(unit)) then
		t = self.colors.class[class]
	elseif(not UnitIsPlayer(unit)) then
		r, g, b = UnitSelectionColor(unit)
	end

	if(t) then
		r, g, b = t[1], t[2], t[3]
	end

	self.Name:SetTextColor(r,g,b)
UnitSelectionColor(unit) returned that rgb value
 
11-03-08, 10:15 AM   #188
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,668
Originally Posted by hipjipp View Post
I have a question i think not brought up yet. How would i implement a threat display in my layout? I would like to have a tiny vertical frame on the side of my UF displaying the color of my threatlevel witch blizzard implemented. I see that this is implemented in oUF with threat.lua, but i don't quite understand properly how i would do this.

Any help would be greatly appreciated as i think it would help the majority of oUF users/authors to display threat. Keep up all the good work!
Make a statusbar frame, size/position as you like, then make it use self.Threat, it'll do the rest of the work.
 
11-03-08, 10:24 AM   #189
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by p3lim View Post
UnitSelectionColor(unit) returned that rgb value
I'm sorry but i don't understand

i can't do
Code:
t = self.colors.happiness[GetPetHappiness()] or UnitSelectionColor(unit)
Like previously with UnitReaction
It doesn't work so what do you mean ?
How do i get a targetted pet to be reacion colored.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
11-03-08, 10:27 AM   #190
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,668
No, thats not what i meant.

The UnitSelectionColor returns diffrent colors than the pre-3.0 function used to return, thats where you get the blue color. (atleast I get a blue color)
 
11-03-08, 10:29 AM   #191
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by p3lim View Post
No, thats not what i meant.

The UnitSelectionColor returns diffrent colors than the pre-3.0 function used to return, thats where you get the blue color. (atleast I get a blue color)
AH !!, so it wasn't me doing something wrong, darn... yes i also get that blue color.

Anyway, i got it working the way i wanted, with the following code, my pet is happiness colored and targetted pets are hostility colored, but i really feel like it's dirty, can you take a look plz ?

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

	local color
	local r, g, b, t
	local _, class = UnitClass(unit)

	if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
		t = self.colors.tapped
	elseif(UnitIsDead(unit) or UnitIsGhost(unit) or not UnitIsConnected(unit)) then
		t = self.colors.disconnected
	elseif(unit =='pet' and GetPetHappiness()) then
		t = self.colors.happiness[GetPetHappiness()]
	elseif(UnitIsPlayer(unit)) then
		t = self.colors.class[class]
	else
		color = FACTION_BAR_COLORS[UnitReaction(unit, 'player')]
	end

	if(t) then
		r, g, b = t[1], t[2], t[3]
	end

	if(color) then
		self.Name:SetTextColor(color.r, color.g, color.b)
	else
		self.Name:SetTextColor(r,g,b)
	end
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
11-03-08, 10:41 AM   #192
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,720
Originally Posted by p3lim View Post
No, thats not what i meant.

The UnitSelectionColor returns diffrent colors than the pre-3.0 function used to return, thats where you get the blue color. (atleast I get a blue color)
I wrote a small mod to fix this issue.

http://rothui.googlecode.com/svn/tru...rs/rColors.lua

It is based on the GameTooltip_UnitColor function. GameTooltip_UnitColor and UnitSelectionColor both requre "UnitID" as input and will return r,g,b as output.

I added class coloring to the GameTooltip_UnitColor function and linked UnitSelectionColor to the new GameTooltip_UnitColor.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 11-03-08 at 10:45 AM.
 
11-03-08, 10:44 AM   #193
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,668
Originally Posted by Caellian View Post
AH !!, so it wasn't me doing something wrong, darn... yes i also get that blue color.

Anyway, i got it working the way i wanted, with the following code, my pet is happiness colored and targetted pets are hostility colored, but i really feel like it's dirty, can you take a look plz ?

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

	local color
	local r, g, b, t
	local _, class = UnitClass(unit)

	if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
		t = self.colors.tapped
	elseif(UnitIsDead(unit) or UnitIsGhost(unit) or not UnitIsConnected(unit)) then
		t = self.colors.disconnected
	elseif(unit =='pet' and GetPetHappiness()) then
		t = self.colors.happiness[GetPetHappiness()]
	elseif(UnitIsPlayer(unit)) then
		t = self.colors.class[class]
	else
		color = FACTION_BAR_COLORS[UnitReaction(unit, 'player')]
	end

	if(t) then
		r, g, b = t[1], t[2], t[3]
	end

	if(color) then
		self.Name:SetTextColor(color.r, color.g, color.b)
	else
		self.Name:SetTextColor(r,g,b)
	end

Not really, but I wouldnt care about that rgb local if i were you.

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

	local color, t
	local _, class = UnitClass(unit)

	if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
		t = self.colors.tapped
	elseif(UnitIsDead(unit) or UnitIsGhost(unit) or not UnitIsConnected(unit)) then
		t = self.colors.disconnected
	elseif(unit =='pet' and GetPetHappiness()) then
		t = self.colors.happiness[GetPetHappiness()]
	elseif(UnitIsPlayer(unit)) then
		t = self.colors.class[class]
	else
		color = FACTION_BAR_COLORS[UnitReaction(unit, 'player')]
	end

	if(color) then
		self.Name:SetTextColor(color.r, color.g, color.b)
	else
		self.Name:SetTextColor(t[1], t[2], t[3])
	end
end
Originally Posted by zork View Post
I wrote a small mod to fix this issue.

http://rothui.googlecode.com/svn/tru...rs/rColors.lua

It is based on the GameTooltip_UnitColor function.

I added class coloring to the GameTooltip_UnitColor function and linked UnitSelectionColor to the new GameTooltip_UnitColor.
You can manipulate the color table(s) and function(s) as you self wish.
 
11-03-08, 10:45 AM   #194
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 79
Originally Posted by p3lim View Post
Make a statusbar frame, size/position as you like, then make it use self.Threat, it'll do the rest of the work.
Tried this, it returns an error in threat.lua;
Code:
threat.lua:26: Attempt to call method "SetVertexColor" (a nil value)
This is what i've added in my code in my player-section in my style function:
Code:
self.Threat = CreateFrame("StatusBar", nil, self)
self.Threat:SetPoint("RIGHT", self, "LEFT", -2, 0)
self.Threat:SetStatusBarTexture(statusbar)
self.Threat:SetStatusBarColor(self.Threat)
self.Threat:SetHeight(20)
self.Threat:SetWidth(10)
__________________
Being boring is fine too.
 
11-03-08, 10:52 AM   #195
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,720
Thats because the threat.lua seems to await a texture not a statusbar. Statusbars can be colorized with SetStatusBarColor, textures require SetVertexColor.

Try to do:
Code:
self.Threat:CreateTexture(nil,"BACKGROUND")
self.Threat:SetTexture(1,1,1,1)
self.Threat:SetPoint("RIGHT", self, "LEFT", -2, 0)
self.Threat:SetHeight(20)
self.Threat:SetWidth(10)
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
 
11-03-08, 11:01 AM   #196
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,668
Originally Posted by zork View Post
Thats because the threat.lua seems to await a texture not a statusbar. Statusbars can be colorized with SetStatusBarColor, textures require SetVertexColor.

Try to do:
Code:
self.Threat:CreateTexture(nil,"BACKGROUND")
self.Threat:SetTexture(1,1,1,1)
self.Threat:SetPoint("RIGHT", self, "LEFT", -2, 0)
self.Threat:SetHeight(20)
self.Threat:SetWidth(10)
Yup, thats right, I forgot that (was drycode anyways)

Though, you can still use your statusbar texture
 
11-03-08, 11:03 AM   #197
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by p3lim View Post
Not really, but I wouldnt care about that rgb local if i were you.
Yet you did, that's close to what i had a few min ago but even cleaner, thanks and zork too

I still wonder what does that blue color stand for anyway.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
11-03-08, 11:04 AM   #198
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 79
Originally Posted by zork View Post
Thats because the threat.lua seems to await a texture not a statusbar. Statusbars can be colorized with SetStatusBarColor, textures require SetVertexColor.

Try to do:
Code:
self.Threat:CreateTexture(nil,"BACKGROUND")
self.Threat:SetTexture(1,1,1,1)
self.Threat:SetPoint("RIGHT", self, "LEFT", -2, 0)
self.Threat:SetHeight(20)
self.Threat:SetWidth(10)
Looked nice, but when i tried it, i got this:
Code:
<path-to-my-layout>/core.lua:229: Attempt to index field "Threat" (a nil value)
witch is strange since threat should be indexed by oUF, but i'm most probably wrong like i usually am when it comes to oUF...
__________________
Being boring is fine too.
 
11-03-08, 11:09 AM   #199
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,668
Originally Posted by hipjipp View Post
Looked nice, but when i tried it, i got this:
Code:
<path-to-my-layout>/core.lua:229: Attempt to index field "Threat" (a nil value)
witch is strange since threat should be indexed by oUF, but i'm most probably wrong like i usually am when it comes to oUF...
Zork did a mistake on the first line of the code

Should be like this
Code:
self.Threat = someframe:CreateTexture(nil, 'BACKGROUND')
 
11-03-08, 11:15 AM   #200
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 79
Originally Posted by p3lim View Post
Zork did a mistake on the first line of the code

Should be like this
Code:
self.Threat = someframe:CreateTexture(nil, 'BACKGROUND')
Thanks! Working nicely now. Now i'm just going to add a border around it to make it look sleeker.. =)

Edit: I can't seem to get my self.Threat.bg to be created by self.Threat, it bums out.
Code:
Attempt to call method "CreateTexture" (a nil value)
Code:
self.Threat = self.Health:CreateTexture(nil,"BACKGROUND")
self.Threat:SetTexture(statusbar)
self.Threat:SetPoint("RIGHT", self, "LEFT", -2, 0)
self.Threat:SetHeight(20)
self.Threat:SetWidth(10)

self.Threat.bg = self.Threat:CreateTexture(nil, "BORDER")
self.Threat.bg:SetAllPoints(self.Threat)
self.Threat.bg:SetTexture(.25, .25, .25)
__________________
Being boring is fine too.

Last edited by hipjipp : 11-03-08 at 12:31 PM.
 

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

Thread Tools
Display Modes

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