11<script setup lang="ts">
2- import {computed , inject , onMounted , onUnmounted } from " vue" ;
2+ import {computed } from " vue" ;
33import ContinueActionButtonList from " @/components/match/ContinueActionButtonList.vue" ;
44import AutoContinueInput from " @/components/match/AutoContinueInput.vue" ;
55import MatchTeamTable from " @/components/match/MatchTeamTable.vue" ;
6- import type {ControlApi } from " @/providers/controlApi" ;
76import {useGcStateStore } from " @/store/gcState" ;
87import {useUiStateStore } from " @/store/uiState" ;
98import SwitchColorButton from " @/components/start/SwitchColorButton.vue" ;
@@ -15,51 +14,16 @@ import CommandButton from "@/components/control/CommandButton.vue";
1514const store = useMatchStateStore ()
1615const gcStore = useGcStateStore ()
1716const uiStore = useUiStateStore ()
18- const control = inject <ControlApi >(' control-api' )
19-
20- const continueWithAction = (id : number ) => {
21- if (gcStore .gcState .continueActions ! .length > id ) {
22- control ?.Continue (gcStore .gcState .continueActions ! [id ])
23- }
24- }
2517
2618const continueHints = computed (() => {
2719 return gcStore .gcState .continueHints || []
2820})
2921
30- const toggleAutoContinue = () => {
31- control ?.ChangeConfig ({autoContinue: ! gcStore .config .autoContinue })
32- }
33-
3422const halftime = computed (() => {
3523 return store .matchState .stage === ' NORMAL_HALF_TIME' ||
3624 store .matchState .stage === ' EXTRA_HALF_TIME'
3725})
3826
39- const keyListenerContinue = function (e : KeyboardEvent ) {
40- if (! e .ctrlKey ) {
41- return
42- }
43- if (e .key === " " ) {
44- toggleAutoContinue ()
45- e .preventDefault ()
46- } else {
47- const id = Number (e .key )
48- if (! isNaN (id )) {
49- continueWithAction (id - 1 )
50- e .preventDefault ()
51- }
52- }
53- };
54-
55- onMounted (() => {
56- document .addEventListener (' keydown' , keyListenerContinue )
57- })
58-
59- onUnmounted (() => {
60- document .removeEventListener (' keydown' , keyListenerContinue )
61- })
62-
6327 </script >
6428
6529<template >
@@ -82,13 +46,12 @@ onUnmounted(() => {
8246 <AutoContinueInput />
8347 </div >
8448 <div class =" row justify-evenly" >
85- Press
8649 <div class =" q-my-auto" >
50+ Press
8751 <em >
88- Ctrl +
8952 <q-badge label =" id" color =" orange" />
9053 </em >
91- |
54+ or
9255 <em >NumpadEnter</em >
9356 to continue
9457 </div >
0 commit comments