From 8ff00e83cf15401150770fe3b31945413135eaa4 Mon Sep 17 00:00:00 2001 From: WEBXOSS Date: Wed, 1 Mar 2017 00:50:01 +0800 Subject: [PATCH] fix ener zone button --- Dialog.js | 2 +- Selector.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dialog.js b/Dialog.js index 8e94a89..d509b98 100644 --- a/Dialog.js +++ b/Dialog.js @@ -393,7 +393,7 @@ Dialog.prototype.selectSomeCards = function (title,cards,arg,callback) { Dialog.prototype.selectEner = function (title,cards,colors,cost,callback,onCancel) { var texts = cards.map(function (card) { - return card.cid === cost.source ? 'WARN' : ''; + return card.sid === cost.source ? 'WARN' : ''; },this); this.selectCardAdvanced(title,cards,texts,false,false,onSelectChange,callback,onCancel); diff --git a/Selector.js b/Selector.js index 1e0f94c..9575785 100644 --- a/Selector.js +++ b/Selector.js @@ -68,7 +68,7 @@ Selector.prototype.showButtons = function () { var buttonCarrier; var description = msg.descriptions[idx]; if (card.shouldUseDialog()) { - if (card.zone.constructor === TileZone && card.zone.name !== 'EnerZone') { + if (card.zone.constructor === TileZone) { buttonCarrier = this.game.buttonZone; } else { buttonCarrier = card.zone; @@ -76,6 +76,9 @@ Selector.prototype.showButtons = function () { } else { buttonCarrier = card; } + if (card.zone.name === 'EnerZone') { + buttonCarrier = card.zone.cards.length > 4 ? card.zone : card; + } var data; for (var i = 0; i < datas.length; i++) { var data= datas[i];