diff --git a/src/components/GameControlPanel.vue b/src/components/GameControlPanel.vue index f550dc4..8a7d138 100644 --- a/src/components/GameControlPanel.vue +++ b/src/components/GameControlPanel.vue @@ -15,15 +15,16 @@ const dialog = useDialog() const game = computed(() => props.state.game?.key === props.selectedKey ? props.state.game : null) const status = computed(() => game.value ? gameStatuses[game.value.status] : null) const disabled = computed(() => props.isBusy || props.state.busy || !props.state.authenticated || !!props.state.gameError) +const availableCommands = computed(() => game.value && props.selectedKey ? gameCommands[game.value.status] : []) const commands = { start: { label: 'Начать игру', path: 'm8 5 12 7-12 7z' }, - play: { label: 'Продолжить игру', path: 'm8 5 12 7-12 7z' }, pause: { label: 'Поставить игру на паузу', path: 'M8 5v14M16 5v14' }, + play: { label: 'Продолжить игру', path: 'M5 5v14m5-14 10 7-10 7z' }, finish: { label: 'Завершить игру', path: 'M5 21V3m0 1h14l-4 5 4 5H5' }, reset: { label: 'Сбросить игру', path: 'M4 5v6h6M4 11a8 8 0 1 1 2 7' }, } function run(command: GameCommand) { - if (disabled.value || !game.value || !props.selectedKey) return + if (disabled.value || !game.value || !props.selectedKey || !availableCommands.value.includes(command)) return if (command !== 'reset') { emit('action', { action: 'game-command', command, key: props.selectedKey }) return @@ -57,19 +58,18 @@ function run(command: GameCommand) { {{ state.gameError }}{{ game ? ' Показано последнее полученное состояние.' : '' }} - + - + diff --git a/src/components/ScreenConnectionPanel.vue b/src/components/ScreenConnectionPanel.vue index fe4310f..c9862f0 100644 --- a/src/components/ScreenConnectionPanel.vue +++ b/src/components/ScreenConnectionPanel.vue @@ -22,14 +22,7 @@ function run(intent: OnlineIntent) { Экран №{{ state.screenId }} - Отключиться - - - + {{ state.soundEnabled === null ? 'Назначение звука пока неизвестно' @@ -40,8 +33,13 @@ function run(intent: OnlineIntent) { · Последнее состояние - - + + Отключиться +
+ {{ state.soundEnabled === null ? 'Назначение звука пока неизвестно' @@ -40,8 +33,13 @@ function run(intent: OnlineIntent) { · Последнее состояние -