diff --git a/src/lib/ActionInputStateMachine.svelte.ts b/src/lib/ActionInputStateMachine.svelte.ts index ba3a707..ef32586 100644 --- a/src/lib/ActionInputStateMachine.svelte.ts +++ b/src/lib/ActionInputStateMachine.svelte.ts @@ -32,6 +32,8 @@ export class ActionInputVerifier { verify_new_action(action_data: AutoActionData): boolean { const success = action_data.success; const action = action_data.action; + console.log(action); + if (action.includes('InternalTote') && this.held_totes === 0) return false; if (success) { if (action.includes('IntakeBalloon')) this.held_balloons++; else if (action.includes('IntakeBunny')) this.held_bunnies++; diff --git a/src/lib/components/Timeline.svelte b/src/lib/components/Timeline.svelte index 1a6fd35..4e552a1 100644 --- a/src/lib/components/Timeline.svelte +++ b/src/lib/components/Timeline.svelte @@ -23,9 +23,6 @@ } function shift(index: number, change: -1 | 1) { - //if (furthest_auto_index === index) furthest_auto_index += change; - //else if (furthest_auto_index === index + change) furthest_auto_index = index; - [actions[index], actions[index + change]] = [actions[index + change], actions[index]]; verify(); } @@ -33,12 +30,13 @@ function verify() { const action_input_verifier = new ActionInputVerifier(); action_input_verifier.verify_actions(actions); + console.log(actions); // TODO: Fix this horrible and jank solution held = Object.hasOwn(held, 'bunnies') ? action_input_verifier.get_held_auto() : action_input_verifier.get_held_tele(); } - const is_valid_timeline = $derived(actions.filter((action) => !action.ok).length === 0); + const is_valid_timeline: boolean = $derived(!actions.find((action) => !action.ok)); + {:else if gamePhase === 'Auto'} (actionState = 'IntakeBalloonCoral')}>Balloon: Coral {:else if is_eject_state} -
+
{#if held.bunnies > 0} (actionState = 'EjectBalloon')}>Balloon {/if} {#if held.totes > 0} diff --git a/src/routes/scout/[team_data]/TeleActionInputs.svelte b/src/routes/scout/[team_data]/TeleActionInputs.svelte index 4704033..79197f3 100644 --- a/src/routes/scout/[team_data]/TeleActionInputs.svelte +++ b/src/routes/scout/[team_data]/TeleActionInputs.svelte @@ -88,7 +88,7 @@ > (actionState = 'IntakeBalloonCoral')}>Balloon: Coral
0} (actionState = 'EjectBalloon')}>Balloon {/if} {#if held.totes > 0}