Keep a line in games list for negative answers to let the user know about them and dismiss the news when they read it
This commit is contained in:
parent
6127d0f25a
commit
66cade4cb2
3 changed files with 25 additions and 4 deletions
|
@ -31,8 +31,15 @@ function init() {
|
|||
GamesGUI.refresh();
|
||||
});
|
||||
Messaging.addEventListener(["Relay", "Answer"], function(o) {
|
||||
var gameEntry = Games.entries.get(o.from);
|
||||
if(gameEntry != undefined) {
|
||||
if(!o.message.accept) {
|
||||
gameEntry.answer = false;
|
||||
} else {
|
||||
Games.entries.remove(o.from);
|
||||
}
|
||||
GamesGUI.refresh();
|
||||
}
|
||||
});
|
||||
Messaging.addEventListener(["Game"], function(o) {
|
||||
GamesGUI.refresh();
|
||||
|
|
|
@ -23,8 +23,16 @@ function showGame(game) {
|
|||
}
|
||||
|
||||
function gameProposal(game) {
|
||||
var properties = {
|
||||
textContent: I18n.get('proposedGame')(game.value.yourTurn, game.value.vs.name),
|
||||
var properties = {};
|
||||
if(game.value.answer != undefined) {
|
||||
properties.textContent = I18n.get('refusedGame')(game.value.vs.name);
|
||||
properties.class = 'clickable';
|
||||
properties.onClick = function() {Games.entries.remove(game.key); refresh();};
|
||||
} else {
|
||||
properties.textContent = I18n.get('proposedGame')(
|
||||
game.value.yourTurn,
|
||||
game.value.vs.name
|
||||
);
|
||||
};
|
||||
if(game.value.yourTurn) {
|
||||
properties.onClick = answerDialog(game.value.vs.id);
|
||||
|
|
|
@ -46,6 +46,9 @@ return {
|
|||
}
|
||||
},
|
||||
questionAccept: "Do you want to start the game ?",
|
||||
refusedGame: function(name) {
|
||||
return name + " refused your invitation";
|
||||
},
|
||||
startGameWith: "Start a game with",
|
||||
theyScored: function(name) {
|
||||
return name + " scored";
|
||||
|
@ -101,6 +104,9 @@ return {
|
|||
}
|
||||
},
|
||||
questionAccept: "Voulez-vous commencer la partie ?",
|
||||
refusedGame: function(name) {
|
||||
return name + " a décliné votre invitation";
|
||||
},
|
||||
startGameWith: "Commencer une partie avec",
|
||||
theyScored: function(name) {
|
||||
return name + " a marqué";
|
||||
|
|
Loading…
Reference in a new issue