aotds-docks/src/components/Carrier/Squadron/index.svelte

39 lines
889 B
Svelte
Raw Normal View History

2020-07-27 17:42:19 +00:00
<ShipItem {cost} {mass} >
<Field label={`squadron ${id}`}>
<select bind:value={type}>
{#each types as type (type)}
2021-06-13 15:36:59 +00:00
<option>{type}</option>
2020-07-27 17:42:19 +00:00
{/each}
</select>
</Field>
</ShipItem>
<script>
import {getContext } from 'svelte';
2021-05-17 13:48:31 +00:00
import Section from "$lib/components/Section/index.svelte";
import Field from "$lib/components/Field/index.svelte";
import ShipItem from "$lib/components/ShipItem/index.svelte";
import dux from '$lib/dux/carrier';
import squadron_types from '$lib/dux/carrier/squadron_types';
2020-07-27 17:42:19 +00:00
const types = squadron_types.map( ({type}) => type );
export let id = 1;
export let type = "standard";
2021-06-13 15:36:59 +00:00
export let ftl = false;
2020-07-27 17:42:19 +00:00
export let cost =0;
export let mass = 0;
2021-06-13 15:36:59 +00:00
export let ship = getContext('ship');
2020-07-27 17:42:19 +00:00
2021-06-13 15:36:59 +00:00
$: ship?.dispatch_action('set_squadron',{ id, type, });
2020-07-27 17:42:19 +00:00
</script>
<style>
div {
background-color: red;
}
</style>