Digital Paint Discussion Board

Development => Bugs, Feature Requests, and Feedback => Official Feature Votes => Topic started by: webhead on January 05, 2008, 08:36:03 PM

Title: Bug: Fix code for displaying funnames
Post by: webhead on January 05, 2008, 08:36:03 PM
Quote from: http://garrettw.net/public/featvote.txt
3: Fix funnames so they don't screw with other characters output after it, such as in the scoreboard. - webhead, T3RR0R15T, Termin8oR

add plz. ;)
Title: Re: Bug: Fix code for displaying funnames
Post by: jitspoe on January 05, 2008, 08:52:28 PM
I think we just need to phase out the old scoreboard completely.
Title: Re: Bug: Fix code for displaying funnames
Post by: webhead on January 05, 2008, 11:23:59 PM
in favor of what?
Title: Re: Bug: Fix code for displaying funnames
Post by: jitspoe on January 05, 2008, 11:27:13 PM
Just use the regular scoreboard (when you hit tab) at the end of the round instead of displaying the old one.  It just needs to be tweaked so it will stay up until the map change.
Title: Re: Bug: Fix code for displaying funnames
Post by: webhead on January 05, 2008, 11:43:17 PM
yah that sounds good. but i think there are also problems every once in a while with funnames messing with information text that shows up on the screen (and console). this usually involves italics and/or underlines affecting the entire line of text.
Title: Re: Bug: Fix code for displaying funnames
Post by: Zorchenhimer on January 06, 2008, 01:27:36 AM
Yea, I've seen that happen.
Title: Re: Bug: Fix code for displaying funnames
Post by: jitspoe on January 06, 2008, 01:03:02 PM
http://dplogin.com/dplogin/featurevote/feature.php?id=10032
Title: Re: Bug: Fix code for displaying funnames
Post by: Herron on February 16, 2008, 04:20:30 PM
Related to:
http://dplogin.com/forums/index.php?topic=11180.0

Bug:
When you use underline and/or italics in your name and do not:
   (1) terminate the underline/italics; or
   (2) use a char_endformat (ctrl+o) at the end of your name
it frequently messes up the formatting on the line of text appearing after your name (e.g., chat, scoreboard, event text).

Note:
Only the lines that have // herron format fix on them were changed, and the precise change is (listed in parentheses).  This does not fix the scoreboard that pops up at the end of the map, but it does fix the one that is brought up manually.

Fix:
1.  In cl_decode.h:
Code: [Select]
case 'n': // name
Q_strncpyz(out_str, name_from_index(index_array[current_element++]), max_len);
temp_len = strlen(out_str);
out_str[temp_len] = CHAR_ENDFORMAT; // herron format fix (new)
out_str += temp_len+1; // herron format fix (temp_len"+1")
max_len -= temp_len+1; // herron format fix (temp_len"+1")
break;
What it does:  Prevents underlined/italics in names from carrying over into event print messages (e.g., joins, grabs, kills, etc.)



2. In cl_scores.c:
Part A
Code: [Select]
if (len_noformat >= MAX_NAME_WIDTH) // name too long // herron format fix (">"=)
Part B
Code: [Select]
else if (format_diff)
{
// add spaces to compensate for format codes
memset(cl_scores_info[i]+len, ' ', MAX_NAME_WIDTH - len_noformat);
cl_scores_info[i][len] = CHAR_ENDFORMAT; // herron format fix (new)
cl_scores_info[i][MAX_NAME_WIDTH+format_diff+1] = '\0'; // herron format fix (format_diff"+1")
}
What it does:  Prevents underlined/italics in names from carrying over into other columns on the scoreboard (e.g., ping, kills, deaths, etc.)



