Browse Source

Add role indication in chatroom

Thomas Dy 11 years ago
parent
commit
6acd826eee
2 changed files with 6 additions and 0 deletions
  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>