all the weapons can be printed

This commit is contained in:
Yanick Champoux 2023-04-28 12:23:39 -04:00
parent 5a19d2b596
commit d2dc9e31ca
8 changed files with 193 additions and 18 deletions

View File

Before

Width:  |  Height:  |  Size: 701 B

After

Width:  |  Height:  |  Size: 701 B

View File

@ -17,8 +17,6 @@
$: options = Object.fromEntries(types.map((t) => [t, t])); $: options = Object.fromEntries(types.map((t) => [t, t]));
console.log(type);
$: initial = types.find((t) => t.type === type)?.initial ?? {}; $: initial = types.find((t) => t.type === type)?.initial ?? {};
$: weaponComp = printComps[type]; $: weaponComp = printComps[type];
</script> </script>

View File

@ -1,10 +1,20 @@
<div>TODO</div> <div>
{#each weapons as weapon (weapon.id)}
<svelte:component this={printComps[weapon.specs.type]} {...weapon.specs} />
{/each}
</div>
<script> <script>
import printComps from "./printComps.js";
export let weapons = [];
</script> </script>
<style> <style>
div { div {
background-color: red; display: flex;
align-items: center;
justify-content: center;
text-align: center;
} }
</style> </style>

View File

@ -4,9 +4,15 @@
<script> <script>
import PrintShip from "./index.svelte"; import PrintShip from "./index.svelte";
import { weaponTypes } from "$lib/store/ship/weaponry/rules";
export let Hst; export let Hst;
const weapons = weaponTypes.map(({ initial: specs }, id) => ({
id: id + 1,
specs,
}));
const ship = { const ship = {
schemaVersion: "1", schemaVersion: "1",
identification: { identification: {
@ -107,20 +113,7 @@
mass: 0, mass: 0,
}, },
}, },
weapons: [ weapons,
{
id: 1,
specs: {
type: "beam",
weaponClass: 2,
arcs: ["FS", "F", "FP"],
},
reqs: {
mass: 2,
cost: 6,
},
},
],
}, },
}; };
</script> </script>

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="76mm"
height="76mm"
viewBox="0 0 75.999999 76"
version="1.1"
id="svg8"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="needle-beam.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="3.8476038"
inkscape:cy="85.711119"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="957"
inkscape:window-x="0"
inkscape:window-y="34"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-26.714287,-55.946423)">
<rect
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect815"
width="15.119047"
height="40.065475"
x="56.865467"
y="59.363686" />
<circle
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path817"
cx="64.222572"
cy="112.87973"
r="17.764881" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

78
static/icons/pds.svg Normal file
View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 201.60001 201.60001"
enable-background="new 0 0 960 560"
xml:space="preserve"
sodipodi:docname="pds.svg"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
width="201.60001"
height="201.60001"><metadata
id="metadata31"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs29">
</defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="957"
id="namedview27"
showgrid="false"
inkscape:zoom="0.36875"
inkscape:cx="100.8"
inkscape:cy="100.8"
inkscape:window-x="0"
inkscape:window-y="34"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<circle
style="fill:none;stroke:#000000;stroke-width:15;stroke-miterlimit:10"
id="circle2"
r="93.300003"
cy="100.8"
cx="100.8"
stroke-miterlimit="10" /><g
id="g22"
transform="translate(-379.2,-179.2)">
<path
inkscape:connector-curvature="0"
id="path18"
d="m 480,193.3 c -27.8,0 -52.6,13.1 -68.4,33.5 L 480,280 548.4,226.7 C 532.6,206.4 507.8,193.3 480,193.3 Z" />
<path
inkscape:connector-curvature="0"
id="path20"
d="m 480,280 -68.4,53.3 c 15.9,20.4 40.6,33.5 68.4,33.5 27.8,0 52.6,-13.1 68.4,-33.5 z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 960 560" enable-background="new 0 0 960 560" xml:space="preserve">
<g>
<polygon points="480,280 609.1,56.4 350.9,56.4 480,280 609.1,56.4 350.9,56.4 "/>
<polygon points="350.9,503.6 480,280 221.8,280 350.9,503.6 480,280 221.8,280 "/>
<polygon points="609.1,503.6 738.2,280 480,280 609.1,503.6 738.2,280 480,280 "/>
<circle fill="none" stroke="#000000" stroke-width="24" stroke-miterlimit="10" cx="480" cy="280" r="149.2"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 827 B

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 960 560" enable-background="new 0 0 960 560" xml:space="preserve">
<g>
<polygon stroke="#000000" stroke-miterlimit="10" points="480,329.3 636.8,94.5 323.2,94.5 480,329.3 636.8,94.5 323.2,94.5 "/>
</g>
<circle fill="none" stroke="#000000" stroke-width="7" stroke-miterlimit="10" cx="480" cy="329.3" r="159"/>
</svg>

After

Width:  |  Height:  |  Size: 701 B