Skip to content

Commit

Permalink
display clock side to player's name: as the countdown doesn't see on …
Browse files Browse the repository at this point in the history
…some mobile devices, the below code also provides a way to see how much time is left.

Enhaced chat message
  • Loading branch information
Vituchon committed Aug 23, 2024
1 parent 0238657 commit 5697814
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions presentation/web/assets/html/game.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h2>Juego <i>{{ctr.game.name}}</i></h2>
<div class="flex"></div>
<div ng-if="ctr.isChatEnabled">
<div class="send-message-control">
<input id="chat-message-input" class="text" placeholder="Escribe un mensaje" ng-model="ctr.playerMessage.text" >
<input id="chat-message-input" class="text" placeholder="Escribi un mensaje y presiona enter (o el botón enviar)" ng-model="ctr.playerMessage.text" >
<button class="materialButton raised colorButton" style="display: flex; flex-direction: column;; margin-left: 1em;" ng-disabled="!ctr.canSendMessage(ctr.playerMessage)" title="Podés apretar enter para enviar" ng-click="ctr.sendAndCleanMessage(ctr.playerMessage);">
<span>Enviar</span>
<span id="chat-press-enter-hint">(ó enter)</span>
Expand All @@ -55,7 +55,7 @@ <h3>Jugadores</h3>
<div class="game-player-header" ng-repeat="player in ctr.game.players track by player.id">
<span>{{$index+1}}. <span ng-class="{'player-name': true, 'current-turn-player' : (ctr.currentTurnPlayer.id === player.id)}">{{player.name}}</span></span>
<span ng-if="ctr.isPlayerGameOwner(ctr.game,player)" style="font-size: 2rem;">🪑</span>
<i ng-if="(ctr.currentTurnPlayer.id === player.id) && !ctr.isPlayerTurn">⏱️: {{ctr.remainingSecondsToPerformAction}}</i>
<i ng-if="(ctr.currentTurnPlayer.id === player.id)">⏱️: {{ctr.remainingSecondsToPerformAction}}</i>
<span style="width: 10px;"></span>
<!-- using ng-if=ng-show="ctr.player.name !== player.name" doesn't works here! -->
<div ng-show="ctr.player.name != player.name" class="materialButton raised colorButton see-player-button" title="chusmear al jugador" ng-click="peekPlayer = !peekPlayer">
Expand Down
4 changes: 2 additions & 2 deletions presentation/web/assets/js/ts/controllers/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ namespace Game {
this.$interval.cancel(this.countdownInterval);
if (this.isPlayerTurn) {
this.countdownHandler?.start?.();
} else {
} //else { as the countdown doesn't see on some mobile devices, the below code also provides a way to see how much time is left.
this.remainingSecondsToPerformAction = this.secondsToPerformAction
this.countdownInterval = this.$interval(() => {
if (this.remainingSecondsToPerformAction > 0) {
Expand All @@ -693,7 +693,7 @@ namespace Game {
this.$interval.cancel(this.countdownInterval);
}
}, 1000);
}
//}
return this.updateGameStats(currentMatchIndex).then(() => {
return this.game
})
Expand Down

0 comments on commit 5697814

Please sign in to comment.