From 04dbe94e34c6b312bbad9b7c19716f5d47c0b6f7 Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 01:05:05 +0100 Subject: [PATCH 01/11] Agregar overrides de team/country y guardado desde ScoreboardPanel --- schemas/scoreboard.json | 24 ++ .../example/components/ScoreboardPanel.vue | 225 +++++++++++++++++- src/dashboard/example/stores/scoreboard.ts | 12 + src/graphics/scoreboard/main.vue | 24 +- src/types/schemas/scoreboard.d.ts | 4 + 5 files changed, 268 insertions(+), 21 deletions(-) diff --git a/schemas/scoreboard.json b/schemas/scoreboard.json index 97049fa..4ef6ecd 100644 --- a/schemas/scoreboard.json +++ b/schemas/scoreboard.json @@ -19,6 +19,22 @@ "type": "string", "default": "" }, + "leftTeamOverride": { + "type": "string", + "default": "" + }, + "rightTeamOverride": { + "type": "string", + "default": "" + }, + "leftCountryOverride": { + "type": "string", + "default": "" + }, + "rightCountryOverride": { + "type": "string", + "default": "" + }, "leftScore": { "type": "integer", "default": 0, @@ -39,6 +55,10 @@ "rightPlayerId", "leftNameOverride", "rightNameOverride", + "leftTeamOverride", + "rightTeamOverride", + "leftCountryOverride", + "rightCountryOverride", "leftScore", "rightScore", "round" @@ -48,6 +68,10 @@ "rightPlayerId": "", "leftNameOverride": "", "rightNameOverride": "", + "leftTeamOverride": "", + "rightTeamOverride": "", + "leftCountryOverride": "", + "rightCountryOverride": "", "leftScore": 0, "rightScore": 0, "round": "" diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index 5d46fa3..dff0135 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -1,6 +1,7 @@ diff --git a/src/types/schemas/scoreboard.d.ts b/src/types/schemas/scoreboard.d.ts index ec1fcf8..3e6e5b8 100644 --- a/src/types/schemas/scoreboard.d.ts +++ b/src/types/schemas/scoreboard.d.ts @@ -11,6 +11,10 @@ export interface Scoreboard { rightPlayerId: string; leftNameOverride: string; rightNameOverride: string; + leftTeamOverride: string; + rightTeamOverride: string; + leftCountryOverride: string; + rightCountryOverride: string; leftScore: number; rightScore: number; round: string; From 85812378389a1d0fbcc30d13b8d642dc4c9ceeff Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 01:10:07 +0100 Subject: [PATCH 02/11] =?UTF-8?q?Corregir=20selecci=C3=B3n=20libre=20de=20?= =?UTF-8?q?jugador=20en=20ScoreboardPanel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/components/ScoreboardPanel.vue | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index dff0135..aacaedb 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -187,18 +187,28 @@ const applyRightPlayerData = (playerId: string) => { rightCountryInput.value = getCountryLabel(scoreboardStore.scoreboard.rightCountryOverride); }; -const onLeftSelect = () => { +const onLeftSelect = (playerId: string) => { + const hasExistingPlayer = Boolean(playerId && playersStore.players[playerId]); + if (!hasExistingPlayer) { + return; + } + scoreboardStore.scoreboard.leftNameOverride = ''; leftFilter.value = ''; - leftInput.value = getPlayerLabel(scoreboardStore.scoreboard.leftPlayerId); - applyLeftPlayerData(scoreboardStore.scoreboard.leftPlayerId); + leftInput.value = getPlayerLabel(playerId); + applyLeftPlayerData(playerId); }; -const onRightSelect = () => { +const onRightSelect = (playerId: string) => { + const hasExistingPlayer = Boolean(playerId && playersStore.players[playerId]); + if (!hasExistingPlayer) { + return; + } + scoreboardStore.scoreboard.rightNameOverride = ''; rightFilter.value = ''; - rightInput.value = getPlayerLabel(scoreboardStore.scoreboard.rightPlayerId); - applyRightPlayerData(scoreboardStore.scoreboard.rightPlayerId); + rightInput.value = getPlayerLabel(playerId); + applyRightPlayerData(playerId); }; const createPlayerId = (name: string) => { From 7e3f0853cd5ab91770450786b3dd2dbd954c1224 Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 01:15:59 +0100 Subject: [PATCH 03/11] Corregir override libre y limpiar team/country al escribir jugador nuevo --- .../example/components/ScoreboardPanel.vue | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index aacaedb..2dbb6da 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -135,19 +135,50 @@ const rightHasSelectedPlayerChanges = computed(() => { const leftPlayerOptions = computed(() => filterOptions(playerOptions.value, leftFilter.value)); const rightPlayerOptions = computed(() => filterOptions(playerOptions.value, rightFilter.value)); + +const startLeftCustomPlayer = () => { + scoreboardStore.scoreboard.leftPlayerId = ''; + scoreboardStore.scoreboard.leftTeamOverride = ''; + scoreboardStore.scoreboard.leftCountryOverride = ''; +}; + +const startRightCustomPlayer = () => { + scoreboardStore.scoreboard.rightPlayerId = ''; + scoreboardStore.scoreboard.rightTeamOverride = ''; + scoreboardStore.scoreboard.rightCountryOverride = ''; +}; + const onLeftFilter = (val: string, update: (fn: () => void) => void) => { update(() => { leftFilter.value = val; + + if (!leftFocused.value) { + return; + } + leftInput.value = val; scoreboardStore.scoreboard.leftNameOverride = val; + + if (val.trim()) { + startLeftCustomPlayer(); + } }); }; const onRightFilter = (val: string, update: (fn: () => void) => void) => { update(() => { rightFilter.value = val; + + if (!rightFocused.value) { + return; + } + rightInput.value = val; scoreboardStore.scoreboard.rightNameOverride = val; + + if (val.trim()) { + startRightCustomPlayer(); + } }); }; From 7d3725acb5192f11ae405b75c0fa4b51ed750cdc Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 01:20:40 +0100 Subject: [PATCH 04/11] Fixear persistencia de texto libre al salir del select --- .../example/components/ScoreboardPanel.vue | 51 +++++++++++-------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index 2dbb6da..76adba2 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -151,34 +151,12 @@ const startRightCustomPlayer = () => { const onLeftFilter = (val: string, update: (fn: () => void) => void) => { update(() => { leftFilter.value = val; - - if (!leftFocused.value) { - return; - } - - leftInput.value = val; - scoreboardStore.scoreboard.leftNameOverride = val; - - if (val.trim()) { - startLeftCustomPlayer(); - } }); }; const onRightFilter = (val: string, update: (fn: () => void) => void) => { update(() => { rightFilter.value = val; - - if (!rightFocused.value) { - return; - } - - rightInput.value = val; - scoreboardStore.scoreboard.rightNameOverride = val; - - if (val.trim()) { - startRightCustomPlayer(); - } }); }; @@ -327,6 +305,35 @@ const saveRightSelectedPlayerChanges = () => { scoreboardStore.scoreboard.rightNameOverride = ''; }; + +watch( + leftInput, + (value) => { + if (!leftFocused.value) { + return; + } + + scoreboardStore.scoreboard.leftNameOverride = value; + if (value.trim()) { + startLeftCustomPlayer(); + } + }, +); + +watch( + rightInput, + (value) => { + if (!rightFocused.value) { + return; + } + + scoreboardStore.scoreboard.rightNameOverride = value; + if (value.trim()) { + startRightCustomPlayer(); + } + }, +); + watch( () => scoreboardStore.scoreboard.leftPlayerId, (playerId) => { From e08d88ec3391bd02a54c0986871ed14f0f6f5030 Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 01:24:38 +0100 Subject: [PATCH 05/11] =?UTF-8?q?Arreglar=20selecci=C3=B3n=20de=20jugador?= =?UTF-8?q?=20existente=20en=20ScoreboardPanel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/components/ScoreboardPanel.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index 76adba2..3889a67 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -14,6 +14,8 @@ const leftInput = ref(''); const rightInput = ref(''); const leftFocused = ref(false); const rightFocused = ref(false); +const leftIgnoreInputSync = ref(false); +const rightIgnoreInputSync = ref(false); const leftCountryInput = ref(''); const rightCountryInput = ref(''); @@ -202,6 +204,8 @@ const onLeftSelect = (playerId: string) => { return; } + leftIgnoreInputSync.value = true; + leftFocused.value = false; scoreboardStore.scoreboard.leftNameOverride = ''; leftFilter.value = ''; leftInput.value = getPlayerLabel(playerId); @@ -214,6 +218,8 @@ const onRightSelect = (playerId: string) => { return; } + rightIgnoreInputSync.value = true; + rightFocused.value = false; scoreboardStore.scoreboard.rightNameOverride = ''; rightFilter.value = ''; rightInput.value = getPlayerLabel(playerId); @@ -309,6 +315,11 @@ const saveRightSelectedPlayerChanges = () => { watch( leftInput, (value) => { + if (leftIgnoreInputSync.value) { + leftIgnoreInputSync.value = false; + return; + } + if (!leftFocused.value) { return; } @@ -323,6 +334,11 @@ watch( watch( rightInput, (value) => { + if (rightIgnoreInputSync.value) { + rightIgnoreInputSync.value = false; + return; + } + if (!rightFocused.value) { return; } From d5b08ef4ee87b0589414bed98b5cd4bae84a39b9 Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 01:29:32 +0100 Subject: [PATCH 06/11] =?UTF-8?q?Corregir=20override=20en=20escritura=20li?= =?UTF-8?q?bre=20sin=20romper=20selecci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/components/ScoreboardPanel.vue | 61 ++++++------------- 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index 3889a67..ffe0b1e 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -14,8 +14,6 @@ const leftInput = ref(''); const rightInput = ref(''); const leftFocused = ref(false); const rightFocused = ref(false); -const leftIgnoreInputSync = ref(false); -const rightIgnoreInputSync = ref(false); const leftCountryInput = ref(''); const rightCountryInput = ref(''); @@ -153,12 +151,32 @@ const startRightCustomPlayer = () => { const onLeftFilter = (val: string, update: (fn: () => void) => void) => { update(() => { leftFilter.value = val; + + if (!leftFocused.value) { + return; + } + + leftInput.value = val; + scoreboardStore.scoreboard.leftNameOverride = val; + if (val.trim()) { + startLeftCustomPlayer(); + } }); }; const onRightFilter = (val: string, update: (fn: () => void) => void) => { update(() => { rightFilter.value = val; + + if (!rightFocused.value) { + return; + } + + rightInput.value = val; + scoreboardStore.scoreboard.rightNameOverride = val; + if (val.trim()) { + startRightCustomPlayer(); + } }); }; @@ -204,7 +222,6 @@ const onLeftSelect = (playerId: string) => { return; } - leftIgnoreInputSync.value = true; leftFocused.value = false; scoreboardStore.scoreboard.leftNameOverride = ''; leftFilter.value = ''; @@ -218,7 +235,6 @@ const onRightSelect = (playerId: string) => { return; } - rightIgnoreInputSync.value = true; rightFocused.value = false; scoreboardStore.scoreboard.rightNameOverride = ''; rightFilter.value = ''; @@ -312,43 +328,6 @@ const saveRightSelectedPlayerChanges = () => { }; -watch( - leftInput, - (value) => { - if (leftIgnoreInputSync.value) { - leftIgnoreInputSync.value = false; - return; - } - - if (!leftFocused.value) { - return; - } - - scoreboardStore.scoreboard.leftNameOverride = value; - if (value.trim()) { - startLeftCustomPlayer(); - } - }, -); - -watch( - rightInput, - (value) => { - if (rightIgnoreInputSync.value) { - rightIgnoreInputSync.value = false; - return; - } - - if (!rightFocused.value) { - return; - } - - scoreboardStore.scoreboard.rightNameOverride = value; - if (value.trim()) { - startRightCustomPlayer(); - } - }, -); watch( () => scoreboardStore.scoreboard.leftPlayerId, From e08c1b9a1c5490ab23362d3b34ca09ead92ab739 Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 01:34:08 +0100 Subject: [PATCH 07/11] =?UTF-8?q?Fixear=20visualizaci=C3=B3n=20de=20nombre?= =?UTF-8?q?=20custom=20en=20selector=20de=20jugador?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dashboard/example/components/ScoreboardPanel.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index ffe0b1e..8672870 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -8,6 +8,9 @@ import { useScoreboardStore } from '../stores/scoreboard'; const playersStore = usePlayersStore(); const scoreboardStore = useScoreboardStore(); +const CUSTOM_LEFT_PLAYER_ID = '__custom_left_player__'; +const CUSTOM_RIGHT_PLAYER_ID = '__custom_right_player__'; + const leftFilter = ref(''); const rightFilter = ref(''); const leftInput = ref(''); @@ -137,13 +140,13 @@ const rightPlayerOptions = computed(() => filterOptions(playerOptions.value, rig const startLeftCustomPlayer = () => { - scoreboardStore.scoreboard.leftPlayerId = ''; + scoreboardStore.scoreboard.leftPlayerId = CUSTOM_LEFT_PLAYER_ID; scoreboardStore.scoreboard.leftTeamOverride = ''; scoreboardStore.scoreboard.leftCountryOverride = ''; }; const startRightCustomPlayer = () => { - scoreboardStore.scoreboard.rightPlayerId = ''; + scoreboardStore.scoreboard.rightPlayerId = CUSTOM_RIGHT_PLAYER_ID; scoreboardStore.scoreboard.rightTeamOverride = ''; scoreboardStore.scoreboard.rightCountryOverride = ''; }; From 32837cbb3610403bcf8b7f940b2620f764e57725 Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 01:37:51 +0100 Subject: [PATCH 08/11] Evitar mostrar IDs custom en selector de jugador --- src/dashboard/example/components/ScoreboardPanel.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index 8672870..37a8124 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -62,12 +62,22 @@ const onRightCountryFilter = (value: string, update: (callback: () => void) => v const playerOptions = computed(() => { const base = [{ label: '(Sin asignar)', value: '' }]; + const custom = [ + { + value: CUSTOM_LEFT_PLAYER_ID, + label: scoreboardStore.scoreboard.leftNameOverride || 'Jugador personalizado (izq)', + }, + { + value: CUSTOM_RIGHT_PLAYER_ID, + label: scoreboardStore.scoreboard.rightNameOverride || 'Jugador personalizado (der)', + }, + ]; const entries = Object.entries(playersStore.players) as [string, Schemas.Players[string]][]; const options = entries.map(([id, player]) => ({ value: id, label: player.gamertag || id, })); - return base.concat(options); + return base.concat(custom).concat(options); }); const leftSelectedPlayer = computed(() => playersStore.players[scoreboardStore.scoreboard.leftPlayerId]); From 6d7e7b9b101d3a14344626085d7b784f32f01e50 Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:27:19 +0100 Subject: [PATCH 09/11] Fix custom player select behavior in scoreboard panel --- .../example/components/ScoreboardPanel.vue | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index 37a8124..de90df6 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -62,22 +62,12 @@ const onRightCountryFilter = (value: string, update: (callback: () => void) => v const playerOptions = computed(() => { const base = [{ label: '(Sin asignar)', value: '' }]; - const custom = [ - { - value: CUSTOM_LEFT_PLAYER_ID, - label: scoreboardStore.scoreboard.leftNameOverride || 'Jugador personalizado (izq)', - }, - { - value: CUSTOM_RIGHT_PLAYER_ID, - label: scoreboardStore.scoreboard.rightNameOverride || 'Jugador personalizado (der)', - }, - ]; const entries = Object.entries(playersStore.players) as [string, Schemas.Players[string]][]; const options = entries.map(([id, player]) => ({ value: id, label: player.gamertag || id, })); - return base.concat(custom).concat(options); + return base.concat(options); }); const leftSelectedPlayer = computed(() => playersStore.players[scoreboardStore.scoreboard.leftPlayerId]); @@ -150,15 +140,21 @@ const rightPlayerOptions = computed(() => filterOptions(playerOptions.value, rig const startLeftCustomPlayer = () => { + const wasCustom = scoreboardStore.scoreboard.leftPlayerId === CUSTOM_LEFT_PLAYER_ID; scoreboardStore.scoreboard.leftPlayerId = CUSTOM_LEFT_PLAYER_ID; - scoreboardStore.scoreboard.leftTeamOverride = ''; - scoreboardStore.scoreboard.leftCountryOverride = ''; + if (!wasCustom) { + scoreboardStore.scoreboard.leftTeamOverride = ''; + scoreboardStore.scoreboard.leftCountryOverride = ''; + } }; const startRightCustomPlayer = () => { + const wasCustom = scoreboardStore.scoreboard.rightPlayerId === CUSTOM_RIGHT_PLAYER_ID; scoreboardStore.scoreboard.rightPlayerId = CUSTOM_RIGHT_PLAYER_ID; - scoreboardStore.scoreboard.rightTeamOverride = ''; - scoreboardStore.scoreboard.rightCountryOverride = ''; + if (!wasCustom) { + scoreboardStore.scoreboard.rightTeamOverride = ''; + scoreboardStore.scoreboard.rightCountryOverride = ''; + } }; const onLeftFilter = (val: string, update: (fn: () => void) => void) => { @@ -195,7 +191,7 @@ const onRightFilter = (val: string, update: (fn: () => void) => void) => { const onLeftFocus = () => { leftFocused.value = true; - leftInput.value = ''; + leftInput.value = leftDisplayName.value; }; const onLeftBlur = () => { @@ -206,7 +202,7 @@ const onLeftBlur = () => { const onRightFocus = () => { rightFocused.value = true; - rightInput.value = ''; + rightInput.value = rightDisplayName.value; }; const onRightBlur = () => { From e7354500f4561a984bccf143d6b83f52dcfdf877 Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:33:31 +0100 Subject: [PATCH 10/11] Fix custom player id leaking in scoreboard input --- .../example/components/ScoreboardPanel.vue | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index de90df6..cb6e90a 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -70,10 +70,38 @@ const playerOptions = computed(() => { return base.concat(options); }); +const leftPlayerOptions = computed(() => { + const options = filterOptions(playerOptions.value, leftFilter.value); + if (scoreboardStore.scoreboard.leftPlayerId !== CUSTOM_LEFT_PLAYER_ID) { + return options; + } + return [{ + value: CUSTOM_LEFT_PLAYER_ID, + label: scoreboardStore.scoreboard.leftNameOverride || '(Sin asignar)', + }].concat(options); +}); + +const rightPlayerOptions = computed(() => { + const options = filterOptions(playerOptions.value, rightFilter.value); + if (scoreboardStore.scoreboard.rightPlayerId !== CUSTOM_RIGHT_PLAYER_ID) { + return options; + } + return [{ + value: CUSTOM_RIGHT_PLAYER_ID, + label: scoreboardStore.scoreboard.rightNameOverride || '(Sin asignar)', + }].concat(options); +}); + const leftSelectedPlayer = computed(() => playersStore.players[scoreboardStore.scoreboard.leftPlayerId]); const rightSelectedPlayer = computed(() => playersStore.players[scoreboardStore.scoreboard.rightPlayerId]); const getPlayerLabel = (playerId: string) => { + if (playerId === CUSTOM_LEFT_PLAYER_ID) { + return scoreboardStore.scoreboard.leftNameOverride; + } + if (playerId === CUSTOM_RIGHT_PLAYER_ID) { + return scoreboardStore.scoreboard.rightNameOverride; + } const match = playerOptions.value.find((option) => option.value === playerId); return match ? match.label : ''; }; @@ -135,10 +163,6 @@ const rightHasSelectedPlayerChanges = computed(() => { || player.country !== scoreboardStore.scoreboard.rightCountryOverride; }); -const leftPlayerOptions = computed(() => filterOptions(playerOptions.value, leftFilter.value)); -const rightPlayerOptions = computed(() => filterOptions(playerOptions.value, rightFilter.value)); - - const startLeftCustomPlayer = () => { const wasCustom = scoreboardStore.scoreboard.leftPlayerId === CUSTOM_LEFT_PLAYER_ID; scoreboardStore.scoreboard.leftPlayerId = CUSTOM_LEFT_PLAYER_ID; From db3fb916d37c7b69da5091d6373f7029e83c20e3 Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:39:36 +0100 Subject: [PATCH 11/11] Fix custom name blur/reset behavior in scoreboard select --- .../example/components/ScoreboardPanel.vue | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index cb6e90a..bd092d6 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -72,23 +72,29 @@ const playerOptions = computed(() => { const leftPlayerOptions = computed(() => { const options = filterOptions(playerOptions.value, leftFilter.value); - if (scoreboardStore.scoreboard.leftPlayerId !== CUSTOM_LEFT_PLAYER_ID) { + if ( + scoreboardStore.scoreboard.leftPlayerId !== CUSTOM_LEFT_PLAYER_ID + || !scoreboardStore.scoreboard.leftNameOverride.trim() + ) { return options; } return [{ value: CUSTOM_LEFT_PLAYER_ID, - label: scoreboardStore.scoreboard.leftNameOverride || '(Sin asignar)', + label: scoreboardStore.scoreboard.leftNameOverride, }].concat(options); }); const rightPlayerOptions = computed(() => { const options = filterOptions(playerOptions.value, rightFilter.value); - if (scoreboardStore.scoreboard.rightPlayerId !== CUSTOM_RIGHT_PLAYER_ID) { + if ( + scoreboardStore.scoreboard.rightPlayerId !== CUSTOM_RIGHT_PLAYER_ID + || !scoreboardStore.scoreboard.rightNameOverride.trim() + ) { return options; } return [{ value: CUSTOM_RIGHT_PLAYER_ID, - label: scoreboardStore.scoreboard.rightNameOverride || '(Sin asignar)', + label: scoreboardStore.scoreboard.rightNameOverride, }].concat(options); }); @@ -189,6 +195,11 @@ const onLeftFilter = (val: string, update: (fn: () => void) => void) => { return; } + if (!val.trim() && scoreboardStore.scoreboard.leftPlayerId === CUSTOM_LEFT_PLAYER_ID) { + leftInput.value = scoreboardStore.scoreboard.leftNameOverride; + return; + } + leftInput.value = val; scoreboardStore.scoreboard.leftNameOverride = val; if (val.trim()) { @@ -205,6 +216,11 @@ const onRightFilter = (val: string, update: (fn: () => void) => void) => { return; } + if (!val.trim() && scoreboardStore.scoreboard.rightPlayerId === CUSTOM_RIGHT_PLAYER_ID) { + rightInput.value = scoreboardStore.scoreboard.rightNameOverride; + return; + } + rightInput.value = val; scoreboardStore.scoreboard.rightNameOverride = val; if (val.trim()) {