3.  In cl_parse.c:
Code: [Select]
if (cl_timestamp->value)
Com_Printf("%c%c[%s] %c%s%s%s%c%c%c%s%s %s%s", // herron format fix (%s%s%s"%c")
CHAR_COLOR, isteam ? cl_scores_get_team_textcolor(idx) : COLOR_CHAT,
timestamp, cl_scores_get_team_splat(idx),
cl_scores_get_isalive(idx) ? "" : "[ELIM] ",
(isteam || isprivate) ? "(" : "", name_from_index(idx), CHAR_ENDFORMAT, // herron format fix ("CHAR_ENDFORMAT,")
CHAR_COLOR, isteam ? cl_scores_get_team_textcolor(idx) : COLOR_CHAT,
(isteam || isprivate) ? ")" : "",
level == PRINT_CHATN_ACTION ? "" : ":",
s, (s[strlen(s)-1] == '\n') ? "" : "\n");
else
Com_Printf("%c%c%c%s%s%s%c%c%c%s%s %s%s", cl_scores_get_team_splat(idx),
CHAR_COLOR, isteam ? cl_scores_get_team_textcolor(idx) : COLOR_CHAT,
cl_scores_get_isalive(idx) ? "" : "[ELIM] ", // jitodo - [OBS]
(isteam || isprivate) ? "(" : "", name_from_index(idx), CHAR_ENDFORMAT, // herron format fix ("CHAR_ENDFORMAT,")
CHAR_COLOR, isteam ? cl_scores_get_team_textcolor(idx) : COLOR_CHAT,
(isteam || isprivate) ? ")" : "",
level == PRINT_CHATN_ACTION ? "" : ":",
s, (s[strlen(s)-1] == '\n') ? "" : "\n");
What it does:  Prevents underlined/italics in names from carrying over into chat messages (e.g., say and say_team)

Title: Re: Bug: Fix code for displaying funnames
Post by: ViciouZ on February 16, 2008, 04:33:43 PM
Shreds talks to me in my sleep.

Not only is herron clever as hell at C, but he is also Andy Lewis Norm.
Title: Re: Bug: Fix code for displaying funnames
Post by: Herron on April 20, 2008, 12:51:53 PM
 :'(
Title: Re: Bug: Fix code for displaying funnames
Post by: i_am_a_pirate on April 21, 2008, 05:15:11 PM
it's quite cool (...kamikazee)
Title: Re: Bug: Fix code for displaying funnames
Post by: sk89q on April 29, 2008, 07:09:02 PM
Can I add to this?

Can the length of a funname be calculated correctly so that it is drawn correctly? The invisible fun name characters cause lines to wrap too early and also sometimes causes extra spaces to appear.
Title: Re: Bug: Fix code for displaying funnames
Post by: jitspoe on April 30, 2008, 11:00:25 AM
The way the console system works is basically one big buffer with no concept of lines.  It just draws X number of characters, then it's at the next line. I'll probably look into rewriting this system if/when I add a variable-width font.
Title: Re: Bug: Fix code for displaying funnames
Post by: i_am_a_pirate on May 02, 2008, 02:27:08 AM
erm, that screen there. Is that a double bug? cos you're on the blue team, and you've just gone and picked up the flag and dropped it....
Title: Re: Bug: Fix code for displaying funnames
Post by: webhead on May 02, 2008, 04:44:24 AM
lol pirate, read the text at the top. he picked it up while he was on the red team.
Title: Re: Bug: Fix code for displaying funnames
Post by: Rick on May 02, 2008, 05:26:58 AM
Also look at the the bottom left, it indicates the dropping of a flag.
Title: Re: Bug: Fix code for displaying funnames
Post by: i_am_a_pirate on May 02, 2008, 08:05:44 AM
Also look at the the bottom left, it indicates the dropping of a flag.
you've [...] dropped it....

lol pirate, read the text at the top. he picked it up while he was on the red team.

oops...... Man I'm bad today....
I don't really care about the whole fixing it. It makes it stand out more and looks cool. It isn't a major priority. Now a new physics engine is a completely different matter.....
Title: Re: Bug: Fix code for displaying funnames
Post by: webhead on May 02, 2008, 10:32:00 AM
lol youre crazy ;)
"stand out more"? uh as far as i know, thats not really the desired effect...
"looks cool"? well that's definitely subjective.
Title: Re: Bug: Fix code for displaying funnames
Post by: Garrett on May 02, 2008, 10:40:55 AM
oops...... Man I'm bad today....
I don't really care about the whole fixing it. It makes it stand out more and looks cool. It isn't a major priority. Now a new physics engine is a completely different matter.....
You have a very odd sense of cool.
Title: Re: Bug: Fix code for displaying funnames
Post by: i_am_a_pirate on May 02, 2008, 12:24:42 PM
You have a very odd sense of cool.
Okay, okay. Maybe not cool. It just looks different.
Man I'm bad today....
Title: Re: Bug: Fix code for displaying funnames
Post by: Herron on May 06, 2008, 11:56:30 PM
I don't really care about the whole fixing it. It makes it stand out more and looks cool. It isn't a major priority. Now a new physics engine is a completely different matter.....

