aotds-docks/src/lib/components/ShipEdit/Propulsion/Ftl.svelte

34 lines
695 B
Svelte
Raw Normal View History

2022-03-03 16:06:51 +00:00
<ShipItem {...reqs}>
2023-04-20 15:54:18 +00:00
<div>FTL drive</div>
<nav>
2023-03-22 17:04:47 +00:00
{#each ftlTypes as t (t)}
2022-03-03 16:06:51 +00:00
<label
><input type="radio" bind:group={type} value={t} />
2023-04-20 15:54:18 +00:00
<span>{t}</span>
2022-03-03 16:06:51 +00:00
</label>
{/each}
2023-04-20 15:54:18 +00:00
</nav>
2022-03-03 16:06:51 +00:00
</ShipItem>
2023-03-21 14:10:07 +00:00
<script lang="ts">
2022-03-03 16:06:51 +00:00
import { getContext } from "svelte";
2023-03-21 14:10:07 +00:00
import ShipItem from "$lib/components/ShipItem.svelte";
import Field from "$lib/components/Field.svelte";
2022-03-03 16:06:51 +00:00
2023-03-22 17:04:47 +00:00
import { ftlTypes } from "$lib/store/ship/propulsion/ftl";
2023-03-21 14:10:07 +00:00
export let type = "none";
export let reqs = { mass: 0, cost: 0 };
export let api = getContext("api");
2022-03-03 16:06:51 +00:00
2023-03-22 17:04:47 +00:00
$: api?.dispatch.setFtlType?.(type);
2022-03-03 16:06:51 +00:00
</script>
<style>
label {
display: inline;
margin-right: 1em;
}
</style>