]> git.cworth.org Git - lmno.games/blobdiff - tictactoe/tictactoe.jsx
Subtle refinement of the status message.
[lmno.games] / tictactoe / tictactoe.jsx
index ca0bce3fd4985bf8636893cbfeae92ea4235508b..3e75573ee2d872f31bef1084ec0a48c2f1d78245 100644 (file)
@@ -342,7 +342,17 @@ class Game extends React.Component {
     }
     else if (first_move)
     {
-      status = "Either player can make the first move.";
+      if (state.opponent_info.length == 0) {
+        status = "You can make the first move or wait for an opponent to join.";
+      } else {
+        let qualifier;
+        if (state.opponent_info.length == 1) {
+          qualifier = "Either";
+        } else {
+          qualifier = "Any";
+        }
+        status = `${qualifier} player can make the first move.`;
+      }
       board_active = true;
     }
     else if (my_team === "")
@@ -357,7 +367,12 @@ class Game extends React.Component {
     }
     else
     {
-      status = "Waiting for your opponent to move.";
+      status = "Waiting for your opponent to ";
+      if (state.opponent_info.length == 0) {
+        status += "join.";
+      } else {
+        status += "move.";
+      }
       board_active = false;
     }