Stop emitting the (temporarily ?) deprecated Quit message at the endof a game and factorize the function to go back to main menu instead
This commit is contained in:
parent
38ccd13634
commit
421b91c0ff
1 changed files with 6 additions and 11 deletions
|
@ -38,13 +38,15 @@ function init(gameID) {
|
|||
);
|
||||
}
|
||||
|
||||
function backToMain() {
|
||||
window.location = '..';
|
||||
}
|
||||
|
||||
function fail(errorCode) {
|
||||
return function(f) {
|
||||
Screen.dialog({
|
||||
text: I18n.get(errorCode),
|
||||
answers: [
|
||||
{label: 'backToMain', action: function() {window.location = '..';}}
|
||||
]
|
||||
answers: [{label: 'backToMain', action: backToMain}]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -160,14 +162,7 @@ function gameEnd(o, f) {
|
|||
}
|
||||
Screen.dialog({
|
||||
text: I18n.get(Session.is(winner) ? 'won' : 'lost'),
|
||||
answers: [{
|
||||
label: 'endGame',
|
||||
action: function() {
|
||||
Messaging.send({tag: "Quit"});
|
||||
Screen.select('reception');
|
||||
f();
|
||||
}
|
||||
}]
|
||||
answers: [{label: 'endGame', action: backToMain}]
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue