aotds-docks/src/lib/components/Ftl/index.svelte

35 lines
702 B
Svelte
Raw Normal View History

2022-03-01 17:42:33 +00:00
<ShipItem {mass} {cost}>
<Field label="FTL drive">
{#each types as t (t)}
<label
><input type="radio" bind:group={type} value={t} on:change={change} />
{t}
</label>
{/each}
</Field>
</ShipItem>
2020-07-19 20:21:28 +00:00
2022-03-01 17:42:33 +00:00
<script>
import { createEventDispatcher } from "svelte";
2020-07-19 20:21:28 +00:00
2022-03-01 17:42:33 +00:00
import ShipItem from "../ShipItem/index.svelte";
import Field from "../Field/index.svelte";
2020-07-19 20:21:28 +00:00
2022-03-01 17:42:33 +00:00
export let type = "none";
export let cost = 0;
export let mass = 0;
2020-07-19 20:21:28 +00:00
2022-03-01 17:42:33 +00:00
const dispatch = createEventDispatcher();
2020-07-19 20:21:28 +00:00
2022-03-01 17:42:33 +00:00
const change = () => dispatch("change_ftl", type);
2020-07-19 20:21:28 +00:00
2022-03-01 17:42:33 +00:00
const types = ["none", "standard", "advanced"];
2020-07-19 20:21:28 +00:00
</script>
<style>
2022-03-01 17:42:33 +00:00
label {
2020-07-19 20:21:28 +00:00
display: inline;
margin-right: 1em;
2022-03-01 17:42:33 +00:00
}
2020-07-19 20:21:28 +00:00
</style>