This commit is contained in:
Yanick Champoux 2023-03-27 13:19:46 -04:00
parent e36c13bd2d
commit 0098e899c9
10 changed files with 60 additions and 52 deletions

View File

@ -2,6 +2,7 @@
<Identification {...identification} /> <Identification {...identification} />
<Propulsion {...propulsion} /> <Propulsion {...propulsion} />
<Structure {...structure} /> <Structure {...structure} />
<Weaponry {...weaponry} />
</main> </main>
<script> <script>
@ -9,10 +10,12 @@
import Propulsion from "./ShipEdit/Propulsion.svelte"; import Propulsion from "./ShipEdit/Propulsion.svelte";
import shipDux from "$lib/store/ship"; import shipDux from "$lib/store/ship";
import Structure from "./ShipEdit/Structure.svelte"; import Structure from "./ShipEdit/Structure.svelte";
import Weaponry from "./ShipEdit/Weaponry.svelte";
export let identification = {}; export let identification = {};
export let propulsion = {}; export let propulsion = {};
export let structure = {}; export let structure = {};
export let weaponry = {};
</script> </script>
<style> <style>

View File

@ -17,8 +17,8 @@
<script> <script>
import { getContext } from "svelte"; import { getContext } from "svelte";
import Field from "$lib/components/Field/index.svelte"; import Field from "$lib/components/Field.svelte";
import ShipItem from "$lib/components/ShipItem/index.svelte"; import ShipItem from "$lib/components/ShipItem.svelte";
export let reqs = {}; export let reqs = {};
export let advanced = false; export let advanced = false;

View File

@ -7,7 +7,7 @@
</Section> </Section>
<script> <script>
import Section from "$lib/components/Section/index.svelte"; import Section from "$lib/components/Section.svelte";
import Hull from './Hull.svelte'; import Hull from './Hull.svelte';
import Screens from './Screens.svelte'; import Screens from './Screens.svelte';
import Cargo from './Cargo.svelte'; import Cargo from './Cargo.svelte';

View File

@ -0,0 +1,39 @@
<Section label="weaponry">
<Firecons {...firecons} />
<ADFC {...adfc} />
<!--
<AddWeapon />
{#each weapons as weapon (weapon.id)}
<Weapon {weapon} id={weapon.id} />
{/each}
-->
</Section>
<script>
import { getContext } from "svelte";
import Section from "$lib/components/Section.svelte";
import ShipItem from "$lib/components/ShipItem.svelte";
import Field from "$lib/components/Field.svelte";
import Firecons from "./Weaponry/Firecons.svelte";
import ADFC from "./Weaponry/ADFC.svelte";
export let firecons = {};
export let adfc = {};
/*
import AddWeapon from './AddWeapon.svelte';
import Weapon from './Weapon/index.svelte';
export let weapons = [];
*/
</script>
<style>
</style>

View File

@ -5,14 +5,14 @@
</ShipItem> </ShipItem>
<script> <script>
import { getContext } from 'svelte'; import { getContext } from "svelte";
import ShipItem from "$lib/components/ShipItem/index.svelte"; import ShipItem from "$lib/components/ShipItem.svelte";
import Field from "$lib/components/Field/index.svelte"; import Field from "$lib/components/Field.svelte";
export let rating = 0; export let rating = 0;
export let reqs = {}; export let reqs = {};
const { dispatch } = getContext('ship'); const api = getContext("api");
$: dispatch.setADFC(rating); $: api?.dispatch?.setADFC?.(rating);
</script> </script>

View File

@ -10,7 +10,7 @@
<script> <script>
import { getContext } from "svelte"; import { getContext } from "svelte";
import Field from "../../Field/index.svelte"; import Field from "../../Field.svelte";
import { weaponTypes } from "$lib/shipDux/weaponry/weapons"; import { weaponTypes } from "$lib/shipDux/weaponry/weapons";

View File

@ -5,16 +5,16 @@
</ShipItem> </ShipItem>
<script> <script>
import { getContext } from 'svelte'; import { getContext } from "svelte";
import ShipItem from "$lib/components/ShipItem/index.svelte"; import ShipItem from "$lib/components/ShipItem.svelte";
import Field from "$lib/components/Field/index.svelte"; import Field from "$lib/components/Field.svelte";
export let stations = 0; export let stations = 0;
export let reqs = {}; export let reqs = {};
const { dispatch } = getContext('ship'); export let api = getContext("api");
$: dispatch.setFirecons(stations); $: api?.dispatch?.setFirecons?.(stations);
</script> </script>
<style> <style>

View File

@ -23,8 +23,8 @@
import { getContext } from "svelte"; import { getContext } from "svelte";
import Arcs from "../Arcs.svelte"; import Arcs from "../Arcs.svelte";
import ShipItem from "$lib/components/ShipItem/index.svelte"; import ShipItem from "$lib/components/ShipItem.svelte";
import Field from "$lib/components/Field/index.svelte"; import Field from "$lib/components/Field.svelte";
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";

View File

@ -17,8 +17,8 @@
import { getContext } from "svelte"; import { getContext } from "svelte";
import Arc from "./Arc.svelte"; import Arc from "./Arc.svelte";
import ShipItem from "$lib/components/ShipItem/index.svelte"; import ShipItem from "$lib/components/ShipItem.svelte";
import Field from "$lib/components/Field/index.svelte"; import Field from "$lib/components/Field.svelte";
import Beam from "./Beam/index.svelte"; import Beam from "./Beam/index.svelte";
import Submunition from "./Submunition.svelte"; import Submunition from "./Submunition.svelte";
import PointDefenceSystem from "./PDS.svelte"; import PointDefenceSystem from "./PDS.svelte";

View File

@ -1,34 +0,0 @@
<Section label="weaponry">
<Firecons {...firecons} />
<ADFC {...adfc} />
<AddWeapon />
{#each weapons as weapon (weapon.id)}
<Weapon {weapon} id={weapon.id} />
{/each}
</Section>
<script>
import { getContext } from 'svelte';
import Section from "$lib/components/Section/index.svelte";
import ShipItem from '$lib/components/ShipItem/index.svelte';
import Field from '$lib/components/Field/index.svelte';
import Firecons from './Firecons.svelte';
import ADFC from './ADFC.svelte';
import AddWeapon from './AddWeapon.svelte';
import Weapon from './Weapon/index.svelte';
export let firecons = {};
export let adfc = {};
export let weapons = [];
</script>
<style>
</style>