aotds-docks/src/lib/components/ShipEdit/Weaponry/Weapon/Needle.svelte

33 lines
641 B
Svelte
Raw Normal View History

2022-03-07 04:11:17 +00:00
<label>needle weapon</label>
2022-03-01 17:42:33 +00:00
<Arcs selected={arcs} on:click_arc={({ detail }) => click_arc(detail)} />
2020-07-27 22:17:55 +00:00
<script>
2022-03-01 17:42:33 +00:00
import { getContext } from "svelte";
2022-03-07 04:11:17 +00:00
import Arcs from "./Arcs.svelte";
2022-03-01 17:42:33 +00:00
import { createEventDispatcher } from "svelte";
2021-05-17 13:48:31 +00:00
2022-03-01 17:42:33 +00:00
const all_arcs = ["FS", "F", "FP", "AP", "A", "AS"];
2020-07-27 22:17:55 +00:00
2022-03-01 17:42:33 +00:00
export let arcs = ["F"];
2020-07-27 22:17:55 +00:00
2022-03-01 17:42:33 +00:00
const click_arc = (arc) => {
2022-03-07 04:11:17 +00:00
console.log(arc);
return;
2022-03-01 17:42:33 +00:00
if (arcs[0] === arc) return;
arcs = [arc];
};
2020-07-27 22:17:55 +00:00
2022-03-01 17:42:33 +00:00
const dispatch = createEventDispatcher();
2020-07-27 22:17:55 +00:00
2022-03-07 04:11:17 +00:00
$: dispatch("change", { arcs });
2020-07-27 22:17:55 +00:00
</script>
<style>
2022-03-01 17:42:33 +00:00
.arc {
2020-07-27 22:17:55 +00:00
display: flex;
flex-direction: column;
margin-right: 1em;
2022-03-01 17:42:33 +00:00
}
</style>