40 lines
743 B
Svelte
40 lines
743 B
Svelte
|
<Section label="hull">
|
||
|
|
||
|
<ShipItem {cost} {mass} >
|
||
|
<Field label="integrity">
|
||
|
<input
|
||
|
bind:value={rating}
|
||
|
type="number" {min} {max} />
|
||
|
</Field>
|
||
|
</ShipItem>
|
||
|
|
||
|
|
||
|
<Screens {screens} on:add_screen />
|
||
|
|
||
|
</Section>
|
||
|
|
||
|
<script>
|
||
|
import { createEventDispatcher } from 'svelte';
|
||
|
|
||
|
import Section from '~C/Section';
|
||
|
import Field from '~C/Field';
|
||
|
import ShipItem from '~C/ShipItem';
|
||
|
import Screens from './Screens';
|
||
|
|
||
|
export let cost, mass, ship_mass, rating, screens = (
|
||
|
0, 0, 10, 1, []
|
||
|
);
|
||
|
|
||
|
let min, max;
|
||
|
$: min = Math.ceil(ship_mass / 10);
|
||
|
$: max = ship_mass;
|
||
|
|
||
|
const dispatch = createEventDispatcher();
|
||
|
|
||
|
$: dispatch( 'change_hull', { rating } );
|
||
|
|
||
|
</script>
|
||
|
|
||
|
<style>
|
||
|
</style>
|