diff --git a/Card.js b/Card.js index f8d1ed4..6dcf3db 100644 --- a/Card.js +++ b/Card.js @@ -174,6 +174,12 @@ Card.prototype.addButton = function (txt,onclick) { // return; // } + // 兼容参数为 button + if (txt.constructor === Button) { + var btn = txt; + this.buttonLayer.addButton(btn); + return; + } var btn = new Button(txt,onclick.bind(this,this)); this.buttonLayer.addButton(btn); // this.outlineOn(); diff --git a/DeckEditor/index.html b/DeckEditor/index.html index a346a61..6543000 100644 --- a/DeckEditor/index.html +++ b/DeckEditor/index.html @@ -1,6 +1,6 @@ - - + + DeckEditor @@ -73,12 +73,12 @@ - + - + \ No newline at end of file diff --git a/ImageManager.js b/ImageManager.js index 4bff935..8c17014 100644 --- a/ImageManager.js +++ b/ImageManager.js @@ -28,6 +28,7 @@ function ImageManager (dir) { } ImageManager.prototype.getUrlByPid = function (pid) { + if (!pid) return this.black.src; var url = window.ImageFileCache.getUrlByPid(pid); if (url) return url; url = this.dir + 'images/' + ('0000' + pid).slice(-4) + '.jpg'; diff --git a/Localize.js b/Localize.js index 8358dfb..54bc348 100644 --- a/Localize.js +++ b/Localize.js @@ -1314,8 +1314,8 @@ var map_ru = { 'アイヤイ': 'Aiyai', 'アルフォウ': 'Alfou', 'ハナレ': 'Hanare', - 'リル': 'リル', - 'メル': 'メル', + 'リル': 'Ril', + 'メル': 'Mel', '精像': 'Миф', '天使': 'Ангел', '悪魔': 'Демон', diff --git a/Selector.js b/Selector.js index 399305a..1e0f94c 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) { + if (card.zone.constructor === TileZone && card.zone.name !== 'EnerZone') { buttonCarrier = this.game.buttonZone; } else { buttonCarrier = card.zone; diff --git a/Zone.js b/Zone.js index 3557623..a048a27 100644 --- a/Zone.js +++ b/Zone.js @@ -79,12 +79,24 @@ Zone.prototype.update = function () { var txt = (this._amount === 0)? '' : this._amount; this.setText(txt); } - var changed = this.changed; + var changed = this.buttonLayer.update() || this.changed; this.changed = false; return changed; }; -Zone.prototype.addButton = function () {}; -Zone.prototype.removeButtons = function () {}; +Zone.prototype.addButton = function (txt,onclick/*,card*/) { + var btn = new Button(txt,onclick.bind(this,this)); + this.buttonLayer.addButton(btn); +}; +Zone.prototype.removeButtons = function () { + this.buttonLayer.removeAllButtons(); + if (this.checkable && this.cards.length>1) { + if (this.name === 'SigniZone') { + this.cards[0].addButton(this.viewCardsButton); + } else { + this.buttonLayer.addButton(this.viewCardsButton); + } + } +}; Zone.prototype.setText = function (txt) { this.changed = true; if (!txt) { @@ -149,18 +161,6 @@ StackZone.prototype.updateCardPosition = function () { },this); }; -StackZone.prototype.addButton = function (txt,onclick/*,card*/) { - var btn = new Button(txt,onclick.bind(this,this)); - this.buttonLayer.addButton(btn); -}; - -StackZone.prototype.removeButtons = function () { - this.buttonLayer.removeAllButtons(); - if (this.checkable && this.cards.length>1) { - this.buttonLayer.addButton(this.viewCardsButton); - } -}; - StackZone.prototype.addViewCardsButton = function () { this.buttonLayer.addButton(this.viewCardsButton); }; @@ -187,7 +187,7 @@ Zone.prototype.removeStates = function () { }; StackZone.prototype.update = function () { - var changed = this.buttonLayer.update() || this.changed; + var changed = this.changed; if (this.showPower) { if (this._amount !== this.cards.length) { this._amount = this.cards.length; diff --git a/ZonePosition.js b/ZonePosition.js index e4bb0b8..05ca3bd 100644 --- a/ZonePosition.js +++ b/ZonePosition.js @@ -21,6 +21,7 @@ Game.prototype.initZones = function () { name: 'SigniZone', x: 190, y: 421, + checkable: true, showPower: true }), new StackZone({ @@ -28,6 +29,7 @@ Game.prototype.initZones = function () { name: 'SigniZone', x: 288, y: 421, + checkable: true, showPower: true }), new StackZone({ @@ -35,6 +37,7 @@ Game.prototype.initZones = function () { name: 'SigniZone', x: 386, y: 421, + checkable: true, showPower: true }), ], @@ -134,6 +137,7 @@ Game.prototype.initZones = function () { name: 'SigniZone', x: 576-190, y: 734-421, + checkable: true, showPower: true, opposite: true }), @@ -142,6 +146,7 @@ Game.prototype.initZones = function () { name: 'SigniZone', x: 576-288, y: 734-421, + checkable: true, showPower: true, opposite: true }), @@ -150,6 +155,7 @@ Game.prototype.initZones = function () { name: 'SigniZone', x: 576-386, y: 734-421, + checkable: true, showPower: true, opposite: true }), diff --git a/index.html b/index.html index fb72d88..741e965 100644 --- a/index.html +++ b/index.html @@ -227,12 +227,12 @@ - + - + \ No newline at end of file