• R/O
  • SSH

zandronum-sandbox-stable: Commit


Commit MetaInfo

Revisionf69316e9f35c2a911ace4d6a20c6d0c26a03dfde (tree)
Time2022-09-15 15:25:55
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Refactored unformatted color strings that were used in HUD_DrawCoopInfo.

Change Summary

Incremental Difference

diff -r 1892b63c7310 -r f69316e9f35c src/g_shared/st_hud.cpp
--- a/src/g_shared/st_hud.cpp Thu Sep 15 02:07:17 2022 -0400
+++ b/src/g_shared/st_hud.cpp Thu Sep 15 02:25:55 2022 -0400
@@ -710,7 +710,6 @@
710710
711711 // [BB] Draw player name.
712712 drawString = players[i].userinfo.GetName();
713- V_ColorizeString( drawString );
714713 EColorRange nameColor = CR_GREY;
715714 // [BB] If the player is on a team, use the team's text color.
716715 if ( GAMEMODE_GetCurrentFlags() & GMF_PLAYERSONTEAMS )
@@ -737,8 +736,8 @@
737736 int healthPercentage = ( 100 * players[i].mo->health ) / players[i].mo->GetMaxHealth();
738737
739738 AInventory* pArmor = players[i].mo->FindInventory(RUNTIME_CLASS(ABasicArmor));
740- drawString.Format( "%d \\cD/ %d", players[i].mo->health, pArmor ? pArmor->Amount : 0 );
741- V_ColorizeString( drawString );
739+ drawString.Format( "%d" TEXTCOLOR_GREEN " / %d", players[i].mo->health, pArmor ? pArmor->Amount : 0 );
740+
742741 if ( healthPercentage > 75 )
743742 healthColor = CR_GREEN;
744743 else if ( healthPercentage > 50 )
@@ -757,12 +756,12 @@
757756 {
758757 drawString = players[i].ReadyWeapon->GetTag();
759758 if ( players[i].ReadyWeapon->Ammo1 && ( ( dmflags & DF_INFINITE_AMMO ) == false ) )
760- drawString.AppendFormat( " \\cf%d", players[i].ReadyWeapon->Ammo1->Amount );
759+ drawString.AppendFormat( TEXTCOLOR_GOLD " %d", players[i].ReadyWeapon->Ammo1->Amount );
761760 else
762- drawString += " \\cg-";
761+ drawString += TEXTCOLOR_RED " -";
763762 if ( players[i].ReadyWeapon->Ammo2 && ( ( dmflags & DF_INFINITE_AMMO ) == false ) )
764- drawString.AppendFormat( " \\cf%d", players[i].ReadyWeapon->Ammo2->Amount );
765- V_ColorizeString( drawString );
763+ drawString.AppendFormat( TEXTCOLOR_GOLD " %d", players[i].ReadyWeapon->Ammo2->Amount );
764+
766765 HUD_DrawTextAligned ( CR_GREEN, curYPos, drawString.GetChars(), drawLeft, g_bScale );
767766 }
768767
Show on old repository browser