From a6445fa229e3127cde2619d6e8950e038027b64b Mon Sep 17 00:00:00 2001 From: funkyFangs Date: Mon, 28 Oct 2024 21:59:19 -0500 Subject: [PATCH] :sparkles: add delete button, separate pokemon details, fix hunting method issue --- src/lib/api/HuntingMethod.ts | 3 +- .../tracker/counters/PokeRadarCounter.svelte | 45 +++++++++++------ .../menu/tracker/view/PokemonDetails.svelte | 28 +++++++++++ src/lib/menu/tracker/view/ViewTrackers.svelte | 48 ++++++++++++------- src/routes/history/+page.svelte | 2 +- 5 files changed, 92 insertions(+), 34 deletions(-) create mode 100644 src/lib/menu/tracker/view/PokemonDetails.svelte diff --git a/src/lib/api/HuntingMethod.ts b/src/lib/api/HuntingMethod.ts index 29fd3f9..ad56793 100644 --- a/src/lib/api/HuntingMethod.ts +++ b/src/lib/api/HuntingMethod.ts @@ -90,5 +90,6 @@ export function getToolTip(huntingMethod: HuntingMethod) { export const CHAIN_HUNTING_METHODS = new Set([ HuntingMethod.POKE_RADAR, HuntingMethod.CONSECUTIVE_FISHING, - HuntingMethod.SOS_BATTLE + HuntingMethod.SOS_BATTLE, + HuntingMethod.ULTRA_WARP_RIDE ]) diff --git a/src/lib/menu/tracker/counters/PokeRadarCounter.svelte b/src/lib/menu/tracker/counters/PokeRadarCounter.svelte index 84aaaca..f978bcf 100644 --- a/src/lib/menu/tracker/counters/PokeRadarCounter.svelte +++ b/src/lib/menu/tracker/counters/PokeRadarCounter.svelte @@ -25,16 +25,20 @@ If you wanted to track a Poké Radar hunt in Pokémon X with the shiny charm equ -->
- + + - - + + +
- +
diff --git a/src/lib/menu/tracker/view/PokemonDetails.svelte b/src/lib/menu/tracker/view/PokemonDetails.svelte new file mode 100644 index 0000000..62704dc --- /dev/null +++ b/src/lib/menu/tracker/view/PokemonDetails.svelte @@ -0,0 +1,28 @@ + + +
+

{formatPokemonSpeciesName(huntTracker.pokemonSpecies)}

+ {#if huntTracker.pokemon} +

{formatPokemonName(huntTracker.pokemonSpecies, huntTracker.pokemon)}

+ {/if} + {#if huntTracker.pokemonForm} +

{delimitedTitleCase(huntTracker.pokemonForm)}

+ {/if} +
+ + diff --git a/src/lib/menu/tracker/view/ViewTrackers.svelte b/src/lib/menu/tracker/view/ViewTrackers.svelte index 912da1c..4b18fc7 100644 --- a/src/lib/menu/tracker/view/ViewTrackers.svelte +++ b/src/lib/menu/tracker/view/ViewTrackers.svelte @@ -11,9 +11,8 @@ import SpriteDisplay from '$lib/menu/tracker/sprites/SpriteDisplay.svelte' import { CHAIN_HUNTING_METHODS } from '$lib/api/HuntingMethod' import type { GenerationalSprites, Sprites } from '$lib/api/SpritesResource' - import { delimitedTitleCase } from '$lib/utilities/Strings' - import { formatPokemonName } from '$lib/api/PokemonResource' import Device from 'svelte-device-info' + import PokemonDetails from '$lib/menu/tracker/view/PokemonDetails.svelte' export let huntTrackers: Writable export let history: Writable @@ -67,7 +66,7 @@ selectedTrackerIndex.update((selectedTrackerIndex) => Math.max(selectedTrackerIndex - 1, 0)) } - function closeTracker(index: number, huntTracker: HuntTracker) { + function closeTracker(index: number, huntTracker: HuntTracker = $huntTrackers[index]) { if (confirm('Are you sure you want to close this shiny hunt?')) { deleteTracker(index, huntTracker) } @@ -184,6 +183,11 @@ {#if creatingTracker} {:else if $huntTrackers.length > 0} + {#each $huntTrackers as huntTracker, index}
- - {formatPokemonSpeciesName(huntTracker.pokemonSpecies)} - - {#if huntTracker.pokemon} - {formatPokemonName(huntTracker.pokemonSpecies, huntTracker.pokemon)} - {/if} - {#if huntTracker.pokemonForm} - {delimitedTitleCase(huntTracker.pokemonForm)} - {/if} + + @@ -316,8 +313,7 @@ [role='tabpanel'] { display: flex; flex-direction: column; - gap: 5px; - justify-content: center; + gap: var(--padding-length); } [role='tabpanel'] > * { @@ -329,13 +325,29 @@ display: none; } - .pokemon-name { + .primary-button { + font-size: 1.5em; font-weight: bold; - font-size: 2em; } - .primary-button { + #delete-tracker { + background: none; + position: fixed; + padding: 0; + color: var(--font-color); font-size: 1.5em; - font-weight: bold; + width: 34px; + text-align: center; + @media (width > 1530px) { + right: calc((100vw - 1500px) / 2 + var(--gap-length)); + } + @media (width <= 1530px) { + right: calc(2 * var(--gap-length)); + } + } + + #delete-tracker.hoverable:hover, + #delete-tracker:not(.hoverable) { + background-color: var(--primary-dark); } diff --git a/src/routes/history/+page.svelte b/src/routes/history/+page.svelte index d81aa49..bb9ddc9 100644 --- a/src/routes/history/+page.svelte +++ b/src/routes/history/+page.svelte @@ -53,7 +53,7 @@ - +
Form Gender CountStatusMaximum