aotds-docks/src/lib/components/ShipEdit/Propulsion/Drive/index.svelte

38 lines
810 B
Svelte
Raw Normal View History

2022-03-01 17:42:33 +00:00
<ShipItem {...reqs}>
<div>
<Field label="thrust rating">
2022-03-20 18:42:59 +00:00
<input class="short" type="number" bind:value={rating} min="0" max="20" step="1" />
2022-03-01 17:42:33 +00:00
</Field>
<label><input type="checkbox" bind:checked={advanced} /> advanced</label>
</div>
2020-07-19 20:21:28 +00:00
</ShipItem>
<script>
2022-03-01 17:42:33 +00:00
import { getContext } from "svelte";
import Field from "$lib/components/Field/index.svelte";
import ShipItem from "$lib/components/ShipItem/index.svelte";
2020-07-19 20:21:28 +00:00
2022-03-01 17:42:33 +00:00
export let reqs = {};
export let advanced = false;
export let rating = 0;
2020-07-19 20:21:28 +00:00
2022-03-02 18:42:42 +00:00
const ship = getContext("ship");
2020-07-19 20:21:28 +00:00
2022-03-02 18:42:42 +00:00
$: ship.dispatch.setDrive({ rating, advanced });
2020-07-19 20:21:28 +00:00
</script>
<style>
2022-03-01 17:42:33 +00:00
div {
2020-07-19 20:21:28 +00:00
display: flex;
align-items: end;
2022-03-01 17:42:33 +00:00
}
label {
font-family: var(--main-font-family);
margin-left: 2em;
}
input[type="number"] {
width: 5em;
}
2020-07-19 20:21:28 +00:00
</style>