1
0
Fork 0

chore(octoplushy): Port to v3 stage 2

This commit is contained in:
joostdecock 2022-09-11 16:08:46 +02:00
parent 7ffba2f81d
commit f3313cdb57
3 changed files with 25 additions and 19 deletions

View file

@ -1,7 +1,8 @@
import { headSection1, headSection2 } from './head.mjs' import { headSection1, headSection2 } from './head.mjs'
function octoplushyArmSection(partNumber, part) { function octoplushyArmSection(
const { partNumber,
{
options, options,
Point, Point,
Path, Path,
@ -15,8 +16,9 @@ function octoplushyArmSection(partNumber, part) {
macro, macro,
utils, utils,
store, store,
} = part.shorthand() part,
}
) {
if (partNumber > (options.type == 'squid' ? 1 : 0)) { if (partNumber > (options.type == 'squid' ? 1 : 0)) {
return part return part
} }
@ -315,10 +317,10 @@ function octoplushyArmSection(partNumber, part) {
export const armSection1 = { export const armSection1 = {
name: 'octoplushy.armSection1', name: 'octoplushy.armSection1',
after: headSection1, after: headSection1,
draft: (part) => octoplushyArmSection(0, part), draft: (params) => octoplushyArmSection(0, params),
} }
export const armSection2 = { export const armSection2 = {
name: 'octoplushy.armSection2', name: 'octoplushy.armSection2',
after: headSection2, after: headSection2,
draft: (part) => octoplushyArmSection(1, part), draft: (params) => octoplushyArmSection(1, params),
} }

View file

@ -1,7 +1,8 @@
import { headSection1 } from './head.mjs' import { headSection1 } from './head.mjs'
function octoplushyEye(partNumber, part) { function octoplushyEye(
const { partNumber,
{
options, options,
Point, Point,
Path, Path,
@ -14,8 +15,9 @@ function octoplushyEye(partNumber, part) {
paperless, paperless,
macro, macro,
store, store,
} = part.shorthand() part,
}
) {
if (options.type != 'squid' && options.type != 'octopus') { if (options.type != 'squid' && options.type != 'octopus') {
return part return part
} }
@ -133,15 +135,15 @@ function octoplushyEye(partNumber, part) {
export const eye1 = { export const eye1 = {
name: 'octoplushy.eye1', name: 'octoplushy.eye1',
after: headSection1, after: headSection1,
draft: (part) => octoplushyEye(0, part), draft: (params) => octoplushyEye(0, params),
} }
export const eye2 = { export const eye2 = {
name: 'octoplushy.eye2', name: 'octoplushy.eye2',
after: headSection1, after: headSection1,
draft: (part) => octoplushyEye(1, part), draft: (params) => octoplushyEye(1, params),
} }
export const eye3 = { export const eye3 = {
name: 'octoplushy.eye3', name: 'octoplushy.eye3',
after: headSection1, after: headSection1,
draft: (part) => octoplushyEye(2, part), draft: (params) => octoplushyEye(2, params),
} }

View file

@ -1,5 +1,6 @@
function octoplushyHeadSection(partNumber, part) { function octoplushyHeadSection(
const { partNumber,
{
options, options,
Point, Point,
Path, Path,
@ -13,8 +14,9 @@ function octoplushyHeadSection(partNumber, part) {
macro, macro,
utils, utils,
store, store,
} = part.shorthand() part,
}
) {
if (partNumber > (options.type == 'squid' ? 1 : 0)) { if (partNumber > (options.type == 'squid' ? 1 : 0)) {
return part return part
} }
@ -630,10 +632,10 @@ const options = {
export const headSection1 = { export const headSection1 = {
name: 'octoplushy.headSection1', name: 'octoplushy.headSection1',
options, options,
draft: (part) => octoplushyHeadSection(0, part), draft: (params) => octoplushyHeadSection(0, params),
} }
export const headSection2 = { export const headSection2 = {
name: 'octoplushy.headSection2', name: 'octoplushy.headSection2',
options, options,
draft: (part) => octoplushyHeadSection(1, part), draft: (params) => octoplushyHeadSection(1, params),
} }