Welcome, Guest. Please login or register.
Did you miss your activation email?

September 09, 2010, 02:15:31 PM
Show unread posts since last visit.

Home | Help | Search | Login | Register

Pages: [1] 2
Print
Author Topic: Bug: Fix code for displaying funnames  (Read 3498 times)
webhead
Committee Member
Autococker

Posts: 626

« on: January 05, 2008, 07:36:03 PM »

3: Fix funnames so they don't screw with other characters output after it, such as in the scoreboard. - webhead, T3RR0R15T, Termin8oR

add plz. Wink
Logged
jitspoe
Administrator
Autococker

Posts: 14151

« Reply #1 on: January 05, 2008, 07:52:28 PM »

I think we just need to phase out the old scoreboard completely.
Logged
webhead
Committee Member
Autococker

Posts: 626

« Reply #2 on: January 05, 2008, 10:23:59 PM »

in favor of what?
Logged
jitspoe
Administrator
Autococker

Posts: 14151

« Reply #3 on: January 05, 2008, 10: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.
Logged
webhead
Committee Member
Autococker

Posts: 626

« Reply #4 on: January 05, 2008, 10: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.
Logged
Zorchenhimer
Autococker

Posts: 2573

« Reply #5 on: January 06, 2008, 12:27:36 AM »

Yea, I've seen that happen.
Logged
jitspoe
Administrator
Autococker

Posts: 14151

« Reply #6 on: January 06, 2008, 12:03:02 PM »

http://dplogin.com/dplogin/featurevote/feature.php?id=10032
Logged
Herron
VM-68

Posts: 232

« Reply #7 on: February 16, 2008, 03: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:
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:
if (len_noformat >= MAX_NAME_WIDTH) // name too long // herron format fix (">"=)

Part B
Code:
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:
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)

Logged
ViciouZ
Autococker

Posts: 1840

« Reply #8 on: February 16, 2008, 03: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.
Logged
Herron
VM-68

Posts: 232

« Reply #9 on: April 20, 2008, 11:51:53 AM »

 Cry


* funname_bug.JPG (117.04 KB, 1092x683 - viewed 289 times.)
Logged
i_am_a_pirate
Autococker

Posts: 759

« Reply #10 on: April 21, 2008, 04:15:11 PM »

it's quite cool (...kamikazee)
Logged
sk89q
Global Moderator
Autococker

Posts: 1037

« Reply #11 on: April 29, 2008, 06: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.
Logged
jitspoe
Administrator
Autococker

Posts: 14151

« Reply #12 on: April 30, 2008, 10: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.
Logged
i_am_a_pirate
Autococker

Posts: 759

« Reply #13 on: May 02, 2008, 01: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....
Logged
webhead
Committee Member
Autococker

Posts: 626

« Reply #14 on: May 02, 2008, 03:44:24 AM »

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

Posts: 1199

« Reply #15 on: May 02, 2008, 04:26:58 AM »

Also look at the the bottom left, it indicates the dropping of a flag.
Logged
i_am_a_pirate
Autococker

Posts: 759

« Reply #16 on: May 02, 2008, 07: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.....
Logged
webhead
Committee Member
Autococker

Posts: 626

« Reply #17 on: May 02, 2008, 09:32:00 AM »

lol youre crazy Wink
"stand out more"? uh as far as i know, thats not really the desired effect...
"looks cool"? well that's definitely subjective.
Logged
Garrett
Autococker

Posts: 1374

« Reply #18 on: May 02, 2008, 09: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.
Logged
i_am_a_pirate
Autococker

Posts: 759

« Reply #19 on: May 02, 2008, 11:24:42 AM »

You have a very odd sense of cool.
Okay, okay. Maybe not cool. It just looks different.
Man I'm bad today....
Logged
Pages: [1] 2
Print
Show unread posts since last visit.
Jump to:  


Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC