• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG).


Commit MetaInfo

Revision7ecfc9dc9271dda16ba9f40bccc710d4459364e0 (tree)
Time2021-09-19 00:27:48
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Removed the function V_GetColorChar, which was only used to get the color code of a team, and replaced it with the function TEAM_GetTextColorName. This fixes a compatibility issue with printing team-related messages on the screen using custom colors.

Change Summary

Incremental Difference

diff -r e7e1ea6608a7 -r 7ecfc9dc9271 docs/zandronum-history.txt
--- a/docs/zandronum-history.txt Sat Sep 18 20:16:32 2021 -0400
+++ b/docs/zandronum-history.txt Sat Sep 18 11:27:48 2021 -0400
@@ -95,6 +95,7 @@
9595 - - Fixed a player's old body from being frozen and not finishing their animation when they become a dead spectator. [Kaminsky]
9696 - - Fixed dead spectators not spawning where they died if sv_samespawnspot is enabled. [Kaminsky]
9797 - - Fixed ACS scripts puked by the server RCON from using player 0 as the activator. [Kaminsky]
98+- - Fixed a compatibility issue with printing team-related messages on the screen using custom colors. [Kaminsky]
9899 ! - sv_forcegldefaults renamed to sv_forcevideodefaults. The old name still exists for compatibility. [Dusk]
99100 ! - r_3dfloors is now forced to be true when sv_forcevideodefaults is true. [Dusk]
100101 ! - When the wad authentication fails for a connecting client, the client only reports the missing and incompatible PWADS instead of all of them. [Pol Marcet]
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/chat.cpp
--- a/src/chat.cpp Sat Sep 18 20:16:32 2021 -0400
+++ b/src/chat.cpp Sat Sep 18 11:27:48 2021 -0400
@@ -928,7 +928,7 @@
928928 else
929929 {
930930 OutString = TEXTCOLOR_ESCAPE;
931- OutString += V_GetColorChar( TEAM_GetTextColor( players[consoleplayer].Team ));
931+ OutString += TEAM_GetTextColorName( players[consoleplayer].Team );
932932 OutString += "<TEAM> ";
933933 }
934934
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/g_doom/doom_sbar.cpp
--- a/src/g_doom/doom_sbar.cpp Sat Sep 18 20:16:32 2021 -0400
+++ b/src/g_doom/doom_sbar.cpp Sat Sep 18 11:27:48 2021 -0400
@@ -822,7 +822,7 @@
822822 if ( TEAM_CountPlayers( i ) < 1 )
823823 continue;
824824
825- sprintf( szString , "\\c%c%d\n", V_GetColorChar( TEAM_GetTextColor ( i ) ), static_cast<unsigned int> (lPoints[i]));
825+ sprintf( szString , "\\c%s%d\n", TEAM_GetTextColorName ( i ), static_cast<unsigned int> (lPoints[i]));
826826 V_ColorizeString( szString );
827827
828828 HUD_DrawText( ConFont, CR_GRAY,
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/g_shared/a_flags.cpp
--- a/src/g_shared/a_flags.cpp Sat Sep 18 20:16:32 2021 -0400
+++ b/src/g_shared/a_flags.cpp Sat Sep 18 11:27:48 2021 -0400
@@ -457,7 +457,7 @@
457457 SERVERCOMMANDS_PrintHUDMessage( "", 1.5f, TEAM_MESSAGE_Y_AXIS_SUB, 0, 0, HUDMESSAGETYPE_FADEOUT, CR_UNTRANSLATED, 3.0f, 0.0f, 0.5f, "SmallFont", MAKE_ID( 'S', 'U', 'B', 'S' ) );
458458
459459 // Create the "captured" message.
460- sprintf( szString, "\\c%c%s team scores!", V_GetColorChar( TEAM_GetTextColor( Owner->player->Team )), TEAM_GetName( Owner->player->Team ));
460+ sprintf( szString, "\\c%s%s team scores!", TEAM_GetTextColorName( Owner->player->Team ), TEAM_GetName( Owner->player->Team ));
461461 V_ColorizeString( szString );
462462
463463 // Now, print it.
@@ -480,7 +480,7 @@
480480 }
481481
482482 // [RC] Create the "scored by" and "assisted by" message.
483- sprintf( szString, "\\c%cScored by: %s", V_GetColorChar( TEAM_GetTextColor( Owner->player->Team )), Owner->player->userinfo.GetName() );
483+ sprintf( szString, "\\c%sScored by: %s", TEAM_GetTextColorName( Owner->player->Team ), Owner->player->userinfo.GetName() );
484484 const bool bAssisted = (TEAM_GetAssistPlayer(Owner->player->Team) != MAXPLAYERS);
485485 if ( bAssisted )
486486 {
@@ -490,9 +490,9 @@
490490 selfAssist = true;
491491
492492 if ( selfAssist )
493- sprintf( szString + strlen ( szString ), "\\n\\c%c[ Self-Assisted ]", V_GetColorChar( TEAM_GetTextColor( Owner->player->Team )));
493+ sprintf( szString + strlen ( szString ), "\\n\\c%s[ Self-Assisted ]", TEAM_GetTextColorName( Owner->player->Team ));
494494 else
495- sprintf( szString + strlen ( szString ), "\\n\\c%cAssisted by: %s", V_GetColorChar( TEAM_GetTextColor( Owner->player->Team )), players[TEAM_GetAssistPlayer( Owner->player->Team )].userinfo.GetName());
495+ sprintf( szString + strlen ( szString ), "\\n\\c%sAssisted by: %s", TEAM_GetTextColorName( Owner->player->Team ), players[TEAM_GetAssistPlayer( Owner->player->Team )].userinfo.GetName());
496496 }
497497
498498 V_ColorizeString( szString );
@@ -516,9 +516,9 @@
516516 SERVERCOMMANDS_PrintHUDMessage( szString, 1.5f, TEAM_MESSAGE_Y_AXIS_SUB, 0, 0, HUDMESSAGETYPE_FADEOUT, CR_UNTRANSLATED, 3.0f, 0.0f, 0.5f, "SmallFont", MAKE_ID( 'S', 'U', 'B', 'S' ) );
517517
518518 if( ( bAssisted ) && ( ! selfAssist ) )
519- SERVER_Printf( "%s and %s scored for the \034%c%s " TEXTCOLOR_NORMAL "team!\n", Owner->player->userinfo.GetName(), players[TEAM_GetAssistPlayer( Owner->player->Team )].userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( Owner->player->Team )), TEAM_GetName( Owner->player->Team ));
519+ SERVER_Printf( "%s and %s scored for the \034%s%s " TEXTCOLOR_NORMAL "team!\n", Owner->player->userinfo.GetName(), players[TEAM_GetAssistPlayer( Owner->player->Team )].userinfo.GetName(), TEAM_GetTextColorName( Owner->player->Team ), TEAM_GetName( Owner->player->Team ));
520520 else
521- SERVER_Printf( "%s scored for the \034%c%s " TEXTCOLOR_NORMAL "team!\n", Owner->player->userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( Owner->player->Team )), TEAM_GetName( Owner->player->Team ));
521+ SERVER_Printf( "%s scored for the \034%s%s " TEXTCOLOR_NORMAL "team!\n", Owner->player->userinfo.GetName(), TEAM_GetTextColorName( Owner->player->Team ), TEAM_GetName( Owner->player->Team ));
522522 }
523523
524524
@@ -617,9 +617,9 @@
617617
618618 // Create the "pickup" message.
619619 if (( pToucher->player - players ) == consoleplayer )
620- sprintf( szString, "\\c%cYou have the %s flag!", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
620+ sprintf( szString, "\\c%sYou have the %s flag!", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
621621 else
622- sprintf( szString, "\\c%c%s flag taken!", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
622+ sprintf( szString, "\\c%s%s flag taken!", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
623623
624624 V_ColorizeString( szString );
625625
@@ -639,18 +639,18 @@
639639 // If necessary, send it to clients.
640640 else
641641 {
642- sprintf( szString, "\\c%cYou have the %s flag!", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
642+ sprintf( szString, "\\c%sYou have the %s flag!", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
643643 V_ColorizeString( szString );
644644 SERVERCOMMANDS_PrintHUDMessage( szString, 1.5f, TEAM_MESSAGE_Y_AXIS, 0, 0, HUDMESSAGETYPE_FADEOUT, CR_UNTRANSLATED, 3.0f, 0.0f, 0.25f, "BigFont", MAKE_ID( 'C', 'N', 'T', 'R' ), ULONG( pToucher->player - players ), SVCF_ONLYTHISCLIENT );
645645
646- sprintf( szString, "\\c%c%s flag taken!", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
646+ sprintf( szString, "\\c%s%s flag taken!", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
647647 V_ColorizeString( szString );
648648 SERVERCOMMANDS_PrintHUDMessage( szString, 1.5f, TEAM_MESSAGE_Y_AXIS, 0, 0, HUDMESSAGETYPE_FADEOUT, CR_UNTRANSLATED, 3.0f, 0.0f, 0.25f, "BigFont", MAKE_ID( 'C', 'N', 'T', 'R' ), ULONG( pToucher->player - players ), SVCF_SKIPTHISCLIENT );
649649 }
650650
651651 // [RC] Create the "held by" message for the team.
652652 ULONG playerIndex = ULONG( pToucher->player - players );
653- sprintf( szString, "\\c%cHeld by: %s", V_GetColorChar( TEAM_GetTextColor( players[playerIndex].Team )), players[playerIndex].userinfo.GetName() );
653+ sprintf( szString, "\\c%sHeld by: %s", TEAM_GetTextColorName( players[playerIndex].Team ), players[playerIndex].userinfo.GetName() );
654654
655655 V_ColorizeString( szString );
656656
@@ -674,7 +674,7 @@
674674 else
675675 {
676676 SERVERCOMMANDS_PrintHUDMessage( szString, 1.5f, TEAM_MESSAGE_Y_AXIS_SUB, 0, 0, HUDMESSAGETYPE_FADEOUT, CR_UNTRANSLATED, 3.0f, 0.0f, 0.25f, "SmallFont", MAKE_ID( 'S', 'U', 'B', 'S' ), ULONG( pToucher->player - players ), SVCF_SKIPTHISCLIENT );
677- SERVER_Printf( PRINT_MEDIUM, "%s has taken the \034%c%s " TEXTCOLOR_NORMAL "flag.\n", players[playerIndex].userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
677+ SERVER_Printf( PRINT_MEDIUM, "%s has taken the \034%s%s " TEXTCOLOR_NORMAL "flag.\n", players[playerIndex].userinfo.GetName(), TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
678678 }
679679 }
680680
@@ -753,7 +753,7 @@
753753 {
754754 // [RC] Create the "returned by" message for this team.
755755 ULONG playerIndex = ULONG( pReturner->player - players );
756- sprintf( szString, "\\c%cReturned by: %s", V_GetColorChar( TEAM_GetTextColor( players[playerIndex].Team )), players[playerIndex].userinfo.GetName() );
756+ sprintf( szString, "\\c%sReturned by: %s", TEAM_GetTextColorName( players[playerIndex].Team ), players[playerIndex].userinfo.GetName() );
757757
758758 // [CK] Send out an event that a flag/skull was returned, this is the easiest place to do it
759759 // Second argument is the team index, third argument is what kind of return it was
@@ -762,7 +762,7 @@
762762 else
763763 {
764764 // [RC] Create the "returned automatically" message for this team.
765- sprintf( szString, "\\c%cReturned automatically.", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))));
765+ sprintf( szString, "\\c%sReturned automatically.", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )));
766766
767767 // [CK] Indicate the server returned the flag/skull after a timeout
768768 GAMEMODE_HandleEvent ( GAMEEVENT_RETURNS, NULL, static_cast<int> ( ulItemTeam ), GAMEEVENT_RETURN_TIMEOUTRETURN );
@@ -774,9 +774,9 @@
774774 if ( NETWORK_GetState( ) == NETSTATE_SERVER )
775775 {
776776 if ( pReturner && pReturner->player )
777- SERVER_Printf( PRINT_MEDIUM, "%s returned the \034%c%s " TEXTCOLOR_NORMAL "flag.\n", pReturner->player->userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
777+ SERVER_Printf( PRINT_MEDIUM, "%s returned the \034%s%s " TEXTCOLOR_NORMAL "flag.\n", pReturner->player->userinfo.GetName(), TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
778778 else
779- SERVER_Printf( PRINT_MEDIUM, "\034%c%s " TEXTCOLOR_NORMAL "flag returned.\n", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
779+ SERVER_Printf( PRINT_MEDIUM, "\034%s%s " TEXTCOLOR_NORMAL "flag returned.\n", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
780780 }
781781 }
782782
@@ -813,7 +813,7 @@
813813 char szString[256];
814814
815815 // Create the "returned" message.
816- sprintf( szString, "\\c%c%s flag returned", V_GetColorChar( TEAM_GetTextColor ( TEAM_GetTeamFromItem( this ))), TEAM_GetName ( TEAM_GetTeamFromItem( this )));
816+ sprintf( szString, "\\c%s%s flag returned", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName ( TEAM_GetTeamFromItem( this )));
817817
818818 V_ColorizeString( szString );
819819
@@ -904,7 +904,7 @@
904904 }
905905
906906 // Create the "captured" message.
907- sprintf( szString, "\\c%c%s team scores!", V_GetColorChar( TEAM_GetTextColor( Owner->player->Team )), TEAM_GetName( Owner->player->Team ));
907+ sprintf( szString, "\\c%s%s team scores!", TEAM_GetTextColorName( Owner->player->Team ), TEAM_GetName( Owner->player->Team ));
908908 V_ColorizeString( szString );
909909
910910 // Now, print it.
@@ -927,7 +927,7 @@
927927 }
928928
929929 // [BC] Rivecoder's "scored by" message.
930- sprintf( szString, "\\c%cScored by: %s", V_GetColorChar( TEAM_GetTextColor( Owner->player->Team )), Owner->player->userinfo.GetName() );
930+ sprintf( szString, "\\c%sScored by: %s", TEAM_GetTextColorName( Owner->player->Team ), Owner->player->userinfo.GetName() );
931931 V_ColorizeString( szString );
932932
933933 // Now, print it.
@@ -1065,7 +1065,7 @@
10651065 sprintf( szName, "%s", players[ulPlayer].userinfo.GetName() );
10661066 V_RemoveColorCodes( szName );
10671067
1068- sprintf( szString, "\\ccHeld by: \\c%c%s", V_GetColorChar( TEAM_GetTextColor( players[ulPlayer].Team )), szName );
1068+ sprintf( szString, "\\ccHeld by: \\c%s%s", TEAM_GetTextColorName( players[ulPlayer].Team ), szName );
10691069 V_ColorizeString( szString );
10701070
10711071 // Now, print it.
@@ -1235,9 +1235,9 @@
12351235
12361236 // Create the "pickup" message.
12371237 if (( pToucher->player - players ) == consoleplayer )
1238- sprintf( szString, "\\c%cYou have the %s skull!", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
1238+ sprintf( szString, "\\c%sYou have the %s skull!", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
12391239 else
1240- sprintf( szString, "\\c%c%s skull taken!", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
1240+ sprintf( szString, "\\c%s%s skull taken!", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
12411241
12421242 V_ColorizeString( szString );
12431243
@@ -1257,18 +1257,18 @@
12571257 // If necessary, send it to clients.
12581258 else
12591259 {
1260- sprintf( szString, "\\c%cYou have the %s skull!", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
1260+ sprintf( szString, "\\c%sYou have the %s skull!", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
12611261 V_ColorizeString( szString );
12621262 SERVERCOMMANDS_PrintHUDMessage( szString, 1.5f, TEAM_MESSAGE_Y_AXIS, 0, 0, HUDMESSAGETYPE_FADEOUT, CR_UNTRANSLATED, 3.0f, 0.0f, 0.25f, "BigFont", MAKE_ID( 'C', 'N', 'T', 'R' ), ULONG( pToucher->player - players ), SVCF_ONLYTHISCLIENT );
12631263
1264- sprintf( szString, "\\c%c%s skull taken!", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
1264+ sprintf( szString, "\\c%s%s skull taken!", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
12651265 V_ColorizeString( szString );
12661266 SERVERCOMMANDS_PrintHUDMessage( szString, 1.5f, TEAM_MESSAGE_Y_AXIS, 0, 0, HUDMESSAGETYPE_FADEOUT, CR_UNTRANSLATED, 3.0f, 0.0f, 0.25f, "BigFont", MAKE_ID( 'C', 'N', 'T', 'R' ), ULONG( pToucher->player - players ), SVCF_SKIPTHISCLIENT );
12671267 }
12681268
12691269 // [RC] Create the "held by" message for this team.
12701270 ULONG playerIndex = ULONG( pToucher->player - players );
1271- sprintf( szString, "\\c%cHeld by: %s", V_GetColorChar( TEAM_GetTextColor( players[playerIndex].Team )), players[playerIndex].userinfo.GetName());
1271+ sprintf( szString, "\\c%sHeld by: %s", TEAM_GetTextColorName( players[playerIndex].Team ), players[playerIndex].userinfo.GetName());
12721272
12731273 V_ColorizeString( szString );
12741274
@@ -1292,7 +1292,7 @@
12921292 else
12931293 {
12941294 SERVERCOMMANDS_PrintHUDMessage( szString, 1.5f, TEAM_MESSAGE_Y_AXIS_SUB, 0, 0, HUDMESSAGETYPE_FADEOUT, CR_UNTRANSLATED, 3.0f, 0.0f, 0.25f, "SmallFont", MAKE_ID( 'S', 'U', 'B', 'S' ), ULONG( pToucher->player - players ), SVCF_SKIPTHISCLIENT );
1295- SERVER_Printf( PRINT_MEDIUM, "%s has taken the \034%c%s " TEXTCOLOR_NORMAL "skull.\n", players[playerIndex].userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
1295+ SERVER_Printf( PRINT_MEDIUM, "%s has taken the \034%s%s " TEXTCOLOR_NORMAL "skull.\n", players[playerIndex].userinfo.GetName(), TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
12961296 }
12971297 }
12981298
@@ -1371,7 +1371,7 @@
13711371 {
13721372 // [RC] Create the "returned by" message for this team.
13731373 ULONG playerIndex = ULONG( pReturner->player - players );
1374- sprintf( szString, "\\c%cReturned by: %s", V_GetColorChar( TEAM_GetTextColor( players[playerIndex].Team )), players[playerIndex].userinfo.GetName() );
1374+ sprintf( szString, "\\c%sReturned by: %s", TEAM_GetTextColorName( players[playerIndex].Team ), players[playerIndex].userinfo.GetName() );
13751375
13761376 // [AK] Trigger an event script indicating that a player returned the skull.
13771377 GAMEMODE_HandleEvent( GAMEEVENT_RETURNS, pReturner, static_cast<int> ( ulItemTeam ), GAMEEVENT_RETURN_PLAYERRETURN );
@@ -1379,7 +1379,7 @@
13791379 else
13801380 {
13811381 // [RC] Create the "returned automatically" message for this team.
1382- sprintf( szString, "\\c%cReturned automatically.", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))));
1382+ sprintf( szString, "\\c%sReturned automatically.", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )));
13831383
13841384 // [AK] Trigger an event script indicating that the skull was returned after a timeout.
13851385 GAMEMODE_HandleEvent( GAMEEVENT_RETURNS, NULL, static_cast<int> ( ulItemTeam ), GAMEEVENT_RETURN_TIMEOUTRETURN );
@@ -1391,9 +1391,9 @@
13911391 if ( NETWORK_GetState( ) == NETSTATE_SERVER )
13921392 {
13931393 if ( pReturner && pReturner->player )
1394- SERVER_Printf( PRINT_MEDIUM, "%s returned the \034%c%s " TEXTCOLOR_NORMAL "skull.\n", pReturner->player->userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
1394+ SERVER_Printf( PRINT_MEDIUM, "%s returned the \034%s%s " TEXTCOLOR_NORMAL "skull.\n", pReturner->player->userinfo.GetName(), TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
13951395 else
1396- SERVER_Printf( PRINT_MEDIUM, "\034%c%s " TEXTCOLOR_NORMAL "skull returned.\n", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
1396+ SERVER_Printf( PRINT_MEDIUM, "\034%s%s " TEXTCOLOR_NORMAL "skull returned.\n", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
13971397 }
13981398 }
13991399
@@ -1430,7 +1430,7 @@
14301430 char szString[256];
14311431
14321432 // Create the "returned" message.
1433- sprintf( szString, "\\c%c%s skull returned", V_GetColorChar( TEAM_GetTextColor( TEAM_GetTeamFromItem( this ))), TEAM_GetName( TEAM_GetTeamFromItem( this )));
1433+ sprintf( szString, "\\c%s%s skull returned", TEAM_GetTextColorName( TEAM_GetTeamFromItem( this )), TEAM_GetName( TEAM_GetTeamFromItem( this )));
14341434
14351435 V_ColorizeString( szString );
14361436
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/g_shared/shared_hud.cpp
--- a/src/g_shared/shared_hud.cpp Sat Sep 18 20:16:32 2021 -0400
+++ b/src/g_shared/shared_hud.cpp Sat Sep 18 11:27:48 2021 -0400
@@ -872,9 +872,9 @@
872872 int leadingTeam = !!( scores[1] > scores[0] );
873873 int losingTeam = 1 - leadingTeam;
874874
875- text.Format ("\\c%c%d\\cC - \\c%c%d",
876- V_GetColorChar( TEAM_GetTextColor( leadingTeam )), scores[leadingTeam],
877- V_GetColorChar( TEAM_GetTextColor( losingTeam )), scores[losingTeam] );
875+ text.Format ("\\c%s%d\\cC - \\c%s%d",
876+ TEAM_GetTextColorName( leadingTeam ), scores[leadingTeam],
877+ TEAM_GetTextColorName( losingTeam ), scores[losingTeam] );
878878 }
879879 else
880880 {
@@ -887,7 +887,7 @@
887887 text += "\\cC - ";
888888
889889 text += "\\c";
890- text += V_GetColorChar( TEAM_GetTextColor( teams[i] ));
890+ text += TEAM_GetTextColorName( teams[i] );
891891 text.AppendFormat( "%d", GetScoreForTeam( teams[i] ));
892892 }
893893 }
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/g_shared/st_hud.cpp
--- a/src/g_shared/st_hud.cpp Sat Sep 18 20:16:32 2021 -0400
+++ b/src/g_shared/st_hud.cpp Sat Sep 18 11:27:48 2021 -0400
@@ -459,7 +459,7 @@
459459 if ( GAMEMODE_GetCurrentFlags( ) & GMF_PLAYERSONTEAMS )
460460 {
461461 color = TEXTCOLOR_ESCAPE;
462- color += V_GetColorChar( TEAM_GetTextColor( players[ulDisplayPlayer].Team ));
462+ color += TEAM_GetTextColorName( players[ulDisplayPlayer].Team );
463463 }
464464
465465 bottomString.AppendFormat( "%sFollowing - %s%s", color.GetChars( ), players[ulDisplayPlayer].userinfo.GetName( ), color.GetChars( ));
@@ -1126,7 +1126,7 @@
11261126
11271127 // [AK] Reset the list of team names, starting with this team.
11281128 teamName = TEXTCOLOR_ESCAPE;
1129- teamName.AppendFormat( "%c%s", V_GetColorChar( TEAM_GetTextColor( ulTeam )), TEAM_GetName( ulTeam ));
1129+ teamName.AppendFormat( "%s%s", TEAM_GetTextColorName( ulTeam ), TEAM_GetName( ulTeam ));
11301130 ulNumTeamsWithHighestScore = 1;
11311131 }
11321132 // [AK] If this team's score is equal to the current highest score, add their name to the end of the list.
@@ -1139,7 +1139,7 @@
11391139
11401140 // [AK] Store this team's name and text color into a string, we'll need it later.
11411141 lastTeamName = TEXTCOLOR_ESCAPE;
1142- lastTeamName.AppendFormat( "%c%s", V_GetColorChar( TEAM_GetTextColor( ulTeam )), TEAM_GetName( ulTeam ));
1142+ lastTeamName.AppendFormat( "%s%s", TEAM_GetTextColorName( ulTeam ), TEAM_GetName( ulTeam ));
11431143 ulNumTeamsWithHighestScore++;
11441144 }
11451145
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/lastmanstanding.cpp
--- a/src/lastmanstanding.cpp Sat Sep 18 20:16:32 2021 -0400
+++ b/src/lastmanstanding.cpp Sat Sep 18 11:27:48 2021 -0400
@@ -443,7 +443,7 @@
443443 if ( ulWinner == teams.Size( ) )
444444 sprintf( szString, "\\cdDraw Game!" );
445445 else
446- sprintf( szString, "\\c%c%s Wins!", V_GetColorChar( TEAM_GetTextColor( ulWinner ) ), TEAM_GetName( ulWinner ));
446+ sprintf( szString, "\\c%s%s Wins!", TEAM_GetTextColorName( ulWinner ), TEAM_GetName( ulWinner ));
447447 }
448448 else if ( ulWinner == MAXPLAYERS )
449449 sprintf( szString, "\\cdDRAW GAME!" );
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/p_interaction.cpp
--- a/src/p_interaction.cpp Sat Sep 18 20:16:32 2021 -0400
+++ b/src/p_interaction.cpp Sat Sep 18 11:27:48 2021 -0400
@@ -641,7 +641,7 @@
641641 if (( NETWORK_GetState( ) == NETSTATE_SINGLE_MULTIPLAYER ) && ( players[consoleplayer].mo->CheckLocalView( source->player - players )))
642642 sprintf( szString, "\\cGYOU WIN!" );
643643 else if (( teamplay ) && ( source->player->bOnTeam ))
644- sprintf( szString, "\\c%c%s wins!\n", V_GetColorChar( TEAM_GetTextColor( source->player->Team )), TEAM_GetName( source->player->Team ));
644+ sprintf( szString, "\\c%s%s wins!\n", TEAM_GetTextColorName( source->player->Team ), TEAM_GetName( source->player->Team ));
645645 else
646646 sprintf( szString, "%s \\cGWINS!", players[source->player - players].userinfo.GetName() );
647647 V_ColorizeString( szString );
@@ -2338,7 +2338,7 @@
23382338 if (( NETWORK_GetState() != NETSTATE_SERVER ) && pPlayer->mo->IsTeammate( players[consoleplayer].camera ))
23392339 ANNOUNCER_PlayEntry( cl_announcer, "YouWin" );
23402340
2341- sprintf( szString, "\\c%c%s WINS!", V_GetColorChar( TEAM_GetTextColor( pPlayer->Team )), TEAM_GetName( pPlayer->Team ));
2341+ sprintf( szString, "\\c%s%s WINS!", TEAM_GetTextColorName( pPlayer->Team ), TEAM_GetName( pPlayer->Team ));
23422342 V_ColorizeString( szString );
23432343
23442344 if ( NETWORK_GetState( ) != NETSTATE_SERVER )
@@ -2433,7 +2433,7 @@
24332433 // Player has changed his team! Tell clients.
24342434 if ( bBroadcastChange )
24352435 {
2436- SERVER_Printf( "%s joined the \034%c%s " TEXTCOLOR_NORMAL "team.\n", pPlayer->userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( ulTeam ) ), TEAM_GetName( ulTeam ));
2436+ SERVER_Printf( "%s joined the \034%s%s " TEXTCOLOR_NORMAL "team.\n", pPlayer->userinfo.GetName(), TEAM_GetTextColorName( ulTeam ), TEAM_GetName( ulTeam ));
24372437 }
24382438 }
24392439
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/possession.cpp
--- a/src/possession.cpp Sat Sep 18 20:16:32 2021 -0400
+++ b/src/possession.cpp Sat Sep 18 11:27:48 2021 -0400
@@ -720,8 +720,8 @@
720720 // [RC] On team possession, state who scored.
721721 if ( teampossession && ( players[ulPlayer].bOnTeam ))
722722 {
723- sprintf( szString, "\\c%c%s %s!", V_GetColorChar( TEAM_GetTextColor( players[ulPlayer].Team )), TEAM_GetName( players[ulPlayer].Team ) ,bPointLimitReached ? "WINS" : "SCORES" );
724- sprintf( szScorer, "\\c%cScored by: %s", V_GetColorChar( TEAM_GetTextColor( players[ulPlayer].Team )), players[ulPlayer].userinfo.GetName() );
723+ sprintf( szString, "\\c%s%s %s!", TEAM_GetTextColorName( players[ulPlayer].Team ), TEAM_GetName( players[ulPlayer].Team ) ,bPointLimitReached ? "WINS" : "SCORES" );
724+ sprintf( szScorer, "\\c%sScored by: %s", TEAM_GetTextColorName( players[ulPlayer].Team ), players[ulPlayer].userinfo.GetName() );
725725
726726 // [BB] I don't see why we should remove the player name's color codes here. It's not done in CTF either
727727 // and the player's team is apparent from the rest of the message.
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/sv_main.cpp
--- a/src/sv_main.cpp Sat Sep 18 20:16:32 2021 -0400
+++ b/src/sv_main.cpp Sat Sep 18 11:27:48 2021 -0400
@@ -6249,12 +6249,12 @@
62496249 // Player was on a team, so tell everyone that he's changing teams.
62506250 if ( bOnTeam )
62516251 {
6252- SERVER_Printf( "%s defected to the \034%c%s " TEXTCOLOR_NORMAL "team.\n", players[g_lCurrentClient].userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( players[g_lCurrentClient].Team )), TEAM_GetName( players[g_lCurrentClient].Team ));
6252+ SERVER_Printf( "%s defected to the \034%s%s " TEXTCOLOR_NORMAL "team.\n", players[g_lCurrentClient].userinfo.GetName(), TEAM_GetTextColorName( players[g_lCurrentClient].Team ), TEAM_GetName( players[g_lCurrentClient].Team ));
62536253 }
62546254 // Otherwise, tell everyone he's joining a team.
62556255 else
62566256 {
6257- SERVER_Printf( "%s joined the \034%c%s " TEXTCOLOR_NORMAL "team.\n", players[g_lCurrentClient].userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( players[g_lCurrentClient].Team )), TEAM_GetName( players[g_lCurrentClient].Team ));
6257+ SERVER_Printf( "%s joined the \034%s%s " TEXTCOLOR_NORMAL "team.\n", players[g_lCurrentClient].userinfo.GetName(), TEAM_GetTextColorName( players[g_lCurrentClient].Team ), TEAM_GetName( players[g_lCurrentClient].Team ));
62586258 }
62596259
62606260 if ( players[g_lCurrentClient].mo )
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/team.cpp
--- a/src/team.cpp Sat Sep 18 20:16:32 2021 -0400
+++ b/src/team.cpp Sat Sep 18 11:27:48 2021 -0400
@@ -500,15 +500,15 @@
500500
501501 // Create the console message.
502502 if( ( bAssisted ) && ( ! bSelfAssisted ) )
503- sprintf(szString, "%s and %s scored for the \034%c%s " TEXTCOLOR_NORMAL "team!\n", pPlayer->userinfo.GetName(), players[TEAM_GetAssistPlayer( pPlayer->Team )].userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( pPlayer->Team )), TEAM_GetName( pPlayer->Team ));
503+ sprintf(szString, "%s and %s scored for the \034%s%s " TEXTCOLOR_NORMAL "team!\n", pPlayer->userinfo.GetName(), players[TEAM_GetAssistPlayer( pPlayer->Team )].userinfo.GetName(), TEAM_GetTextColorName( pPlayer->Team ), TEAM_GetName( pPlayer->Team ));
504504 else
505- sprintf(szString, "%s scored for the \034%c%s " TEXTCOLOR_NORMAL "team!\n", pPlayer->userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( pPlayer->Team )), TEAM_GetName( pPlayer->Team ));
505+ sprintf(szString, "%s scored for the \034%s%s " TEXTCOLOR_NORMAL "team!\n", pPlayer->userinfo.GetName(), TEAM_GetTextColorName( pPlayer->Team ), TEAM_GetName( pPlayer->Team ));
506506
507507 if ( NETWORK_GetState( ) == NETSTATE_SERVER )
508508 SERVERCOMMANDS_Print( szString, PRINT_HIGH );
509509
510510 // Create the fullscreen message.
511- FString coloredTeamName = V_GetColorChar( TEAM_GetTextColor( pPlayer->Team ) );
511+ FString coloredTeamName = TEAM_GetTextColorName( pPlayer->Team );
512512 coloredTeamName += " ";
513513 coloredTeamName += TEAM_GetName( pPlayer->Team );
514514 switch ( ulNumPoints )
@@ -564,14 +564,14 @@
564564 }
565565
566566 // Create the "scored by / assisted by" message.
567- sprintf( szString, "\\c%cScored by: %s", V_GetColorChar( TEAM_GetTextColor( pPlayer->Team ) ), pPlayer->userinfo.GetName());
567+ sprintf( szString, "\\c%sScored by: %s", TEAM_GetTextColorName( pPlayer->Team ), pPlayer->userinfo.GetName());
568568
569569 if ( bAssisted )
570570 {
571571 if ( bSelfAssisted )
572- sprintf( szString + strlen ( szString ), "\\n\\c%c( Self-Assisted )", V_GetColorChar( TEAM_GetTextColor( pPlayer->Team ) ) );
572+ sprintf( szString + strlen ( szString ), "\\n\\c%s( Self-Assisted )", TEAM_GetTextColorName( pPlayer->Team ) );
573573 else
574- sprintf( szString + strlen ( szString ), "\\n\\c%cAssisted by: %s", V_GetColorChar( TEAM_GetTextColor( pPlayer->Team ) ), players[TEAM_GetAssistPlayer( pPlayer->Team )].userinfo.GetName());
574+ sprintf( szString + strlen ( szString ), "\\n\\c%sAssisted by: %s", TEAM_GetTextColorName( pPlayer->Team ), players[TEAM_GetAssistPlayer( pPlayer->Team )].userinfo.GetName());
575575 }
576576
577577 V_ColorizeString( szString );
@@ -683,7 +683,7 @@
683683 return;
684684
685685 // Create the message.
686- sprintf( szString, "\\c%cThe %s skull must be returned first!", V_GetColorChar( TEAM_GetTextColor( pPlayer->Team )), TEAM_GetName( pPlayer->Team ));
686+ sprintf( szString, "\\c%sThe %s skull must be returned first!", TEAM_GetTextColorName( pPlayer->Team ), TEAM_GetName( pPlayer->Team ));
687687
688688 V_ColorizeString( szString );
689689
@@ -728,7 +728,7 @@
728728 if ( NETWORK_GetState( ) == NETSTATE_SERVER )
729729 {
730730 SERVERCOMMANDS_TeamFlagDropped( ULONG( pPlayer - players ), ulTeamIdx );
731- SERVER_Printf( PRINT_MEDIUM, "%s lost the \034%c%s " TEXTCOLOR_NORMAL "%s.\n", pPlayer->userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( ulTeamIdx)), TEAM_GetName( ulTeamIdx), ( skulltag ) ? "skull" : "flag" );
731+ SERVER_Printf( PRINT_MEDIUM, "%s lost the \034%s%s " TEXTCOLOR_NORMAL "%s.\n", pPlayer->userinfo.GetName(), TEAM_GetTextColorName( ulTeamIdx), TEAM_GetName( ulTeamIdx), ( skulltag ) ? "skull" : "flag" );
732732 return;
733733 }
734734
@@ -736,7 +736,7 @@
736736 Printf( "%s %s dropped!\n", TEAM_GetName( ulTeamIdx ), ( skulltag ) ? "skull" : "flag" );
737737
738738 // Next, build the dropped message.
739- sprintf( szString, "\\c%c%s %s dropped!", V_GetColorChar( TEAM_GetTextColor( ulTeamIdx )), TEAM_GetName( ulTeamIdx ), ( skulltag ) ? "skull" : "flag" );
739+ sprintf( szString, "\\c%s%s %s dropped!", TEAM_GetTextColorName( ulTeamIdx ), TEAM_GetName( ulTeamIdx ), ( skulltag ) ? "skull" : "flag" );
740740
741741 // Colorize it.
742742 V_ColorizeString( szString );
@@ -776,7 +776,7 @@
776776
777777 // Display "%s WINS!" HUD message.
778778 if ( ulTeamIdx < teams.Size( ) )
779- sprintf( szString, "\\c%c%s WINS!", V_GetColorChar( TEAM_GetTextColor( ulTeamIdx ) ), TEAM_GetName( ulTeamIdx ) );
779+ sprintf( szString, "\\c%s%s WINS!", TEAM_GetTextColorName( ulTeamIdx ), TEAM_GetName( ulTeamIdx ) );
780780 else
781781 sprintf( szString, "DRAW GAME!\n" );
782782
@@ -962,6 +962,16 @@
962962
963963 //*****************************************************************************
964964 //
965+const char *TEAM_GetTextColorName( ULONG ulTeamIdx )
966+{
967+ if (( TEAM_CheckIfValid( ulTeamIdx )) && ( teams[ulTeamIdx].TextColor.IsNotEmpty( )))
968+ return ( teams[ulTeamIdx].TextColor.GetChars( ));
969+
970+ return ( "Untranslated" );
971+}
972+
973+//*****************************************************************************
974+//
965975 ULONG TEAM_GetTextColor( ULONG ulTeamIdx )
966976 {
967977 if ( TEAM_CheckIfValid( ulTeamIdx ))
@@ -1058,7 +1068,7 @@
10581068
10591069 if ( TEAM_GetScore( ulTeamIdx ) >= (LONG)pointlimit )
10601070 {
1061- NETWORK_Printf( "\034%c%s " TEXTCOLOR_NORMAL "has won the game!\n", V_GetColorChar( TEAM_GetTextColor( ulTeamIdx )), TEAM_GetName( ulTeamIdx ));
1071+ NETWORK_Printf( "\034%s%s " TEXTCOLOR_NORMAL "has won the game!\n", TEAM_GetTextColorName( ulTeamIdx ), TEAM_GetName( ulTeamIdx ));
10621072
10631073 // Do the win sequence for the winner.
10641074 TEAM_DoWinSequence( ulTeamIdx );
@@ -2064,7 +2074,7 @@
20642074 {
20652075 if ( players[consoleplayer].bOnTeam )
20662076 {
2067- Printf( "You are on the \034%c%s " TEXTCOLOR_NORMAL "team.\n", V_GetColorChar( TEAM_GetTextColor( players[consoleplayer].Team ) ), TEAM_GetName( players[consoleplayer].Team ) );
2077+ Printf( "You are on the \034%s%s " TEXTCOLOR_NORMAL "team.\n", TEAM_GetTextColorName( players[consoleplayer].Team ), TEAM_GetName( players[consoleplayer].Team ) );
20682078 }
20692079 else
20702080 Printf( "You are not currently on a team.\n" );
@@ -2266,12 +2276,12 @@
22662276 // Player was on a team, so tell everyone that he's changing teams.
22672277 if ( bOnTeam )
22682278 {
2269- Printf( "%s defected to the \034%c%s " TEXTCOLOR_NORMAL "team.\n", players[consoleplayer].userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( players[consoleplayer].Team ) ), TEAM_GetName( players[consoleplayer].Team ));
2279+ Printf( "%s defected to the \034%s%s " TEXTCOLOR_NORMAL "team.\n", players[consoleplayer].userinfo.GetName(), TEAM_GetTextColorName( players[consoleplayer].Team ), TEAM_GetName( players[consoleplayer].Team ));
22702280 }
22712281 // Otherwise, tell everyone he's joining a team.
22722282 else
22732283 {
2274- Printf( "%s joined the \034%c%s " TEXTCOLOR_NORMAL "team.\n", players[consoleplayer].userinfo.GetName(), V_GetColorChar( TEAM_GetTextColor( players[consoleplayer].Team ) ), TEAM_GetName( players[consoleplayer].Team ));
2284+ Printf( "%s joined the \034%s%s " TEXTCOLOR_NORMAL "team.\n", players[consoleplayer].userinfo.GetName(), TEAM_GetTextColorName( players[consoleplayer].Team ), TEAM_GetName( players[consoleplayer].Team ));
22752285 }
22762286
22772287 if ( players[consoleplayer].mo )
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/team.h
--- a/src/team.h Sat Sep 18 20:16:32 2021 -0400
+++ b/src/team.h Sat Sep 18 11:27:48 2021 -0400
@@ -104,6 +104,7 @@
104104 void TEAM_SetColor( ULONG ulTeamIdx, int r, int g, int b );
105105 bool TEAM_IsCustomPlayerColorAllowed( ULONG ulTeamIdx );
106106
107+const char *TEAM_GetTextColorName( ULONG ulTeamIdx );
107108 ULONG TEAM_GetTextColor( ULONG ulTeamIdx );
108109 void TEAM_SetTextColor( ULONG ulTeamIdx, USHORT usColor );
109110
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/v_text.cpp
--- a/src/v_text.cpp Sat Sep 18 20:16:32 2021 -0400
+++ b/src/v_text.cpp Sat Sep 18 11:27:48 2021 -0400
@@ -699,12 +699,6 @@
699699 String = "Player";
700700 }
701701
702-// [RC] Converts COL_ numbers to their \c counterparts.
703-char V_GetColorChar( ULONG ulColor )
704-{
705- return (char) ( 97 + (int) ulColor );
706-}
707-
708702 // [RC] Escapes quotes and backslashes.
709703 void V_EscapeBacklashes( FString &String )
710704 {
diff -r e7e1ea6608a7 -r 7ecfc9dc9271 src/v_text.h
--- a/src/v_text.h Sat Sep 18 20:16:32 2021 -0400
+++ b/src/v_text.h Sat Sep 18 11:27:48 2021 -0400
@@ -86,7 +86,6 @@
8686 void V_RemoveColorCodes( FString &String );
8787 void V_RemoveColorCodes( char *pszString );
8888 void V_StripColors( char *pszString );
89-char V_GetColorChar( ULONG ulColor );
9089 void V_EscapeBacklashes( FString &String );
9190 void V_RemoveTrailingCrap( char *pszString );
9291 void V_RemoveTrailingCrapFromFString( FString &String );