X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=e16fa2f8b7a8fc7991d4cae61bbc0faba01fb264;hp=0c3de58f9150a4061f6f4ce68e30dcc6bc3b6b6b;hb=050ae3b58673dfa1ed41bf78d935fe95ec9e74c5;hpb=58e7b94e6e1a8d5721b9211b45c40e65fc13f600 diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 0c3de58f..e16fa2f8 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -7,14 +7,19 @@ main Chat(:players="game.players" :pastChats="game.chats" @newchat-sent="finishSendChat" @newchat-received="processChat") .row - .col-sm-12.col-md-9.col-md-offset-3.col-lg-10.col-lg-offset-2 + #aboveBoard.col-sm-12.col-md-9.col-md-offset-3.col-lg-10.col-lg-offset-2 button#chatBtn(onClick="doClick('modalChat')") Chat #actions(v-if="game.mode!='analyze' && game.score=='*'") button(@click="offerDraw") Draw button(@click="abortGame") Abort button(@click="resign") Resign - div Names: {{ game.players[0].name }} - {{ game.players[1].name }} - div(v-if="game.score=='*'") Time: {{ virtualClocks[0] }} - {{ virtualClocks[1] }} + #playersInfo + p + span.name(:class="{connected: isConnected(0)}") {{ game.players[0].name }} + span.time(v-if="game.score=='*'") {{ virtualClocks[0] }} + span.split-names - + span.name(:class="{connected: isConnected(1)}") {{ game.players[1].name }} + span.time(v-if="game.score=='*'") {{ virtualClocks[1] }} BaseGame(:game="game" :vr="vr" ref="basegame" @newmove="processMove" @gameover="gameOver") @@ -126,6 +131,12 @@ export default { roomInit: function() { this.st.conn.send(JSON.stringify({code:"pollclients"})); }, + isConnected: function(index) { + const name = this.game.players[index].name; + if (this.st.user.name == name) + return true; + return this.people.some(p => p.name == name); + }, socketMessageListener: function(msg) { const data = JSON.parse(msg.data); switch (data.code) @@ -544,9 +555,7 @@ export default {