• R/O
  • SSH

zandronum-sandbox-stable: Commit


Commit MetaInfo

Revision055e308e6015cb7f4a8c6c9a4ef0a1cbda59bdc4 (tree)
Time2022-09-15 08:36:08
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

cl_identifytarget now always prints a player's skin with their current class, if unmorphed. If cl_skins is 0, then the skin is always printed as "base" instead.

Change Summary

Incremental Difference

diff -r e957fcea64f3 -r 055e308e6015 docs/zandronum-history.txt
--- a/docs/zandronum-history.txt Wed Sep 14 15:33:59 2022 -0400
+++ b/docs/zandronum-history.txt Wed Sep 14 19:36:08 2022 -0400
@@ -90,7 +90,7 @@
9090 ! - The "spam" medal is now only awarded if the player frags another player with a projectile or puff that awards the medal, as it should be. [Kaminsky]
9191 ! - Blacklisted the connect, disconnect, reconnect, and restart CCMDs from ConsoleCommand. [Kaminsky]
9292 ! - gl_texture is now forced to be true when sv_forcevideodefaults is true. [Kaminsky]
93-! - cl_identifytarget now prints "ally" if the target is a teammate of the player being spied on, instead of the local player. [Kaminsky]
93+! - cl_identifytarget now prints "ally" if the target is a teammate of the player being spied on, instead of the local player. Also, it now always prints a player's skin with their current class, if unmorphed. If cl_skins is 0, then the skin is always printed as "base" instead. [Kaminsky]
9494
9595
9696 3.1
diff -r e957fcea64f3 -r 055e308e6015 src/g_shared/shared_sbar.cpp
--- a/src/g_shared/shared_sbar.cpp Wed Sep 14 15:33:59 2022 -0400
+++ b/src/g_shared/shared_sbar.cpp Wed Sep 14 19:36:08 2022 -0400
@@ -1869,18 +1869,46 @@
18691869 // [AK] Print this player's class.
18701870 if ( cl_identifytarget >= IDENTIFY_TARGET_CLASS )
18711871 {
1872- const char *szClassString;
1872+ FString classString;
18731873
1874- // [Cata] Display in this priority: Morph Class > Class > Skin.
1874+ // [AK] Display the name of the class the player is current playing as.
1875+ // If they're supposed to be morphed, don't print the name of their skin.
18751876 if ( pTargetPlayer->MorphedPlayerClass )
1876- szClassString = pTargetPlayer->MorphedPlayerClass->TypeName.GetChars();
1877- else if ( PlayerClasses.Size() > 1 )
1878- szClassString = GetPrintableDisplayName( pTargetPlayer->cls );
1877+ {
1878+ classString = pTargetPlayer->MorphedPlayerClass->TypeName.GetChars( );
1879+ }
18791880 else
1880- szClassString = skins[pTargetPlayer->userinfo.GetSkin()].name;
1881+ {
1882+ FString skinString;
1883+
1884+ if ( PlayerClasses.Size( ) > 1 )
1885+ classString = GetPrintableDisplayName( pTargetPlayer->cls );
1886+
1887+ if ( classString.IsNotEmpty( ))
1888+ classString += " - ";
1889+
1890+ // [AK] Get the name of the player's current skin, if skins are enabled.
1891+ // Their skin should only be displayed if they're playing the class meant
1892+ // for it. Otherwise, print "base" instead.
1893+ if ( cl_skins )
1894+ {
1895+ const int skin = pTargetPlayer->userinfo.GetSkin( );
1896+
1897+ for ( unsigned int i = 0; i < PlayerClasses.Size( ); i++ )
1898+ {
1899+ if (( pTargetPlayer->cls == PlayerClasses[i].Type ) && ( PlayerClasses[i].CheckSkin( skin )))
1900+ {
1901+ skinString += skins[skin].name;
1902+ break;
1903+ }
1904+ }
1905+ }
1906+
1907+ classString += skinString.IsNotEmpty( ) ? skinString : "Base";
1908+ }
18811909
18821910 targetInfoMsg += '\n';
1883- targetInfoMsg.AppendFormat( TEXTCOLOR_GREEN "%s", szClassString );
1911+ targetInfoMsg.AppendFormat( TEXTCOLOR_GREEN "%s", classString.GetChars( ));
18841912 }
18851913 }
18861914
diff -r e957fcea64f3 -r 055e308e6015 wadsrc/static/menudef.za
--- a/wadsrc/static/menudef.za Wed Sep 14 15:33:59 2022 -0400
+++ b/wadsrc/static/menudef.za Wed Sep 14 19:36:08 2022 -0400
@@ -25,7 +25,7 @@
2525 1.0, "Name"
2626 2.0, "Health and armor"
2727 3.0, "Weapon and ammo"
28- 4.0, "Class or skin"
28+ 4.0, "Class and skin"
2929 }
3030
3131 OptionMenu ZA_MultiplayerOptions
Show on old repository browser