The code to fix it has been posted for 3 months
Title: Re: Bug: Fix code for displaying funnames
Post by: jitspoe on May 07, 2008, 06:34:56 PM
Sorry, I didn't mean to ignore your code suggestion.  I don't think changing each piece of code where the name is displayed is the way to go about it.  It needs to be fixed at the source (either where the server gets the name from the client or the client gets the list of names from the server).  It's supposed to do this already.  I just haven't gotten a chance to check into why it sometimes doesn't work.
Title: Tweak: Remove colors from normal text
Post by: T3RR0R15T on February 25, 2011, 02:23:09 PM
Make, that the normal text (no color, so white ingame) from the server or client doesn't use the colors from a nickname with bad funname code.


Now; bad funname code makes a colored text:

[17:43:48] *WsP=HAT (Spyder SE) eliminated *TheWing(FIN) (Spyder SE).


Better; only the nickname and team color splats are colored:

[17:43:48] *WsP=HAT (Spyder SE) eliminated *TheWing(FIN) (Spyder SE).
Title: Re: Tweak: Remove colors from normal text
Post by: webhead on February 25, 2011, 03:36:09 PM
Already in the feature vote list.
http://dplogin.com/dplogin/featurevote/feature.php?id=10032
Title: Re: Tweak: Remove colors from normal text
Post by: T3RR0R15T on February 25, 2011, 03:55:03 PM
Oh, 3 years old... But good, that we spoke about it :P
Title: Re: Tweak: Remove colors from normal text
Post by: rafalluz on February 26, 2011, 02:17:58 PM
Heh, it's pretty much a bug, not a feature per se.
Title: Re: Tweak: Remove colors from normal text
Post by: webhead on February 26, 2011, 02:29:50 PM
Heh, it's pretty much a bug, not a feature per se.
Yes, but the page is called "feature vote".
Title: Re: Tweak: Remove colors from normal text
Post by: jitspoe on February 28, 2011, 03:07:40 PM
That should already be the case.  Do you have the guy's name with color codes so I can try to repro this?
Title: Re: Tweak: Remove colors from normal text
Post by: T3RR0R15T on February 28, 2011, 04:12:40 PM
Sure, the good old stdlogs and listuserip still have the funname codes :) If you ever change that, please save the funname code somewhere for things like this.

I hope the forum doesn't break the code: ˆAWsPˆ0½ˆAHˆ0ATˆ9
Title: Re: Tweak: Remove colors from normal text
Post by: ic3y on March 01, 2011, 01:19:29 AM
That should already be the case.  Do you have the guy's name with color codes so I can try to repro this?

Works with every name, when you make a Colour at the end like

ˆ9ic3yˆO
Title: Re: Bug: Fix code for displaying funnames
Post by: jitspoe on January 07, 2012, 02:39:27 AM
I have a fix for this in the next build.  Turns out I'm a retard and used checked for (s) instead of (*s) in a couple places when I was doing the format cleanup.
Title: Re: Bug: Fix code for displaying funnames
Post by: T3RR0R15T on January 28, 2012, 07:41:33 PM
With the name "ˆÖsˆ›uˆ×pˆ`lˆCaˆTjˆEdˆ`a… ", sometimes the name of the last weapon is colored. The name of the last player doesn't matter and i don't know why it has the funname code there.
I didn't tested all weapons, but PGP seems ok; Stingray and Trracer not.
It also add a line break (before the line is full), like you can see on the first screenshot.
Title: Re: Bug: Fix code for displaying funnames
Post by: jitspoe on January 28, 2012, 08:31:38 PM
Yeah, that's just an issue with how line wrapping is handled.
Title: Re: Bug: Fix code for displaying funnames
Post by: T3RR0R15T on January 28, 2012, 08:34:57 PM
The break or the color?
Title: Re: Bug: Fix code for displaying funnames
Post by: jitspoe on January 28, 2012, 11:24:13 PM
Yes. :)
Title: Re: Bug: Fix code for displaying funnames
Post by: T3RR0R15T on January 29, 2012, 09:17:15 AM
???

I hoped you write break, color or both.