Begin work on method to kill/leave the game.
This commit is contained in:
parent
14b7a1f5fe
commit
e6467dda76
1 changed files with 15 additions and 3 deletions
|
|
@ -69,15 +69,27 @@ export default {
|
||||||
message: `Game code copied to your clipboard.`,
|
message: `Game code copied to your clipboard.`,
|
||||||
classes: [`info`]
|
classes: [`info`]
|
||||||
});
|
});
|
||||||
setTimeout(() => this.$emit(`alert`, { message: ``, classes: [] }), 2000)
|
setTimeout(() => this.$emit(`alert`, { message: ``, classes: [] }), 2000);
|
||||||
},
|
},
|
||||||
copy_error() {
|
copy_error() {
|
||||||
this.$emit(`alert`, {
|
this.$emit(`alert`, {
|
||||||
message: `Something went wrong when copying the game code to your clipboard`,
|
message: `Something went wrong when copying the game code to your clipboard`,
|
||||||
classes: [`warning`]
|
classes: [`warning`]
|
||||||
});
|
});
|
||||||
setTimeout(() => this.$emit(`alert`, { message: ``, classes: [] }), 2000)
|
setTimeout(() => this.$emit(`alert`, { message: ``, classes: [] }), 2000);
|
||||||
}
|
},
|
||||||
|
handle_exit_button() {
|
||||||
|
if (this.is_host) {
|
||||||
|
let cont = confirm(`Are you sure you want to exit`);
|
||||||
|
if (cont) {
|
||||||
|
alert(`exiting game`)
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
this.$socket.emit(`LeaveGame`, {
|
||||||
|
username: this.username
|
||||||
|
});
|
||||||
|
};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
sockets: {
|
sockets: {
|
||||||
PlayerListResponse(data) {
|
PlayerListResponse(data) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue