message updates; disable new game on cpu due to corrupt game start

This commit is contained in:
Lurkars
2017-04-18 23:04:17 +02:00
parent 075143bc21
commit 18215f4e71
3 changed files with 51 additions and 26 deletions
+9 -5
View File
@@ -112,7 +112,7 @@ Interface.prototype.setDices = function(dices) {
};
Interface.prototype.animateDices = function(dices, callback) {
Interface.prototype.animateDices = function(dices, timeout, callback) {
var self = this;
for (var diceIndex = 0; diceIndex < 6; diceIndex++) {
var dice = dices[diceIndex];
@@ -129,7 +129,11 @@ Interface.prototype.animateDices = function(dices, callback) {
if (callback) {
callback();
}
}, 500);
}, timeout ? timeout : 0);
};
Interface.prototype.disableRestart = function(disabled) {
this.restartButton.disabled = disabled;
};
Interface.prototype.disableTakePoints = function(disabled) {
@@ -178,17 +182,17 @@ Interface.prototype.setCpu = function(cpu) {
this.cpuZilch.innerHTML = zilchs;
};
Interface.prototype.showMessage = function(message, fade, callback) {
Interface.prototype.showMessage = function(message, timeout, callback) {
var self = this;
self.message.innerHTML = '<p>' + message + '</p>';
self.message.classList.add('visible');
if (fade) {
if (timeout) {
setTimeout(function() {
self.clearMessage(callback);
}, fade);
}, timeout);
} else if (callback) {
callback();
}