From 1fda5c99e8b28e5a13b0f493c9dae17be8258332 Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Fri, 13 Feb 2026 14:17:24 +0100 Subject: [PATCH] Tune preview action icons and character filter behavior --- .../example/components/ScoreboardPanel.vue | 61 ++++++++++++++++--- 1 file changed, 53 insertions(+), 8 deletions(-) diff --git a/src/dashboard/example/components/ScoreboardPanel.vue b/src/dashboard/example/components/ScoreboardPanel.vue index 98b4b2f..f04f02e 100644 --- a/src/dashboard/example/components/ScoreboardPanel.vue +++ b/src/dashboard/example/components/ScoreboardPanel.vue @@ -41,6 +41,9 @@ const fightingGameOptions = [ })); const characterOptions = computed(() => getCharactersByGame(scoreboardStore.scoreboard.game)); +type CharacterOption = ReturnType[number]; +const leftCharacterOptions = ref([]); +const rightCharacterOptions = ref([]); const leftCharacterImage = computed(() => { const match = characterOptions.value.find((option) => option.value === scoreboardStore.scoreboard.leftCharacter); @@ -93,6 +96,30 @@ const onRightCountryFilter = (value: string, update: (callback: () => void) => v filterCountries(value, update, rightCountryOptions); }; + +const filterCharacters = ( + value: string, + update: (callback: () => void) => void, + target: Ref, +) => { + update(() => { + const needle = value.toLowerCase().trim(); + if (!needle) { + target.value = characterOptions.value; + return; + } + target.value = characterOptions.value.filter((character) => character.label.toLowerCase().includes(needle)); + }); +}; + +const onLeftCharacterFilter = (value: string, update: (callback: () => void) => void) => { + filterCharacters(value, update, leftCharacterOptions); +}; + +const onRightCharacterFilter = (value: string, update: (callback: () => void) => void) => { + filterCharacters(value, update, rightCharacterOptions); +}; + const playerOptions = computed(() => { const base = [{ label: '(Sin asignar)', value: '' }]; const entries = Object.entries(playersStore.players) as [string, Schemas.Players[string]][]; @@ -598,6 +625,8 @@ watch( () => scoreboardStore.scoreboard.game, () => { const options = getCharactersByGame(scoreboardStore.scoreboard.game); + leftCharacterOptions.value = options; + rightCharacterOptions.value = options; const allowed = new Set(options.map((option) => option.value)); if (!allowed.has(scoreboardStore.scoreboard.leftCharacter)) { @@ -666,7 +695,7 @@ watch(
@@ -813,17 +843,17 @@ watch(
@@ -930,7 +960,7 @@ watch(
@@ -1351,6 +1382,10 @@ watch( margin: 0; } +.scoreboard-preview__character-field { + margin-top: 2px; +} + .scoreboard-preview__field :deep(.q-field__control) { min-height: 28px; padding: 0; @@ -1390,6 +1425,16 @@ watch( gap: 10px; } +.scoreboard-preview__action-btn { + color: #fff; + opacity: 0.85; +} + +.scoreboard-preview__action-btn:hover { + opacity: 1; + text-shadow: 0 0 10px rgba(255, 255, 255, 0.45); +} + .scoreboard-preview__score-side { display: inline-flex; flex-direction: column;