armor print
This commit is contained in:
parent
74d0317580
commit
9ecea73c44
@ -1,7 +1,7 @@
|
|||||||
<div class="layers">
|
<div class="layers">
|
||||||
{#each armour as layer (layer)}
|
{#each armor as layer,i (i)}
|
||||||
<div class="layer">
|
<div class="layer">
|
||||||
{#each _.range(layer.rating) as i (i)}
|
{#each Array.from({length: layer}) as j}
|
||||||
<div class="cell" />
|
<div class="cell" />
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
@ -11,9 +11,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
|
||||||
export let armour = [];
|
export let armor = [];
|
||||||
|
console.log(armor)
|
||||||
|
|
||||||
$: console.log(armour);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
22
src/lib/components/Output/Print/Hull/Armour.stories.svelte
Normal file
22
src/lib/components/Output/Print/Hull/Armour.stories.svelte
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<Meta title="Output/Print/Structure/Armor" component={Armor} argTypes={{
|
||||||
|
armor: {
|
||||||
|
type: 'object',
|
||||||
|
defaultValue: [2,4],
|
||||||
|
}
|
||||||
|
}} />
|
||||||
|
|
||||||
|
<Story name="Primary" args={{}} />
|
||||||
|
|
||||||
|
<Template let:args>
|
||||||
|
<div style="width: 50em">
|
||||||
|
<Armor {...args} />
|
||||||
|
</div>
|
||||||
|
</Template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
|
||||||
|
|
||||||
|
import Armor from './Armor.svelte';
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
@ -1,6 +1,10 @@
|
|||||||
<div>
|
<div>
|
||||||
<Identification {...$state.identification} />
|
<Identification {...$state.identification} />
|
||||||
|
|
||||||
|
<div class="section-2">
|
||||||
|
<Hull structure={$state.structure} shipMass={$state.identification.mass} />
|
||||||
|
</div>
|
||||||
|
|
||||||
<Weapons weapons={$state.weaponry.weapons} />
|
<Weapons weapons={$state.weaponry.weapons} />
|
||||||
|
|
||||||
<MainSystems ftl={$state?.propulsion?.ftl}
|
<MainSystems ftl={$state?.propulsion?.ftl}
|
||||||
@ -28,7 +32,7 @@ import { getContext } from 'svelte';
|
|||||||
|
|
||||||
import Identification from "./Identification/index.svelte";
|
import Identification from "./Identification/index.svelte";
|
||||||
import MainSystems from "./MainSystems/index.svelte";
|
import MainSystems from "./MainSystems/index.svelte";
|
||||||
/* import Hull from "./Hull/index.svelte"; */
|
import Hull from "./Hull/index.svelte";
|
||||||
import Weapons from "./Weapons/index.svelte";
|
import Weapons from "./Weapons/index.svelte";
|
||||||
/* import Systems from "./Systems/index.svelte"; */
|
/* import Systems from "./Systems/index.svelte"; */
|
||||||
|
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
<Meta title="ShipEdit/Carrier" component={Carrier} argTypes={{}} />
|
<Meta title="ShipEdit/Carrier" component={Carrier} argTypes={{
|
||||||
|
armor: {
|
||||||
|
type: 'object',
|
||||||
|
defaultValue: [2,4],
|
||||||
|
}
|
||||||
|
}} />
|
||||||
|
|
||||||
<Story name="Primary" args={{}} />
|
<Story name="Primary" args={{}} />
|
||||||
|
|
||||||
|
@ -3,6 +3,20 @@ import u from "updeep";
|
|||||||
|
|
||||||
import reqs from "../reqs.js";
|
import reqs from "../reqs.js";
|
||||||
|
|
||||||
|
const schema = {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
reqs: { type: 'object', properties: {
|
||||||
|
cost: { type: 'number' },
|
||||||
|
mass: { type: 'number' },
|
||||||
|
} },
|
||||||
|
layers: { type: 'array', items: 'number' }
|
||||||
|
},
|
||||||
|
examples: [
|
||||||
|
{ reqs: { cost: 5, mass: 5 }, layers: [2,4 ] }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
const dux = new Updux({
|
const dux = new Updux({
|
||||||
subduxes: {
|
subduxes: {
|
||||||
reqs,
|
reqs,
|
||||||
|
Loading…
Reference in New Issue
Block a user