✨ (viewer) Signal preference updates
This commit is contained in:
parent
9d8a2b90b2
commit
9d8ca1e244
2 changed files with 11 additions and 2 deletions
|
|
@ -1200,11 +1200,17 @@ export default class Game extends Vue {
|
|||
}
|
||||
|
||||
toggleSound() {
|
||||
this.preferences.sound = !this.preferences.sound;
|
||||
const newSound = !this.preferences.sound;
|
||||
|
||||
this.emitter.emit('update:preference', { name: 'sound', value: newSound });
|
||||
this.preferences.sound = newSound;
|
||||
}
|
||||
|
||||
toggleHelp() {
|
||||
this.preferences.disableHelp = !this.preferences.disableHelp;
|
||||
const newVal = !this.preferences.disableHelp;
|
||||
|
||||
this.emitter.emit('update:preference', { name: 'disableHelp', value: newVal });
|
||||
this.preferences.disableHelp = newVal;
|
||||
}
|
||||
|
||||
showLog() {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ function launch(selector: string) {
|
|||
params.emitter.on('move', (move: Move) => item.emit('move', move));
|
||||
params.emitter.on('addLog', (data: string[]) => item.emit('addLog', data));
|
||||
params.emitter.on('replaceLog', (data: string[]) => item.emit('replaceLog', data));
|
||||
params.emitter.on('update:preference', (data: { name: string; value: any }) =>
|
||||
item.emit('update:preference', data)
|
||||
);
|
||||
|
||||
item.addListener('state', (data) => {
|
||||
params.state = data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue