projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A few fixes, specify Apocalypse rules, draft Arena
[xogo.git]
/
base_rules.js
diff --git
a/base_rules.js
b/base_rules.js
index
08e9d1b
..
0b7d6ed
100644
(file)
--- a/
base_rules.js
+++ b/
base_rules.js
@@
-117,7
+117,7
@@
export default class ChessRules {
}
// Some variants reveal moves only after both players played
}
// Some variants reveal moves only after both players played
- hideMoves() {
+
get
hideMoves() {
return false;
}
return false;
}
@@
-2631,7
+2631,7
@@
export default class ChessRules {
return 0; //nb of targets
}
return 0; //nb of targets
}
- launchAnimation(moves, callback) {
+ launchAnimation(moves, c
ontainer, c
allback) {
if (this.hideMoves) {
moves.forEach(m => this.play(m));
callback();
if (this.hideMoves) {
moves.forEach(m => this.play(m));
callback();
@@
-2658,10
+2658,17
@@
export default class ChessRules {
alert("New move! Let's go back to game...");
document.getElementById("gameInfos").style.display = "none";
container.style.display = "block";
alert("New move! Let's go back to game...");
document.getElementById("gameInfos").style.display = "none";
container.style.display = "block";
- setTimeout(() => this.launchAnimation(moves, callback), 700);
+ setTimeout(
+ () => this.launchAnimation(moves, container, callback),
+ 700
+ );
+ }
+ else {
+ setTimeout(
+ () => this.launchAnimation(moves, container, callback),
+ delay || 0
+ );
}
}
- else
- setTimeout(() => this.launchAnimation(moves, callback), delay || 0);
};
let container = document.getElementById(this.containerId);
if (document.hidden) {
};
let container = document.getElementById(this.containerId);
if (document.hidden) {