Merge pull request #43 from Pandipipas/add-game-selector-to-scoreboard-panel

Add centered fighting-game selector with icon-only swap/reset controls
This commit is contained in:
Pandipipas
2026-02-12 00:40:18 +01:00
committed by GitHub
5 changed files with 66 additions and 21 deletions
+8 -2
View File
@@ -48,6 +48,10 @@
"round": { "round": {
"type": "string", "type": "string",
"default": "" "default": ""
},
"game": {
"type": "string",
"default": ""
} }
}, },
"required": [ "required": [
@@ -61,7 +65,8 @@
"rightCountryOverride", "rightCountryOverride",
"leftScore", "leftScore",
"rightScore", "rightScore",
"round" "round",
"game"
], ],
"default": { "default": {
"leftPlayerId": "", "leftPlayerId": "",
@@ -74,6 +79,7 @@
"rightCountryOverride": "", "rightCountryOverride": "",
"leftScore": 0, "leftScore": 0,
"rightScore": 0, "rightScore": 0,
"round": "" "round": "",
"game": ""
} }
} }
@@ -23,6 +23,19 @@ const rightCountryInput = ref('');
const leftCountryOptions = ref(countryOptions); const leftCountryOptions = ref(countryOptions);
const rightCountryOptions = ref(countryOptions); const rightCountryOptions = ref(countryOptions);
const fightingGameOptions = [
'Street Fighter 6',
'TEKKEN 8',
'Guilty Gear -Strive-',
'Mortal Kombat 1',
'The King of Fighters XV',
'Granblue Fantasy Versus: Rising',
'Under Night In-Birth II Sys:Celes',
].map((game) => ({
label: game,
value: game,
}));
const normalizeName = (value: string) => value.trim().toLowerCase(); const normalizeName = (value: string) => value.trim().toLowerCase();
const filterOptions = ( const filterOptions = (
@@ -561,26 +574,10 @@ watchEffect(() => {
<div class="text-h4"> <div class="text-h4">
Scoreboard Scoreboard
</div> </div>
<QSpace />
<QBtn
color="secondary"
outline
icon="swap_horiz"
label="Intercambiar lados"
class="q-mr-sm"
@click="scoreboardStore.swapPlayers"
/>
<QBtn
color="secondary"
outline
icon="restart_alt"
label="Reset scores"
@click="scoreboardStore.resetScores"
/>
</div> </div>
<div class="row q-col-gutter-lg"> <div class="row q-col-gutter-lg items-start">
<div class="col-12 col-md-6"> <div class="col-12 col-md-5">
<QCard <QCard
flat flat
bordered bordered
@@ -685,7 +682,45 @@ watchEffect(() => {
</QCard> </QCard>
</div> </div>
<div class="col-12 col-md-6"> <div class="col-12 col-md-2">
<QCard
flat
bordered
>
<QCardSection>
<div class="column items-center q-gutter-sm">
<div class="row items-center q-gutter-sm">
<QBtn
color="secondary"
outline
round
icon="swap_horiz"
@click="scoreboardStore.swapPlayers"
/>
<QBtn
color="secondary"
outline
round
icon="restart_alt"
@click="scoreboardStore.resetScores"
/>
</div>
<QSelect
v-model="scoreboardStore.scoreboard.game"
:options="fightingGameOptions"
label="Juego"
dense
outlined
emit-value
map-options
class="full-width"
/>
</div>
</QCardSection>
</QCard>
</div>
<div class="col-12 col-md-5">
<QCard <QCard
flat flat
bordered bordered
@@ -19,6 +19,7 @@ const defaultScoreboard: Scoreboard = {
leftScore: 0, leftScore: 0,
rightScore: 0, rightScore: 0,
round: '', round: '',
game: '',
}; };
const normalizeScoreboard = (input: unknown): Scoreboard => { const normalizeScoreboard = (input: unknown): Scoreboard => {
@@ -35,6 +36,7 @@ const normalizeScoreboard = (input: unknown): Scoreboard => {
leftScore: typeof candidate.leftScore === 'number' ? Math.max(0, Math.floor(candidate.leftScore)) : 0, leftScore: typeof candidate.leftScore === 'number' ? Math.max(0, Math.floor(candidate.leftScore)) : 0,
rightScore: typeof candidate.rightScore === 'number' ? Math.max(0, Math.floor(candidate.rightScore)) : 0, rightScore: typeof candidate.rightScore === 'number' ? Math.max(0, Math.floor(candidate.rightScore)) : 0,
round: typeof candidate.round === 'string' ? candidate.round : '', round: typeof candidate.round === 'string' ? candidate.round : '',
game: typeof candidate.game === 'string' ? candidate.game : '',
}; };
}; };
+1
View File
@@ -19,6 +19,7 @@ const defaultScoreboard: Schemas.Scoreboard = {
leftScore: 0, leftScore: 0,
rightScore: 0, rightScore: 0,
round: '', round: '',
game: '',
}; };
const players = computed<Schemas.Players>(() => playersReplicant?.data ?? {}); const players = computed<Schemas.Players>(() => playersReplicant?.data ?? {});
+1
View File
@@ -18,4 +18,5 @@ export interface Scoreboard {
leftScore: number; leftScore: number;
rightScore: number; rightScore: number;
round: string; round: string;
game: string;
} }