diff --git a/packages/simon/config/config.js b/packages/simon/config/index.js similarity index 91% rename from packages/simon/config/config.js rename to packages/simon/config/index.js index eef5af0b2e0..170e07efccb 100644 --- a/packages/simon/config/config.js +++ b/packages/simon/config/index.js @@ -57,35 +57,22 @@ export default { cuffOverlap: 0.15, frenchCuffRoundFactor: 0.05, + // Booleans + extraTopButton: { bool: true }, + splitYoke: { bool: false }, + barrelCuffNarrowButton: { bool: true }, + seperateButtonPlacket: { bool: false }, + seperateButtonholePlacket: { bool: false }, + // Lists - extraTopButton: { - list: ["yes", "no"], - dflt: "yes" - }, - splitYoke: { - list: ["yes", "no"], - dflt: "no" - }, - barrelcuffNarrowButton: { - list: ["yes", "no"], - dflt: "yes" - }, hemStyle: { list: ["straight", "baseball", "slashed"], dflt: "straight" }, - buttonPlacketType: { - list: ["cutOn", "seperate"], - dflt: "cutOn" - }, buttonPlacketStyle: { list: ["classic", "seamless"], dflt: "classic" }, - buttonholePlacketType: { - list: ["cutOn", "seperate"], - dflt: "cutOn" - }, buttonholePlacketStyle: { list: ["classic", "seamless"], dflt: "seamless" diff --git a/packages/simon/index.html b/packages/simon/index.html index a1684cc28ab..5a8ec88cee4 100644 --- a/packages/simon/index.html +++ b/packages/simon/index.html @@ -76,7 +76,7 @@ }, "embed": true, "sa": 0, - "paperless": true, + //"paperless": true, "measurements": { "bicepsCircumference": 335, "centerBackNeckToWaist": 520, @@ -116,9 +116,9 @@ let settings1 = { ...settings }; pattern1.settings.options.buttonholePlacketType = "cut-on"; pattern1.settings.options.buttonholePlacketStyle = "seamless"; pattern1.settings.options.cuffButtonRows = 2; - pattern1.settings.options.barrelCuffNarrowButton = "yes"; - pattern1.settings.options.cuffStyle = "roundedFrenchCuff"; - pattern1.settings.options.splitYoke = "yes"; + pattern1.settings.options.barrelCuffNarrowButton = true; + pattern1.settings.options.cuffStyle = "roundedBarrelCuff"; + pattern1.settings.options.extraTopButton = true; pattern1.settings.sa = 10; //pattern1.settings.only = ["front", "back"]; pattern1.draft(); diff --git a/packages/simon/package.json b/packages/simon/package.json index 5e9a6f817ea..f6eee7872b8 100644 --- a/packages/simon/package.json +++ b/packages/simon/package.json @@ -47,7 +47,7 @@ ] }, "dependencies": { - "@freesewing/brian": "^0.22.0", + "@freesewing/brian": "^0.22.2", "@freesewing/plugin-banner": "0.2.0", "@freesewing/plugin-bundle": "^0.7.1", "@freesewing/plugin-buttons": "0.1.0", diff --git a/packages/simon/src/buttonholeplacket.js b/packages/simon/src/buttonholeplacket.js index 02c86dd9c97..9267747f880 100644 --- a/packages/simon/src/buttonholeplacket.js +++ b/packages/simon/src/buttonholeplacket.js @@ -19,7 +19,7 @@ export default part => { } = part.shorthand(); if ( - options.buttonholePlacketType !== "seperate" || + !options.seperateButtonholePlacket || options.buttonholePlacketStyle !== "classic" ) { part.paths = {}; diff --git a/packages/simon/src/buttonplacket.js b/packages/simon/src/buttonplacket.js index 247e3bb5886..574b3c0cbcf 100644 --- a/packages/simon/src/buttonplacket.js +++ b/packages/simon/src/buttonplacket.js @@ -19,7 +19,7 @@ export default part => { } = part.shorthand(); if ( - options.buttonPlacketType !== "seperate" || + !options.seperateButtonPlacket || options.buttonPlacketStyle !== "classic" ) { part.paths = {}; diff --git a/packages/simon/src/frontleft.js b/packages/simon/src/frontleft.js index fa0ca5cf834..b903f289244 100644 --- a/packages/simon/src/frontleft.js +++ b/packages/simon/src/frontleft.js @@ -17,7 +17,7 @@ export default part => { return options.buttonholePlacketStyle === "seamless" ? frontLeftSeamless(part) - : options.buttonholePlacketType === "seperate" + : seperateButtonholePlacket ? frontLeftClassicSeperate(part) : frontLeftClassicCuton(part); }; diff --git a/packages/simon/src/frontright.js b/packages/simon/src/frontright.js index dd0208ac0a4..06a5996f06b 100644 --- a/packages/simon/src/frontright.js +++ b/packages/simon/src/frontright.js @@ -30,7 +30,7 @@ export default part => { return options.buttonPlacketStyle === "seamless" ? frontRightSeamless(part) - : options.buttonPlacketType === "seperate" + : options.seperateButtonPlacket ? frontRightClassicSeperate(part) : frontRightClassicCuton(part); }; diff --git a/packages/simon/src/index.js b/packages/simon/src/index.js index 614212b533e..c7898db5b33 100644 --- a/packages/simon/src/index.js +++ b/packages/simon/src/index.js @@ -3,7 +3,7 @@ import Brian from "@freesewing/brian"; import plugins from "@freesewing/plugin-bundle"; import flipPlugin from "@freesewing/plugin-flip"; import buttonPlugin from "@freesewing/plugin-buttons"; -import config from "../config/config"; +import config from "../config"; // Parts import draftBack from "./back"; import draftFront from "./front"; diff --git a/packages/simon/src/shared.js b/packages/simon/src/shared.js index 994721d0202..e287c6009a0 100644 --- a/packages/simon/src/shared.js +++ b/packages/simon/src/shared.js @@ -31,7 +31,7 @@ export const addButtons = function( ); snippets[snippet + i] = new Snippet(snippet, points["button" + i]); } - if (options.extraTopButton === "yes") + if (options.extraTopButton) snippets["top" + snippet] = new Snippet( snippet, points[origin].shift(-90, len / options.buttons / 2) @@ -96,7 +96,7 @@ export const decorateBarrelCuff = part => { "buttonhole", points["buttonhole" + i] ).attr("data-rotate", 90); - if (options.barrelcuffNarrowButton === "yes") { + if (options.barrelCuffNarrowButton) { points["narrowButton" + i] = points["button" + i].shift(180, margin); snippets["narrowButton" + i] = new Snippet( "button", @@ -206,7 +206,7 @@ export const paperlessBarrelCuff = part => { to: points.topLeft.shift(0, 40), x: points.bottomLeft.x - 15 - sa }); - if (options.barrelcuffNarrowButton === "yes") { + if (options.barrelCuffNarrowButton) { macro("hd", { from: points.narrowButton1, to: points.button1, diff --git a/packages/simon/src/yoke.js b/packages/simon/src/yoke.js index f86d873a884..34c60097bed 100644 --- a/packages/simon/src/yoke.js +++ b/packages/simon/src/yoke.js @@ -30,7 +30,7 @@ export default part => { .curve(points.armholePitchCp2, points.shoulderCp1, points.shoulder) .line(points.neck) .curve_(points.neckCp2, points.cbNeck); - if (options.splitYoke === "yes") + if (options.splitYoke) paths.saBase = paths.saBase.line(points.cbYoke).close(); paths.seam = paths.saBase.clone(); paths.saBase.render = false; @@ -44,7 +44,7 @@ export default part => { points.logo = points.title.shift(-90, 50); snippets.logo = new Snippet("logo", points.logo); snippets.logo.attr("data-scale", 0.8); - if (options.splitYoke === "yes") { + if (options.splitYoke) { points.grainlineFrom = points.cbYoke.shift(0, 20); points.grainlineTo = points.cbNeck.shift(0, 20); macro("grainline", { @@ -66,7 +66,7 @@ export default part => { if (sa) { paths.sa = paths.saBase.offset(sa).attr("class", "fabric sa"); - if (options.splitYoke === "no") { + if (options.splitYoke) { paths.sa = paths.sa .line(points.cbNeck) .move(points.cbYoke)