If a game is waiting for your decision, the title is blinking.
This commit is contained in:
@@ -878,6 +878,7 @@ var GempLotrGameUI = Class.extend({
|
|||||||
|
|
||||||
decisionFunction:function (decisionId, result) {
|
decisionFunction:function (decisionId, result) {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
this.stopAnimatingTitle();
|
||||||
this.communication.gameDecisionMade(decisionId, result,
|
this.communication.gameDecisionMade(decisionId, result,
|
||||||
this.channelNumber,
|
this.channelNumber,
|
||||||
function (xml) {
|
function (xml) {
|
||||||
@@ -1093,8 +1094,46 @@ var GempLotrGameUI = Class.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasDecision)
|
if (!hasDecision) {
|
||||||
this.animations.updateGameState(animate);
|
this.animations.updateGameState(animate);
|
||||||
|
} else {
|
||||||
|
this.startAnimatingTitle();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
keepAnimating: false,
|
||||||
|
|
||||||
|
startAnimatingTitle: function() {
|
||||||
|
var that = this;
|
||||||
|
this.keepAnimating = true;
|
||||||
|
setTimeout(function() {
|
||||||
|
that.setDecisionTitle();
|
||||||
|
}, 500);
|
||||||
|
},
|
||||||
|
|
||||||
|
stopAnimatingTitle: function() {
|
||||||
|
this.keepAnimating = false;
|
||||||
|
window.document.title = "Game of Gemp-LotR";
|
||||||
|
},
|
||||||
|
|
||||||
|
setDecisionTitle: function() {
|
||||||
|
if (this.keepAnimating) {
|
||||||
|
window.document.title = "Waiting for your decision";
|
||||||
|
var that = this;
|
||||||
|
setTimeout(function() {
|
||||||
|
that.setNormalTitle();
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
setNormalTitle: function() {
|
||||||
|
if (this.keepAnimating) {
|
||||||
|
window.document.title = "Game of Gemp-LotR";
|
||||||
|
var that = this;
|
||||||
|
setTimeout(function() {
|
||||||
|
that.setDecisionTitle();
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getPlayerIndex:function (playerId) {
|
getPlayerIndex:function (playerId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user