diff --git a/src/routes/scout/+page.svelte b/src/routes/scout/+page.svelte
index ddf130b..7491f7b 100644
--- a/src/routes/scout/+page.svelte
+++ b/src/routes/scout/+page.svelte
@@ -1,5 +1,5 @@
-
-
Team {team_key}
- {#if timelineExtended}
-
-
-
-
- {:else}
-
+
+
Team {team_key}
-
- {/if}
+
+
+
+
diff --git a/src/routes/scout/ActionInputs.svelte b/src/routes/scout/ActionInputs.svelte
index eadb514..a018aba 100644
--- a/src/routes/scout/ActionInputs.svelte
+++ b/src/routes/scout/ActionInputs.svelte
@@ -9,8 +9,8 @@
let held_bunnies: number = $state(0);
let held_balloons: number = $state(0);
let held_totes: number = $state(0);
- let held_scorables: number = $derived(held_balloons + held_bunnies);
- let held_ejectables: number = $derived(held_scorables + held_totes);
+ const held_scorables: number = $derived(held_balloons + held_bunnies);
+ const held_ejectables: number = $derived(held_scorables + held_totes);
function intake_piece() {
actionState = actionState === 'None' ? 'Intake' : actionState;
@@ -29,135 +29,146 @@
actionState = `ScoreBalloon${where}`;
}
function complete(success: boolean) {
- // Assume that the robot ejects even if they fail to score
- if (actionState.includes('IntakeBalloon')) held_balloons++;
- else if (actionState.includes('IntakeBunny')) held_bunnies++;
- else if (actionState.includes('IntakeTote')) held_totes++;
- else if (actionState.includes('ScoreBalloon')) held_balloons--;
+ // Assume that a failure means a note remains where it is
+ if (success) {
+ if (actionState.includes('IntakeBalloon')) held_balloons++;
+ else if (actionState.includes('IntakeBunny')) held_bunnies++;
+ else if (actionState.includes('IntakeTote')) held_totes++;
+ else if (actionState.includes('EjectBalloon')) held_balloons--;
+ else if (actionState.includes('EjectBunny')) held_bunnies--;
+ else if (actionState.includes('EjectTote')) held_totes--;
+ }
+ // Assume failed scoring is still ejecting
+ if (actionState.includes('ScoreBalloon')) held_balloons--;
else if (actionState.includes('ScoreBunny')) held_bunnies--;
- else if (actionState.includes('EjectBalloon')) held_balloons--;
- else if (actionState.includes('EjectBunny')) held_bunnies--;
- else if (actionState.includes('EjectTote')) held_totes--;
const action: AutoActionData = {
action: actionState as AutoAction,
success: success
};
- actions.push(action);
+ actions.unshift(action); // TODO: Make sure unshift works
actionState = 'None';
}
- const is_none_state = $derived(actionState === 'None');
- const is_intake_state = $derived(actionState === 'Intake');
- const is_score_state = $derived(actionState === 'Score');
+ const is_none_state: boolean = $derived(actionState === 'None');
+ const is_intake_state: boolean = $derived(actionState === 'Intake');
+ const is_score_state: boolean = $derived(actionState === 'Score');
const is_eject_state = $derived(actionState === 'Eject');
-
Number of pieces currently held: {held_scorables}
-
+
{#if is_none_state}
-
-
+
+
{#if held_scorables > 0}
-
+
{/if}
{#if held_ejectables > 0}
-
+
{/if}
{:else if is_intake_state}
-
-
Intake
+
+
- (actionState = 'IntakeTote')}
+ >Tote
- (actionState = 'IntakeBalloon')}
+ >Balloon From Ground
- (actionState = 'IntakeBalloonCoral')}>Ballon From Coral
+
{:else if is_score_state}
-
+
{#if held_bunnies > 0}
-
-
- {#if held_totes > 0}
+
Score Bunny
+
+
score_bunny('UncontrolledTote')}>Uncontrolled Tote
- {/if}
-
+ {#if held_totes > 0}
+
+ {/if}
+
+
{/if}
{#if held_balloons > 0}
-
-
- {#if held_totes > 0}
+
Score Ballon
+
+
score_balloon('UncontrolledTote')}>Uncontrolled Tote
- {/if}
-
+ {#if held_totes > 0}
+
+ {/if}
+
+
{/if}
-
+
{:else if is_eject_state}
-
+
+
Eject
{#if held_bunnies > 0}
- (actionState = 'EjectBunny')}>Bunny
{/if}
{#if held_balloons > 0}
(actionState = 'EjectBalloon')}>Ballon
{/if}
{#if held_totes > 0}
- (actionState = 'EjectTote')}>Tote
{/if}
-
+
{:else}