From 23b6fbca009397f8d4755f3707384af522d5c3a6 Mon Sep 17 00:00:00 2001 From: WEBXOSS Date: Wed, 1 Mar 2017 00:33:58 +0800 Subject: [PATCH] add warning for effect source to selectEner --- Dialog.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dialog.js b/Dialog.js index 7aa2b0a..8e94a89 100644 --- a/Dialog.js +++ b/Dialog.js @@ -392,7 +392,10 @@ Dialog.prototype.selectSomeCards = function (title,cards,arg,callback) { }; Dialog.prototype.selectEner = function (title,cards,colors,cost,callback,onCancel) { - this.selectCardAdvanced(title,cards,null,false,false,onSelectChange,callback,onCancel); + var texts = cards.map(function (card) { + return card.cid === cost.source ? 'WARN' : ''; + },this); + this.selectCardAdvanced(title,cards,texts,false,false,onSelectChange,callback,onCancel); function onSelectChange (selectedIndexes,disable) { var need = {};