mirror of
https://github.com/webxoss/webxoss-client.git
synced 2024-11-20 05:49:55 +01:00
make SigniZone checkable && action effect button on EnerZone
This commit is contained in:
parent
ea66554769
commit
62eec8e4dd
8 changed files with 42 additions and 29 deletions
6
Card.js
6
Card.js
|
@ -174,6 +174,12 @@ Card.prototype.addButton = function (txt,onclick) {
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// 兼容参数为 button
|
||||||
|
if (txt.constructor === Button) {
|
||||||
|
var btn = txt;
|
||||||
|
this.buttonLayer.addButton(btn);
|
||||||
|
return;
|
||||||
|
}
|
||||||
var btn = new Button(txt,onclick.bind(this,this));
|
var btn = new Button(txt,onclick.bind(this,this));
|
||||||
this.buttonLayer.addButton(btn);
|
this.buttonLayer.addButton(btn);
|
||||||
// this.outlineOn();
|
// this.outlineOn();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<!-- <html> -->
|
<html>
|
||||||
<html manifest="../webxoss.appcache">
|
<!-- <html manifest="../webxoss.appcache"> -->
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>DeckEditor</title>
|
<title>DeckEditor</title>
|
||||||
|
@ -73,12 +73,12 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script src="../Localize.min.js"></script>
|
<!-- <script src="../Localize.min.js"></script>
|
||||||
<script src="../ImageAndDetail.min.js"></script>
|
<script src="../ImageAndDetail.min.js"></script>
|
||||||
<script src="./Deck.min.js"></script>
|
<script src="./Deck.min.js"></script>
|
||||||
<script src="./DeckEditor.js"></script>
|
<script src="./DeckEditor.js"></script> -->
|
||||||
|
|
||||||
<!-- <script src="../lib/util.js"></script>
|
<script src="../lib/util.js"></script>
|
||||||
<script src="../Localize.js"></script>
|
<script src="../Localize.js"></script>
|
||||||
<script src="../ImageFileCache.js"></script>
|
<script src="../ImageFileCache.js"></script>
|
||||||
<script src="../ImageManager.js"></script>
|
<script src="../ImageManager.js"></script>
|
||||||
|
@ -86,6 +86,6 @@
|
||||||
<script src="../DeckManager.js"></script>
|
<script src="../DeckManager.js"></script>
|
||||||
<script src="./Rules.js"></script>
|
<script src="./Rules.js"></script>
|
||||||
<script src="./Searcher.js"></script>
|
<script src="./Searcher.js"></script>
|
||||||
<script src="./editor.js"></script> -->
|
<script src="./editor.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -28,6 +28,7 @@ function ImageManager (dir) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageManager.prototype.getUrlByPid = function (pid) {
|
ImageManager.prototype.getUrlByPid = function (pid) {
|
||||||
|
if (!pid) return this.black.src;
|
||||||
var url = window.ImageFileCache.getUrlByPid(pid);
|
var url = window.ImageFileCache.getUrlByPid(pid);
|
||||||
if (url) return url;
|
if (url) return url;
|
||||||
url = this.dir + 'images/' + ('0000' + pid).slice(-4) + '.jpg';
|
url = this.dir + 'images/' + ('0000' + pid).slice(-4) + '.jpg';
|
||||||
|
|
|
@ -1314,8 +1314,8 @@ var map_ru = {
|
||||||
'アイヤイ': 'Aiyai',
|
'アイヤイ': 'Aiyai',
|
||||||
'アルフォウ': 'Alfou',
|
'アルフォウ': 'Alfou',
|
||||||
'ハナレ': 'Hanare',
|
'ハナレ': 'Hanare',
|
||||||
'リル': 'リル',
|
'リル': 'Ril',
|
||||||
'メル': 'メル',
|
'メル': 'Mel',
|
||||||
'精像': 'Миф',
|
'精像': 'Миф',
|
||||||
'天使': 'Ангел',
|
'天使': 'Ангел',
|
||||||
'悪魔': 'Демон',
|
'悪魔': 'Демон',
|
||||||
|
|
|
@ -68,7 +68,7 @@ Selector.prototype.showButtons = function () {
|
||||||
var buttonCarrier;
|
var buttonCarrier;
|
||||||
var description = msg.descriptions[idx];
|
var description = msg.descriptions[idx];
|
||||||
if (card.shouldUseDialog()) {
|
if (card.shouldUseDialog()) {
|
||||||
if (card.zone.constructor === TileZone) {
|
if (card.zone.constructor === TileZone && card.zone.name !== 'EnerZone') {
|
||||||
buttonCarrier = this.game.buttonZone;
|
buttonCarrier = this.game.buttonZone;
|
||||||
} else {
|
} else {
|
||||||
buttonCarrier = card.zone;
|
buttonCarrier = card.zone;
|
||||||
|
|
32
Zone.js
32
Zone.js
|
@ -79,12 +79,24 @@ Zone.prototype.update = function () {
|
||||||
var txt = (this._amount === 0)? '' : this._amount;
|
var txt = (this._amount === 0)? '' : this._amount;
|
||||||
this.setText(txt);
|
this.setText(txt);
|
||||||
}
|
}
|
||||||
var changed = this.changed;
|
var changed = this.buttonLayer.update() || this.changed;
|
||||||
this.changed = false;
|
this.changed = false;
|
||||||
return changed;
|
return changed;
|
||||||
};
|
};
|
||||||
Zone.prototype.addButton = function () {};
|
Zone.prototype.addButton = function (txt,onclick/*,card*/) {
|
||||||
Zone.prototype.removeButtons = function () {};
|
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) {
|
Zone.prototype.setText = function (txt) {
|
||||||
this.changed = true;
|
this.changed = true;
|
||||||
if (!txt) {
|
if (!txt) {
|
||||||
|
@ -149,18 +161,6 @@ StackZone.prototype.updateCardPosition = function () {
|
||||||
},this);
|
},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 () {
|
StackZone.prototype.addViewCardsButton = function () {
|
||||||
this.buttonLayer.addButton(this.viewCardsButton);
|
this.buttonLayer.addButton(this.viewCardsButton);
|
||||||
};
|
};
|
||||||
|
@ -187,7 +187,7 @@ Zone.prototype.removeStates = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
StackZone.prototype.update = function () {
|
StackZone.prototype.update = function () {
|
||||||
var changed = this.buttonLayer.update() || this.changed;
|
var changed = this.changed;
|
||||||
if (this.showPower) {
|
if (this.showPower) {
|
||||||
if (this._amount !== this.cards.length) {
|
if (this._amount !== this.cards.length) {
|
||||||
this._amount = this.cards.length;
|
this._amount = this.cards.length;
|
||||||
|
|
|
@ -21,6 +21,7 @@ Game.prototype.initZones = function () {
|
||||||
name: 'SigniZone',
|
name: 'SigniZone',
|
||||||
x: 190,
|
x: 190,
|
||||||
y: 421,
|
y: 421,
|
||||||
|
checkable: true,
|
||||||
showPower: true
|
showPower: true
|
||||||
}),
|
}),
|
||||||
new StackZone({
|
new StackZone({
|
||||||
|
@ -28,6 +29,7 @@ Game.prototype.initZones = function () {
|
||||||
name: 'SigniZone',
|
name: 'SigniZone',
|
||||||
x: 288,
|
x: 288,
|
||||||
y: 421,
|
y: 421,
|
||||||
|
checkable: true,
|
||||||
showPower: true
|
showPower: true
|
||||||
}),
|
}),
|
||||||
new StackZone({
|
new StackZone({
|
||||||
|
@ -35,6 +37,7 @@ Game.prototype.initZones = function () {
|
||||||
name: 'SigniZone',
|
name: 'SigniZone',
|
||||||
x: 386,
|
x: 386,
|
||||||
y: 421,
|
y: 421,
|
||||||
|
checkable: true,
|
||||||
showPower: true
|
showPower: true
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
@ -134,6 +137,7 @@ Game.prototype.initZones = function () {
|
||||||
name: 'SigniZone',
|
name: 'SigniZone',
|
||||||
x: 576-190,
|
x: 576-190,
|
||||||
y: 734-421,
|
y: 734-421,
|
||||||
|
checkable: true,
|
||||||
showPower: true,
|
showPower: true,
|
||||||
opposite: true
|
opposite: true
|
||||||
}),
|
}),
|
||||||
|
@ -142,6 +146,7 @@ Game.prototype.initZones = function () {
|
||||||
name: 'SigniZone',
|
name: 'SigniZone',
|
||||||
x: 576-288,
|
x: 576-288,
|
||||||
y: 734-421,
|
y: 734-421,
|
||||||
|
checkable: true,
|
||||||
showPower: true,
|
showPower: true,
|
||||||
opposite: true
|
opposite: true
|
||||||
}),
|
}),
|
||||||
|
@ -150,6 +155,7 @@ Game.prototype.initZones = function () {
|
||||||
name: 'SigniZone',
|
name: 'SigniZone',
|
||||||
x: 576-386,
|
x: 576-386,
|
||||||
y: 734-421,
|
y: 734-421,
|
||||||
|
checkable: true,
|
||||||
showPower: true,
|
showPower: true,
|
||||||
opposite: true
|
opposite: true
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -227,12 +227,12 @@
|
||||||
<script src="./CardInfo_ru.js" defer="defer"></script>
|
<script src="./CardInfo_ru.js" defer="defer"></script>
|
||||||
<script src="./CardInfo_ko.js" defer="defer"></script>
|
<script src="./CardInfo_ko.js" defer="defer"></script>
|
||||||
|
|
||||||
<script src="./Localize.min.js" defer="defer"></script>
|
<!-- <script src="./Localize.min.js" defer="defer"></script>
|
||||||
<script src="./ImageAndDetail.min.js" defer="defer"></script>
|
<script src="./ImageAndDetail.min.js" defer="defer"></script>
|
||||||
<script src="./DeckEditor/Deck.min.js" defer="defer"></script>
|
<script src="./DeckEditor/Deck.min.js" defer="defer"></script>
|
||||||
<script src="./webxoss.js" defer="defer"></script>
|
<script src="./webxoss.js" defer="defer"></script> -->
|
||||||
|
|
||||||
<!-- <script src="./Localize.js" defer="defer"></script>
|
<script src="./Localize.js" defer="defer"></script>
|
||||||
<script src="./ImageFileCache.js" defer="defer"></script>
|
<script src="./ImageFileCache.js" defer="defer"></script>
|
||||||
<script src="./ImageManager.js" defer="defer"></script>
|
<script src="./ImageManager.js" defer="defer"></script>
|
||||||
<script src="./Detail.js" defer="defer"></script>
|
<script src="./Detail.js" defer="defer"></script>
|
||||||
|
@ -257,6 +257,6 @@
|
||||||
<script src="./DeckManager.js" defer="defer"></script>
|
<script src="./DeckManager.js" defer="defer"></script>
|
||||||
<script src="./DeckEditor/Rules.js" defer="defer"></script>
|
<script src="./DeckEditor/Rules.js" defer="defer"></script>
|
||||||
<script src="./DeckEditor/Searcher.js" defer="defer"></script>
|
<script src="./DeckEditor/Searcher.js" defer="defer"></script>
|
||||||
<script src="./RoomManager.js" defer="defer"></script> -->
|
<script src="./RoomManager.js" defer="defer"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in a new issue