aotds-docks/src/components/Weaponry/AddWeapon/index.svelte

28 lines
679 B
Svelte
Raw Normal View History

2020-07-27 22:17:55 +00:00
<Field label="weapon type">
2021-06-13 15:36:59 +00:00
<select bind:value={weapon_type}>
2020-07-27 22:17:55 +00:00
<option>beam</option>
<option value="submunition">submunition pack</option>
<option value="pds">point defence system</option>
<option>scattergun</option>
<option value="needle">needle weapon</option>
2021-06-13 15:36:59 +00:00
</select>
2020-07-27 22:17:55 +00:00
2021-06-13 15:36:59 +00:00
<input
type="button"
value="add weapon"
class="button small blue"
on:click={add_weapon}
/>
2020-07-27 22:17:55 +00:00
</Field>
<script>
2021-06-13 15:36:59 +00:00
import { getContext } from "svelte";
import Field from "../../Field/index.svelte";
2020-07-27 22:17:55 +00:00
export let weapon_type = "beam";
2021-06-13 15:36:59 +00:00
export let ship = getContext("ship");
const add_weapon = () => ship?.dispatch_action("add_weapon", weapon_type);
2020-07-27 22:17:55 +00:00
</script>