More text colors

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Postby terencehill » Sat Nov 15, 2008 3:14 pm

ok. I've done all the dirty work!
I've implemented the new color management in the console, in the input field of the player name, in the nicknames autocompletion and in the players list of a server.

Some instruction to use the new colors:

1. ^xrgb where r, g, b are hexadecimal numbers (0-f) representing red, green and blue components of the color.

2. ^ah where h is a hexadecimal number (0-f), sets the alpha of the following text (alpha is the contrary of transparency, so low alpha means high transparency).
If u use ^[0-9] after a ^ah, the alpha value is ignored (old colors have its own alpha), but it will be applied when u will use again another ^xrgb. Actually, if u want to keep the transparency, don't use old colors.

3. ^a+ or ^a- increase or decrease the previous alpha by 1. If previously the alpha isn't defined, they do nothing.

I've tested it out well and it works fine... on Windows! I hope that all works fine also in linux and mac (there should be no problem).

Page where download the last version of the patch: http://sites.google.com/site/terencehill/Nexuiz

Included in the zip there is a cfg file to quickly test the new colors out: put testnewcolors.cfg in your Nexuiz/data directory, open the console and type exec testnewcolors.cfg
Last edited by terencehill on Wed Nov 19, 2008 10:55 pm, edited 1 time in total.
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby GreEn`mArine » Sat Nov 15, 2008 6:32 pm

Hi.

I haven't tried it yet, however, I'm wondering how this mixes with the usual approach of using a normal 16 piece color palette.

E.g. what happens when I use your modified engine on an unmodified SVN server?
IRC quote:
[kojn] I've been coming a bit more recently
[kojn] she took it the dirty way
GreEn`mArine
Forum addon
 
Posts: 1509
Joined: Tue Feb 28, 2006 9:33 pm
Location: Germany

Postby terencehill » Sat Nov 15, 2008 6:50 pm

@Green and all
u type: ^xf00namered
in nexuiz with this patch u see: namered
in nexuiz without this patch u see: ^xf00namered

the server is not envolved.
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby Alien » Sun Nov 16, 2008 7:28 am

Tested and it works. Great job! The only problem I find is people abusing transparency by hiding their names in order not to be kicked.

for those, who have newer svn:
Code: Select all
svn co -r 5051 svn://svn.icculus.org/nexuiz/trunk nexuizsvn


Ok, terencehill haven't changed anything in q3 color support. That means there are two ways to colorize your name:
1) Old and q3 names compatible way ^[0,9]name
2) New terencehill's way: ^xRGBname and independent alpha modifier: ^aHname

The only bug I've found is that if alpha 0 and you use ^a- it overflows and gets to alpha 1. :) Does not work vice versa.
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby Blµb » Sun Nov 16, 2008 1:57 pm

your patch does not apply, you should teach your IDE to not change every \n to \r\n...

stupid windows <.<

okay after doing: dos2unix *.patch
it applied
still... it shouldn't be necessary

EDIT:
do svn revert console.c and apply:
http://stud4.tuwien.ac.at/~e0725517/pat ... etion.diff
it includes whatever your patch does to console.c and does some necessary changes to the nickcompletion code, I haven't tested it yet (there aren't many people using these colors in their nicks :P)
so... test it :)
I'll be using it from now on to see how it works
Blµb
Alien trapper
 
Posts: 277
Joined: Thu Mar 29, 2007 1:49 pm

Postby C.Brutail » Sun Nov 16, 2008 2:27 pm

Feature request: to prevent abusing of this patch,could it be possible to make the "status" command to ignore the transparency?
"One should strive to achieve; not sit in bitter regret."
WE ARE NEXUIZ.
Image
Image
C.Brutail
Laidback mapper
 
Posts: 2357
Joined: Tue Feb 28, 2006 7:26 pm
Location: Ironforge

Postby Alien » Sun Nov 16, 2008 2:36 pm

C. Brutail, let's say there are 3 pl with transparent nichknames. How should you know which player is misbehaving even if status removes transparency?
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby Blµb » Sun Nov 16, 2008 3:40 pm

what about a cvar for a minimum ^ah value?
like r_min_text_alpha 0.25
so anything below ^a4 is just the same as ^a4
Blµb
Alien trapper
 
Posts: 277
Joined: Thu Mar 29, 2007 1:49 pm

Postby terencehill » Sun Nov 16, 2008 7:04 pm

Blµb wrote:your patch does not apply, you should teach your IDE to not change every \n to \r\n...

stupid windows <.<

I've considered that, it's not a choice of windows but mine with Notepad++. So it's totally my fault. I will change the patch to be in unix format.


Blµb wrote:do svn revert console.c and apply:
http://stud4.tuwien.ac.at/~e0725517/pat ... etion.diff
it includes whatever your patch does to console.c and does some necessary changes to the nickcompletion code, I haven't tested it yet (there aren't many people using these colors in their nicks Razz)
so... test it Smile
I'll be using it from now on to see how it works


1. Tell me before if u want to work with code in which im still working. I've read this msg too late. I've just made the change and tested it and it works (tested). Div told me that he wanted to fix a function on playerlist.c and I'm not touching it.
2. To test your patch u should connect to a server and change your name using ^xrgb colors... after that u can try as many times as u want.
3. Analyzing your patch I guess that it doesn't work... but however I've my code is working, so we don't discuss this thing anymore...
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby terencehill » Sun Nov 16, 2008 7:15 pm

Alien wrote:Tested and it works. Great job! The only problem I find is people abusing transparency by hiding their names in order not to be kicked.

Tnx :)
It's the same of using a name with only spaces. Not many players uses these kind of names and they are easily recognized coz they are the unique ones on servers.

Alien wrote:The only bug I've found is that if alpha 0 and you use ^a- it overflows and gets to alpha 1. Smile Does not work vice versa.


U r right. But this bug is limited to the inputbox of player name, that does not affect the name directly, so the name have still the right transparency. Im gonna fixing it.

C.Brutail wrote:Feature request: to prevent abusing of this patch,could it be possible to make the "status" command to ignore the transparency?

Yes good idea. But I can work on that after all the more important stuffs are done.

Btw the status command should be fixed!!! after the name it displays the informations with the last color used in the truncated version of the name... It's horrible. And also a carriage return after each player info can increase greatly the legibility. Does any1 want to fix this shit?
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

PreviousNext

Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron