diff --git a/src/app.css b/src/app.css index b5c61c9..33f90fa 100644 --- a/src/app.css +++ b/src/app.css @@ -1,3 +1,14 @@ @tailwind base; @tailwind components; @tailwind utilities; +@layer utilities { + /* Hide scrollbar for Chrome, Safari and Opera */ + .no-scrollbar::-webkit-scrollbar { + display: none; + } + /* Hide scrollbar for IE, Edge and Firefox */ + .no-scrollbar { + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ + } +} diff --git a/src/lib/ActionInputStateMachine.svelte.ts b/src/lib/ActionInputStateMachine.svelte.ts index ef2ebd6..ba3a707 100644 --- a/src/lib/ActionInputStateMachine.svelte.ts +++ b/src/lib/ActionInputStateMachine.svelte.ts @@ -5,10 +5,27 @@ export class ActionInputVerifier { private held_balloons: number = 0; private held_totes: number = 0; + public get_held_tele(): { balloons: number; totes: number } { + return { + balloons: this.held_balloons, + totes: this.held_totes + }; + } + public get_held_auto(): { bunnies: number; balloons: number; totes: number } { + return { + bunnies: this.held_bunnies, + balloons: this.held_balloons, + totes: this.held_totes + }; + } + public verify_actions(action_data: AutoActionData[]) { - action_data - .reverse() - .forEach((action_data) => (action_data.ok = this.verify_new_action(action_data))); + action_data.forEach((action) => { + action.ok = this.verify_new_action(action); + this.held_totes = Math.max(this.held_totes, 0); + this.held_balloons = Math.max(this.held_balloons, 0); + this.held_bunnies = Math.max(this.held_bunnies, 0); + }); } // Takes an action and returns if it's a legal one diff --git a/src/lib/components/Action.svelte b/src/lib/components/Action.svelte index cd2caf7..923811a 100644 --- a/src/lib/components/Action.svelte +++ b/src/lib/components/Action.svelte @@ -10,7 +10,7 @@ }: { action_data: AutoActionData; index: number; - shift: (index: number, change: number) => void; + shift: (index: number, change: -1 | 1) => void; remove: (index: number) => void; } = $props(); @@ -31,13 +31,13 @@ {/if} diff --git a/src/lib/components/Timeline.svelte b/src/lib/components/Timeline.svelte index 16ef430..e2bff09 100644 --- a/src/lib/components/Timeline.svelte +++ b/src/lib/components/Timeline.svelte @@ -1,28 +1,42 @@ @@ -36,7 +50,7 @@ }} >
{#each actions as _, i} @@ -46,6 +60,9 @@ {remove} {shift} /> + {#if furthest_auto_index === actions.length - i - 1} +
+ {/if} {/each} {#if actions.length === 0}

No actions yet :3

diff --git a/src/lib/types.ts b/src/lib/types.ts index bba036e..a4907ba 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -91,6 +91,12 @@ export type BunnyAction = | 'ScoreBunnyLow'; export type AutoAction = TeleAction | BunnyAction; +export type TeleHeldItems = { + balloons: number; + totes: number; +}; +export type AutoHeldItems = TeleHeldItems & { bunnies: number }; + // For state machine export type ItemInputState = 'Intake' | 'Score' | 'Eject' | 'None'; export type TeleInputState = TeleAction | ItemInputState; diff --git a/src/routes/scout/[team_data]/+page.svelte b/src/routes/scout/[team_data]/+page.svelte index 793c5bf..c62396a 100644 --- a/src/routes/scout/[team_data]/+page.svelte +++ b/src/routes/scout/[team_data]/+page.svelte @@ -1,8 +1,10 @@
- Team {data.team_key} - {pageName} + Team {data.team_key} +
+ + {gamePhase}: {pageName} + +
- - - - + {#if gamePhase === 'Auto'} + + + + {:else if gamePhase === 'Tele'} + + + + {:else} +
Postmatch
+ + {/if}
diff --git a/src/routes/scout/[team_data]/ActionInputs.svelte b/src/routes/scout/[team_data]/AutoActionInputs.svelte similarity index 81% rename from src/routes/scout/[team_data]/ActionInputs.svelte rename to src/routes/scout/[team_data]/AutoActionInputs.svelte index 1f3150e..c96a201 100644 --- a/src/routes/scout/[team_data]/ActionInputs.svelte +++ b/src/routes/scout/[team_data]/AutoActionInputs.svelte @@ -1,19 +1,23 @@ + +
+ {#if is_none_state} +
+ + {#if held.balloons > 0} + + {/if} + {#if held_ejectables > 0} + + {/if} +
+ {:else if is_intake_state} +
+ + + +
+ + {:else if is_score_state} +
+
+

Ballon

+
+ + + {#if held.totes > 0} + + {/if} + +
+
+ +
+ {:else if is_eject_state} +
+ {#if held.balloons > 0} + + {/if} + {#if held.totes > 0} + + {/if} +
+ + {:else} + + (actionState = + actionState.substring(0, 1) === 'S' + ? 'Score' + : actionState.substring(0, 1) === 'E' + ? 'Eject' + : 'Intake')} + /> + {/if} +