Explorar el Código

Add role indication in chatroom

Thomas Dy hace 11 años
padre
commit
6acd826eee
Se han modificado 2 ficheros con 6 adiciones y 0 borrados
  1. 3 0
      public/javascripts/tabooServices.js
  2. 3 0
      public/partials/chatRoom.html

+ 3 - 0
public/javascripts/tabooServices.js

@@ -48,6 +48,9 @@ angular.module('tabooServices', [])
     game.round = null;
     game.card = null;
   };
+  game.isGuesser = function() {
+    return game.round.team.guessers.indexOf(Chat.username) >= 0;
+  };
   game.isMonitor = function() {
     return game.round.monitors.indexOf(Chat.username) >= 0;
   };

+ 3 - 0
public/partials/chatRoom.html

@@ -34,6 +34,9 @@
         <hr>
       </div>
       <div ng-if="game.roundRunning()">
+        <h3 ng-show="game.isPlayer()">you are the giver</button>
+        <h3 ng-show="game.isMonitor()">you are a monitor</button>
+        <h3 ng-show="game.isGuesser()">you are a guesser</button>
         <button class="btn" ng-show="game.isPlayer()" ng-click="game.pass()">Pass</button>
         <button class="btn" ng-show="game.isMonitor()" ng-click="game.taboo()">Uh-uh!</button>
         <button class="btn" ng-show="game.isMonitor() || game.isPlayer()" ng-click="game.correct()">Correct</button>