From ff57f7b81016de1b56f6cec5ee15d302b63a8f73 Mon Sep 17 00:00:00 2001 From: WEBXOSS Date: Tue, 28 Feb 2017 23:55:46 +0800 Subject: [PATCH] show coin --- Game.js | 7 ++++--- ZonePosition.js | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Game.js b/Game.js index 4a89284..4768c72 100644 --- a/Game.js +++ b/Game.js @@ -419,12 +419,13 @@ Game.prototype.handleSelectCardId = function (msg) { return true; }; -Game.prototype.handleConfirm = function (msg) { - // TODO... +Game.prototype.handleCoinChange = function (msg) { + var player = msg.player === this.player.sid ? this.player : this.opponent; + player.coinZone.setText('Coin' + msg.coin); return true; }; -Game.prototype.handleCoinChange = function (msg) { +Game.prototype.handleConfirm = function (msg) { if (this.skip) return true; var title = Localize.labelToDialogTitle('CONFIRM'); var text = Localize('gameText',msg.text); diff --git a/ZonePosition.js b/ZonePosition.js index 05ca3bd..8af9df0 100644 --- a/ZonePosition.js +++ b/ZonePosition.js @@ -93,10 +93,17 @@ Game.prototype.initZones = function () { up: false, horizontal: true, center: false, - width: 357, + width: Card.HEIGHT*3, spacing: -Card.HEIGHT*2/3, showAmount: true }), + coinZone: new StackZone({ + game: this, + name: 'CoinZone', + x: 471.5, + y: 604.5, + centerText: true, + }), excludedZone: new StackZone({ game: this, name: 'ExcludedZone', @@ -218,10 +225,17 @@ Game.prototype.initZones = function () { up: false, horizontal: true, center: false, - width: 357, + width: Card.HEIGHT*3, spacing: -Card.HEIGHT*2/3, showAmount: true }), + coinZone: new StackZone({ + game: this, + name: 'CoinZone', + x: 576-471.5, + y: 734-604.5, + centerText: true, + }), excludedZone: new StackZone({ game: this, name: 'ExcludedZone', @@ -249,4 +263,6 @@ Game.prototype.initZones = function () { y: 519, centerText: true }); + this.player.coinZone.text.font = '14px monospace'; + this.opponent.coinZone.text.font = '14px monospace'; }; \ No newline at end of file