aotds-docks/src/lib/components/Hull/Armour/Layer/index.svelte

23 lines
416 B
Svelte
Raw Normal View History

2022-03-01 17:42:33 +00:00
<Field label={`layer ${layer}`}>
<input type="number" min="0" bind:value={rating} />
2020-07-26 21:55:51 +00:00
</Field>
<script>
2022-03-01 17:42:33 +00:00
import { getContext } from "svelte";
2020-07-26 21:55:51 +00:00
2022-03-01 17:42:33 +00:00
import Field from "$lib/components/Field/index.svelte";
2020-07-26 21:55:51 +00:00
2022-03-01 17:42:33 +00:00
export let layer = 1;
export let rating = 0;
2020-07-26 21:55:51 +00:00
2022-03-01 17:42:33 +00:00
const ship = getContext("ship");
2020-07-26 21:55:51 +00:00
2022-03-01 17:42:33 +00:00
$: ship?.dispatch_action("set_armour_layer", { layer, rating });
2020-07-26 21:55:51 +00:00
</script>
2020-07-28 18:55:08 +00:00
<style>
input {
width: 5em;
}
2022-03-01 17:42:33 +00:00
</style>