Empathy: Display player scores at the main screen of the game
authorCarl Worth <cworth@cworth.org>
Wed, 10 Jun 2020 16:19:14 +0000 (09:19 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 10 Jun 2020 16:19:14 +0000 (09:19 -0700)
Leaving each off entirely if unset or 0.

empathy/empathy.jsx

index 54d6c2660975aac30c9376ba05cff1c4feef3048..21b766ab689c3c8c652275f16d495387e40faaaa 100644 (file)
@@ -127,10 +127,12 @@ const PlayerInfo = React.memo(props => {
     <div className="player-info">
       <span className="players-header">Players: </span>
       {props.player.name}
+      {props.player.score > 0 ? ` (${props.player.score})` : ""}
       {props.other_players.map(other => (
         <span key={other.id}>
           {", "}
           {other.name}
+          {other.score > 0 ? ` (${other.score})` : ""}
         </span>
       ))}
     </div>