diff --git a/config/dependencies.yaml b/config/dependencies.yaml index 9046ca6ce4b..d63ad07d41f 100644 --- a/config/dependencies.yaml +++ b/config/dependencies.yaml @@ -258,7 +258,7 @@ utils: wahid: peer: '@freesewing/brian': *freesewing - '@freesewing/plugin-round': *freesewing + '@freesewing/plugin-bust': *freesewing yuri: peer: '@freesewing/brian': *freesewing diff --git a/designs/wahid/config/index.js b/designs/wahid/config/index.js index 4e030f4da34..bae15dc1985 100644 --- a/designs/wahid/config/index.js +++ b/designs/wahid/config/index.js @@ -18,6 +18,7 @@ export default { 'backScyeDart', 'frontScyeDart', 'centerBackDart', + 'draftForHighBust', ], style: [ 'pocketLocation', @@ -42,6 +43,7 @@ export default { 'shoulderToShoulder', 'waist', ], + optionalMeasurements: [ 'highBust' ], dependencies: { backBlock: 'base', frontBlock: 'backBlock', @@ -106,5 +108,8 @@ export default { shoulderInset: { pct: 10, min: 0, max: 20 }, neckInset: { pct: 5, min: 0, max: 10 }, pocketAngle: { deg: 5, min: 0, max: 5 }, + + // draft for high bust + draftForHighBust: { bool: false }, }, } diff --git a/designs/wahid/src/index.js b/designs/wahid/src/index.js index e49f19649a6..d098482cb75 100644 --- a/designs/wahid/src/index.js +++ b/designs/wahid/src/index.js @@ -1,8 +1,7 @@ import freesewing from '@freesewing/core' import Brian from '@freesewing/brian' import plugins from '@freesewing/plugin-bundle' -import round from '@freesewing/plugin-round' -import buttons from '@freesewing/plugin-buttons' +import plugin from '@freesewing/plugin-bust' // Note: conditional plugin import config from '../config' // Parts import draftFront from './front' @@ -27,8 +26,20 @@ const wristPlugin = { }, } -// Create pattern -const Wahid = new freesewing.Design(config, [plugins, round, buttons, wristPlugin]) +/* Check to see whether we should load the bust plugin + * Only of the `draftForHighBust` options is set + * AND the highBust measurement is available + */ +const condition = (settings = false) => + settings && + settings.options && + settings.options.draftForHighBust && + settings.measurements.highBust + ? true + : false + +// Create design +const Wahid = new freesewing.Design(config, [plugins, wristPlugin], { plugin, condition }) // Parts we're getting from Brian Wahid.prototype.draftBase = function (part) {