This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)
Revisão | cca76668e470b1756b59739dcf90c870898370a6 (tree) |
---|---|
Hora | 2022-12-16 05:59:08 |
Autor | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Refactored TEAM_DoWinSequence and replaced C-style char arrays with FString. This also fixes an inconsistency in the fadeout times if whether or not the server prints the message.
@@ -731,34 +731,22 @@ | ||
731 | 731 | // |
732 | 732 | void TEAM_DoWinSequence( ULONG ulTeamIdx ) |
733 | 733 | { |
734 | - char szString[32]; | |
735 | - DHUDMessageFadeOut *pMsg; | |
734 | + FString message; | |
735 | + EColorRange color; | |
736 | 736 | |
737 | 737 | // Display "%s WINS!" HUD message. |
738 | - if ( ulTeamIdx < teams.Size( ) ) | |
739 | - sprintf( szString, "\\c%s%s WINS!", TEAM_GetTextColorName( ulTeamIdx ), TEAM_GetName( ulTeamIdx ) ); | |
740 | - else | |
741 | - sprintf( szString, "DRAW GAME!\n" ); | |
742 | - | |
743 | - V_ColorizeString( szString ); | |
744 | - | |
745 | - if ( NETWORK_GetState( ) != NETSTATE_SERVER ) | |
738 | + if ( ulTeamIdx < teams.Size( )) | |
746 | 739 | { |
747 | - pMsg = new DHUDMessageFadeOut( BigFont, szString, | |
748 | - 160.4f, | |
749 | - 75.0f, | |
750 | - 320, | |
751 | - 200, | |
752 | - CR_UNTRANSLATED, | |
753 | - 3.0f, | |
754 | - 2.0f ); | |
755 | - | |
756 | - StatusBar->AttachMessage( pMsg, MAKE_ID('C','N','T','R') ); | |
740 | + message.AppendFormat( "%s WINS!", TEAM_GetName( ulTeamIdx )); | |
741 | + color = static_cast<EColorRange>( TEAM_GetTextColor( ulTeamIdx )); | |
757 | 742 | } |
758 | 743 | else |
759 | 744 | { |
760 | - SERVERCOMMANDS_PrintHUDMessage( szString, 160.4f, 75.0f, 320, 200, HUDMESSAGETYPE_FADEOUT, CR_RED, 3.0f, 0.0f, 0.25f, "BigFont", MAKE_ID( 'C', 'N', 'T', 'R' ) ); | |
745 | + message = "DRAW GAME!"; | |
746 | + color = CR_RED; | |
761 | 747 | } |
748 | + | |
749 | + HUD_DrawStandardMessage( message.GetChars( ), color, false, 3.0f, 2.0f, true ); | |
762 | 750 | } |
763 | 751 | |
764 | 752 | //***************************************************************************** |