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) {
|
function fail(errorCode) {
|
||||||
return function(f) {
|
return function(f) {
|
||||||
Screen.dialog({
|
Screen.dialog({
|
||||||
text: I18n.get(errorCode),
|
text: I18n.get(errorCode),
|
||||||
answers: [
|
answers: [{label: 'backToMain', action: backToMain}]
|
||||||
{label: 'backToMain', action: function() {window.location = '..';}}
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,14 +162,7 @@ function gameEnd(o, f) {
|
||||||
}
|
}
|
||||||
Screen.dialog({
|
Screen.dialog({
|
||||||
text: I18n.get(Session.is(winner) ? 'won' : 'lost'),
|
text: I18n.get(Session.is(winner) ? 'won' : 'lost'),
|
||||||
answers: [{
|
answers: [{label: 'endGame', action: backToMain}]
|
||||||
label: 'endGame',
|
|
||||||
action: function() {
|
|
||||||
Messaging.send({tag: "Quit"});
|
|
||||||
Screen.select('reception');
|
|
||||||
f();
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue