code:
App.UI.Wardrobe = {};

App.UI.Wardrobe.clothes = function(slave) {
	const {
		// eslint-disable-next-line no-unused-vars
		he, him, his, hers, himself, boy, He, His
	} = getPronouns(slave);

	let el = document.createElement('div');
	let links;
	if (slave.fuckdoll === 0) {
		// <<= App.Desc.clothing($activeSlave)>>

		let label = document.createElement('div');
		label.append(`Clothes: `);

		let choice = document.createElement('span');
		choice.style.fontWeight = "bold";
		choice.textContent = (`${slave.clothes} `);
		label.appendChild(choice);

		// Choose her own
		if (slave.clothes !== `choosing her own clothes`) {
			let choiceOptionsArray = [];
			choiceOptionsArray.push({text: `Let ${him} choose`, updateSlave: {clothes: `choosing her own clothes`, choosesOwnClothes: 1}});
			label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "clothes", false));
		}
		el.appendChild(label);

		let niceOptionsArray = [];
		let harshOptionsArray = [];

		let clothingOption;
		// Nice clothes
		App.Data.misc.niceClothes.forEach(item => {
			clothingOption = {
				text: item.name,
				updateSlave: {clothes: item.value, choosesOwnClothes: 0}
			};
			if (item.fs) {
				clothingOption.FS = item.fs;
			}
			niceOptionsArray.push(clothingOption);
		});
		// Harsh clothes
		App.Data.misc.harshClothes.forEach(item => {
			clothingOption = {
				text: item.name,
				updateSlave: {clothes: item.value, choosesOwnClothes: 0}
			};
			if (item.fs) {
				clothingOption.FS = item.fs;
			}
			if (item.value !== "choosing her own clothes") {
				harshOptionsArray.push(clothingOption);
			}
		});

		// Sort
		niceOptionsArray = niceOptionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);
		harshOptionsArray = harshOptionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);

		// Nice options
		links = document.createElement('div');
		links.className = "choices";
		links.append(`Nice: `);
		links.appendChild(App.UI.SlaveInteract.generateRows(niceOptionsArray, slave, "clothes", true));
		el.appendChild(links);

		// Harsh options
		links = document.createElement('div');
		links.className = "choices";
		links.append(`Harsh: `);
		links.appendChild(App.UI.SlaveInteract.generateRows(harshOptionsArray, slave, "clothes", true));
		el.appendChild(links);
	}
	if (slave.fuckdoll !== 0 || slave.clothes === "restrictive latex" || slave.clothes === "a latex catsuit" || slave.clothes === "a cybersuit" || slave.clothes === "a comfortable bodysuit") {
		if (V.seeImages === 1 && V.imageChoice === 1) {
			// Color options
			links = document.createElement('div');
			links.className = "choices";
			links.append(`Color: `);
			links.appendChild(App.UI.Wardrobe.colorOptions(slave, "clothingBaseColor"));
			el.appendChild(links);
		}
	}

	return jQuery('#clothes').empty().append(el);
};

App.UI.Wardrobe.collar = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	}
	// <<= App.Desc.collar($activeSlave)>>
	let el = document.createElement('div');

	let label = document.createElement('div');
	label.append(`Collar: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	choice.textContent = (`${slave.collar} `);
	label.appendChild(choice);

	// Choose her own
	if (slave.collar !== `none`) {
		let choiceOptionsArray = [];
		choiceOptionsArray.push({text: `None`, updateSlave: {collar: `none`}});
		label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "collar", false));
	}

	el.appendChild(label);

	let niceOptionsArray = [];
	let harshOptionsArray = [];

	let clothingOption;
	// Nice collar
	App.Data.misc.niceCollars.forEach(item => {
		clothingOption = {
			text: item.name,
			updateSlave: {collar: item.value}
		};
		if (item.fs) {
			clothingOption.FS = item.fs;
		}
		niceOptionsArray.push(clothingOption);
	});
	// Harsh collar
	App.Data.misc.harshCollars.forEach(item => {
		clothingOption = {
			text: item.name,
			updateSlave: {collar: item.value}
		};
		if (item.fs) {
			clothingOption.FS = item.fs;
		}
		harshOptionsArray.push(clothingOption);
	});

	// Sort
	niceOptionsArray = niceOptionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);
	harshOptionsArray = harshOptionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);

	// Nice options
	let links = document.createElement('div');
	links.className = "choices";
	links.append(`Nice: `);
	links.appendChild(App.UI.SlaveInteract.generateRows(niceOptionsArray, slave, "collar", true));
	el.appendChild(links);

	// Harsh options
	links = document.createElement('div');
	links.className = "choices";
	links.append(`Harsh: `);
	links.appendChild(App.UI.SlaveInteract.generateRows(harshOptionsArray, slave, "collar", true));
	el.appendChild(links);

	return jQuery('#collar').empty().append(el);
};

App.UI.Wardrobe.mask = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	}
	let el = document.createElement('div');

	let label = document.createElement('div');
	label.append(`Mask: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	choice.textContent = (`${slave.faceAccessory} `);
	label.appendChild(choice);

	// Choose her own
	if (slave.faceAccessory !== `none`) {
		let choiceOptionsArray = [];
		choiceOptionsArray.push({text: `None`, updateSlave: {faceAccessory: `none`}});
		label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "faceAccessory", false));
	}

	el.appendChild(label);

	let array = [];

	let clothingOption;
	App.Data.misc.faceAccessory.forEach(item => {
		clothingOption = {
			text: item.name,
			updateSlave: {faceAccessory: item.value}
		};
		if (item.fs) {
			clothingOption.FS = item.fs;
		}
		array.push(clothingOption);
	});

	// Sort
	array = array.sort((a, b) => (a.text > b.text) ? 1 : -1);

	let links = document.createElement('div');
	links.className = "choices";
	links.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "faceAccessory", true));
	el.appendChild(links);

	if (slave.eyewear === "corrective glasses" || slave.eyewear === "glasses" || slave.eyewear === "blurring glasses" || slave.faceAccessory === "porcelain mask") {
		// Color options
		links = document.createElement('div');
		links.className = "choices";
		links.append(`Color: `);
		links.appendChild(App.UI.Wardrobe.colorOptions(slave, "glassesColor"));
		let note = document.createElement('span');
		note.className = "note";
		note.textContent = ` Only glasses and porcelain masks support a custom color. If both are worn, they will share the same color.`;
		links.appendChild(note);
		el.appendChild(links);
	}

	return jQuery('#faceAccessory').empty().append(el);
};

App.UI.Wardrobe.mouth = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	}
	let el = document.createElement('div');

	let label = document.createElement('div');
	label.append(`Gag: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	choice.textContent = (`${slave.mouthAccessory} `);
	label.appendChild(choice);

	// Choose her own
	if (slave.mouthAccessory !== `none`) {
		let choiceOptionsArray = [];
		choiceOptionsArray.push({text: `None`, updateSlave: {mouthAccessory: `none`}});
		label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "mouthAccessory", false));
	}

	el.appendChild(label);

	let array = [];

	let clothingOption;
	// mouthAccessory
	App.Data.misc.mouthAccessory.forEach(item => {
		clothingOption = {
			text: item.name,
			updateSlave: {mouthAccessory: item.value}
		};
		if (item.fs) {
			clothingOption.FS = item.fs;
		}
		array.push(clothingOption);
	});

	// Sort
	array = array.sort((a, b) => (a.text > b.text) ? 1 : -1);

	let links = document.createElement('div');
	links.className = "choices";
	links.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "mouthAccessory", true));
	el.appendChild(links);

	return jQuery('#mouthAccessory').empty().append(el);
};

App.UI.Wardrobe.armAccessory = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	}

	let el = document.createElement('div');
	// App.Desc.armwear(slave)

	let label = document.createElement('div');
	label.append(`Arm accessory: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	choice.textContent = (`${slave.armAccessory} `);
	label.appendChild(choice);

	let array = [];

	// Choose her own
	if (slave.armAccessory !== "none") {
		array.push({text: `None`, updateSlave: {armAccessory: `none`}});
		label.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "armAccessory", false));
	}

	el.appendChild(label);

	let links = document.createElement('div');
	links.className = "choices";
	array = [
		{text: "Hand gloves", updateSlave: {armAccessory: "hand gloves"}},
		{text: "Elbow gloves", updateSlave: {armAccessory: "elbow gloves"}}
	];
	links.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "armAccessory", false));
	el.appendChild(links);

	return jQuery('#armAccessory').empty().append(el);
};

App.UI.Wardrobe.shoes = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	}

	const
		{
			// eslint-disable-next-line no-unused-vars
			he, him, his, hers, himself, boy, He, His
		} = getPronouns(slave);

	let el = document.createElement('div');

	let label = document.createElement('div');
	label.append(`Shoes: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	choice.textContent = (`${slave.shoes} `);
	label.appendChild(choice);

	/* We have "barefoot" in App.Data.Misc to cover for this
	// Choose her own
	if (slave.shoes !== `none`) {
		let choiceOptionsArray = [];
		choiceOptionsArray.push({text: `None`, updateSlave: {shoes: `none`}});
		label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "shoes", false));
	}
	*/
	el.appendChild(label);

	let optionsArray = [];

	let clothingOption;
	App.Data.misc.shoes.forEach(item => {
		clothingOption = {
			text: item.name,
			updateSlave: {shoes: item.value}
		};
		if (item.fs) {
			clothingOption.FS = item.fs;
		}
		optionsArray.push(clothingOption);
	});

	// Sort
	// No sort here since we want light -> advanced. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);

	// Options
	let links = document.createElement('div');
	links.className = "choices";
	links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "shoes", true));
	el.appendChild(links);

	if (V.seeImages === 1 && V.imageChoice === 1 && slave.shoes !== "none") {
		// Color options
		links = document.createElement('div');
		links.className = "choices";
		links.append(`Color: `);
		links.appendChild(App.UI.Wardrobe.colorOptions(slave, "shoeColor"));
		el.appendChild(links);
	}

	return jQuery('#shoes').empty().append(el);
};

App.UI.Wardrobe.legAccessory = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	}

	const {
		// eslint-disable-next-line no-unused-vars
		he, him, his, hers, himself, boy, He, His
	} = getPronouns(slave);

	let el = document.createElement('div');

	let label = document.createElement('div');
	label.append(`Leg accessory: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	choice.textContent = (`${slave.legAccessory} `);
	label.appendChild(choice);

	let array = [];

	// Choose her own
	if (slave.legAccessory !== "none") {
		array.push({text: `None`, updateSlave: {legAccessory: `none`}});
		label.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "legAccessory", false));
	}

	el.appendChild(label);

	let links = document.createElement('div');
	links.className = "choices";
	array = [
		{text: "Short stockings", updateSlave: {legAccessory: "short stockings"}},
		{text: "Long stockings", updateSlave: {legAccessory: "long stockings"}}
	];
	links.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "legAccessory", false));
	el.appendChild(links);

	return jQuery('#legAccessory').empty().append(el);
};

App.UI.Wardrobe.bellyAccessory = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	}
	// <<waistDescription>><<= App.Desc.pregnancy($activeSlave)>><<clothingCorsetDescription>>

	const {
		// eslint-disable-next-line no-unused-vars
		he, him, his, hers, himself, boy, He, His
	} = getPronouns(slave);

	let choiceOptionsArray = [];
	choiceOptionsArray.push({text: `None`, updateSlave: {bellyAccessory: `none`}});

	let optionsArray = [];

	let clothingOption;
	App.Data.misc.bellyAccessories.forEach(item => {
		clothingOption = {
			text: item.name,
			updateSlave: {bellyAccessory: item.value}
		};
		if (item.fs) {
			clothingOption.FS = item.fs;
		}
		if (item.value !== "none") {
			// skip none in set, we set the link elsewhere.
			optionsArray.push(clothingOption);
		}
	});
	// Sort
	// No sort here since we want small -> large.optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);

	let el = document.createElement('div');

	let label = document.createElement('div');
	label.append(`Belly accessory: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	choice.textContent = (`${slave.bellyAccessory} `);
	label.appendChild(choice);

	// Choose her own
	if (slave.bellyAccessory !== `none`) {
		label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "bellyAccessory", false));
	}

	el.appendChild(label);

	// Options
	let links = document.createElement('div');
	links.className = "choices";
	links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "bellyAccessory", true));
	if (slave.pregKnown === 1) {
		let note = document.createElement('span');
		note.className = "note";
		note.textContent = ` Extreme corsets will endanger the life within ${him}.`;
		links.appendChild(note);
	}
	el.appendChild(links);

	return jQuery('#bellyAccessory').empty().append(el);
};

App.UI.Wardrobe.buttplug = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	}
	// App.Desc.buttplug(slave)

	const {
		// eslint-disable-next-line no-unused-vars
		he, him, his, hers, himself, boy, He, His
	} = getPronouns(slave);

	let el = document.createElement('div');

	let label = document.createElement('div');
	label.append(`Anal accessory: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	choice.textContent = (`${slave.buttplug} `);
	label.appendChild(choice);

	if (slave.buttplug !== `none`) {
		let choiceOptionsArray = [];
		choiceOptionsArray.push({text: `None`, updateSlave: {buttplug: `none`, buttplugAttachment: `none`}});
		label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "buttplug", false));
	}
	el.appendChild(label);

	let optionsArray = [];

	let clothingOption;
	App.Data.misc.buttplugs.forEach(item => {
		clothingOption = {
			text: item.name,
			updateSlave: {buttplug: item.value}
		};
		if (item.fs) {
			clothingOption.FS = item.fs;
		}

		if (item.value !== "none") {
			// skip none in set, we set the link elsewhere.
			optionsArray.push(clothingOption);
		}
	});

	// Sort
	// No sort here since we want small -> large. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);

	// Options
	let links = document.createElement('div');
	links.className = "choices";
	links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "buttplug", true));
	el.appendChild(links);

	return jQuery('#buttplug').empty().append(el);
};

App.UI.Wardrobe.buttplugAttachment = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	} else if (slave.buttplug === "none") {
		return jQuery('#buttplugAttachment').empty();
	}

	const {
		// eslint-disable-next-line no-unused-vars
		he, him, his, hers, himself, boy, He, His
	} = getPronouns(slave);

	let el = document.createElement('div');

	let label = document.createElement('div');
	label.append(`Anal accessory attachment: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	choice.textContent = (`${slave.buttplugAttachment} `);
	label.appendChild(choice);

	if (slave.buttplugAttachment !== `none`) {
		let choiceOptionsArray = [];
		choiceOptionsArray.push({text: `None`, updateSlave: {buttplugAttachment: `none`}});
		label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "buttplugAttachment", false));
	}
	el.appendChild(label);

	let optionsArray = [];

	let clothingOption;
	App.Data.misc.buttplugAttachments.forEach(item => {
		clothingOption = {
			text: item.name,
			updateSlave: {buttplugAttachment: item.value}
		};
		if (item.fs) {
			clothingOption.FS = item.fs;
		}

		if (item.value !== "none") {
			// skip none in set, we set the link elsewhere.
			optionsArray.push(clothingOption);
		}
	});

	// Sort
	optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);

	// Options
	let links = document.createElement('div');
	links.className = "choices";
	links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "buttplugAttachment", true));
	el.appendChild(links);

	return jQuery('#buttplugAttachment').empty().append(el);
};

App.UI.Wardrobe.vaginalAccessory = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	}

	// <<vaginalAccessoryDescription>>
	const {
		// eslint-disable-next-line no-unused-vars
		he, him, his, hers, himself, boy, He, His
	} = getPronouns(slave);

	let el = document.createElement('div');

	let label = document.createElement('div');
	label.append(`Vaginal accessory: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	choice.textContent = (`${slave.vaginalAccessory} `);
	label.appendChild(choice);

	if (slave.vaginalAccessory !== `none`) {
		let choiceOptionsArray = [];
		choiceOptionsArray.push({text: `None`, updateSlave: {vaginalAccessory: `none`}});
		label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "vaginalAccessory", false));
	}
	el.appendChild(label);

	let optionsArray = [];

	let clothingOption;
	App.Data.misc.vaginalAccessories.forEach(item => {
		clothingOption = {
			text: item.name,
			updateSlave: {vaginalAccessory: item.value}
		};
		if (item.fs) {
			clothingOption.FS = item.fs;
		}

		if (item.value !== "none") {
			// skip none in set, we set the link elsewhere.
			optionsArray.push(clothingOption);
		}
	});

	// Sort
	// No sort here since we want small -> large. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);

	// Options
	let links = document.createElement('div');
	links.className = "choices";
	links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "vaginalAccessory", true));
	el.appendChild(links);

	return jQuery('#vaginalAccessory').empty().append(el);
};

App.UI.Wardrobe.vaginalAttachment = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	} else if (slave.vaginalAccessory === "none") {
		return jQuery('#vaginalAttachment').empty();
	}
	// App.Desc.vaginalAttachment(slave);

	const {
		// eslint-disable-next-line no-unused-vars
		he, him, his, hers, himself, boy, He, His
	} = getPronouns(slave);

	let el = document.createElement('div');

	let label = document.createElement('div');
	label.append(`Vaginal accessory attachment: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	choice.textContent = (`${slave.vaginalAttachment} `);
	label.appendChild(choice);

	if (slave.vaginalAttachment !== `none`) {
		let choiceOptionsArray = [];
		choiceOptionsArray.push({text: `None`, updateSlave: {vaginalAttachment: `none`}});
		label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "vaginalAttachment", false));
	}
	el.appendChild(label);

	let optionsArray = [];

	let clothingOption;
	App.Data.misc.vaginalAttachments.forEach(item => {
		clothingOption = {
			text: item.name,
			updateSlave: {vaginalAttachment: item.value}
		};
		if (item.fs) {
			clothingOption.FS = item.fs;
		}

		if (item.value !== "none") {
			// skip none in set, we set the link elsewhere.
			optionsArray.push(clothingOption);
		}
	});

	// Sort
	optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);

	// Options
	let links = document.createElement('div');
	links.className = "choices";
	links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "vaginalAttachment", true));
	el.appendChild(links);

	return jQuery('#vaginalAttachment').empty().append(el);
};

App.UI.Wardrobe.dickAccessory = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	}
	// <<= App.Desc.dickAccessory($activeSlave)>>

	const {
		// eslint-disable-next-line no-unused-vars
		he, him, his, hers, himself, boy, He, His
	} = getPronouns(slave);

	let el = document.createElement('div');

	let label = document.createElement('div');
	label.append(`Dick accessory: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	choice.textContent = (`${slave.dickAccessory} `);
	label.appendChild(choice);

	if (slave.dickAccessory !== `none`) {
		let choiceOptionsArray = [];
		choiceOptionsArray.push({text: `None`, updateSlave: {dickAccessory: `none`}});
		label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "dickAccessory", false));
	}
	el.appendChild(label);

	let optionsArray = [];

	let clothingOption;
	App.Data.misc.dickAccessories.forEach(item => {
		clothingOption = {
			text: item.name,
			updateSlave: {dickAccessory: item.value}
		};
		if (item.fs) {
			clothingOption.FS = item.fs;
		}

		if (item.value !== "none") {
			// skip none in set, we set the link elsewhere.
			optionsArray.push(clothingOption);
		}
	});

	// Sort
	// No sort here since we want small -> large. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);

	// Options
	let links = document.createElement('div');
	links.className = "choices";
	links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "dickAccessory", true));
	el.appendChild(links);

	return jQuery('#dickAccessory').empty().append(el);
};

App.UI.Wardrobe.chastity = function(slave) {
	if (slave.fuckdoll !== 0) {
		return;
	}

	const {
		// eslint-disable-next-line no-unused-vars
		he, him, his, hers, himself, boy, He, His
	} = getPronouns(slave);

	let el = document.createElement('div');

	let label = document.createElement('div');
	label.append(`Chastity devices: `);

	let choice = document.createElement('span');
	choice.style.fontWeight = "bold";
	if (slave.choosesOwnChastity === 1) {
		choice.textContent = `choosing ${his} own chastity `;
	} else if (slave.chastityAnus === 1 && slave.chastityPenis === 1 && slave.chastityVagina === 1) {
		choice.textContent = `full chastity `;
	} else if (slave.chastityPenis === 1 && slave.chastityVagina === 1) {
		choice.textContent = `genital chastity `;
	} else if (slave.chastityAnus === 1 && slave.chastityPenis === 1) {
		choice.textContent = `combined chastity cage `;
	} else if (slave.chastityAnus === 1 && slave.chastityVagina === 1) {
		choice.textContent = `combined chastity belt `;
	} else if (slave.chastityVagina === 1) {
		choice.textContent = `chastity belt `;
	} else if (slave.chastityPenis === 1) {
		choice.textContent = `chastity cage `;
	} else if (slave.chastityAnus === 1) {
		choice.textContent = `anal chastity `;
	} else if (slave.chastityAnus === 0 && slave.chastityPenis === 0 && slave.chastityVagina === 0) {
		choice.textContent = `none `;
	} else {
		choice.textContent = `THERE HAS BEEN AN ERROR `;
	}
	label.appendChild(choice);

	if (slave.chastityAnus !== 0 || slave.chastityPenis !== 0 || slave.chastityVagina !== 0) {
		let choiceOptionsArray = [];
		choiceOptionsArray.push({
			text: `None`,
			updateSlave: {
				choosesOwnChastity: 0,
				chastityAnus: 0,
				chastityPenis: 0,
				chastityVagina: 0
			}
		});
		label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "chastity", false));
	}
	el.appendChild(label);

	let optionsArray = [];

	let clothingOption;
	App.Data.misc.chastityDevices.forEach(item => {
		clothingOption = {
			text: item.name,
			updateSlave: {}
		};
		Object.assign(clothingOption.updateSlave, item.updateSlave);
		if (item.fs) {
			clothingOption.FS = item.fs;
		}
		if (item.value !== "none") {
			// skip none in set, we set the link elsewhere.
			optionsArray.push(clothingOption);
		}
	});

	// Sort
	// skip sort for this one too. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);

	// Options
	let links = document.createElement('div');
	links.className = "choices";
	links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "chastity", true));
	el.appendChild(links);

	return jQuery('#chastity').empty().append(el);
};

App.UI.Wardrobe.shopping = function(slave) {
	return jQuery('#shopping').empty().append(
		App.UI.DOM.link(
			` Go shopping for more options`,
			() => {},
			[],
			"Wardrobe"
		)
	);
};

/**
 * @param {App.Entity.SlaveState} slave
 * @param {string} update
 * @returns {Node}
 */
App.UI.Wardrobe.colorOptions = function(slave, update) {
	let el = new DocumentFragment();
	let colorChoice = App.UI.DOM.colorInput(
		slave[update],
		v => {
			slave[update] = v;
			App.UI.Wardrobe.refreshAll(slave);
		}
	);
	el.appendChild(colorChoice);

	if (slave[update]) {
		el.appendChild(
			App.UI.DOM.link(
				` Reset`,
				() => {
					delete slave[update];
					App.UI.Wardrobe.refreshAll(slave);
				},
			)
		);
	}
	return el;
};

App.UI.Wardrobe.refreshAll = function(slave) {
	App.UI.Wardrobe.clothes(slave);
	App.UI.Wardrobe.collar(slave);
	App.UI.Wardrobe.mask(slave);
	App.UI.Wardrobe.mouth(slave);
	App.UI.Wardrobe.armAccessory(slave);
	App.UI.Wardrobe.shoes(slave);
	App.UI.Wardrobe.legAccessory(slave);
	App.UI.Wardrobe.bellyAccessory(slave);
	App.UI.Wardrobe.buttplug(slave);
	App.UI.Wardrobe.buttplugAttachment(slave);
	App.UI.Wardrobe.vaginalAccessory(slave);
	App.UI.Wardrobe.vaginalAttachment(slave);
	App.UI.Wardrobe.dickAccessory(slave);
	App.UI.Wardrobe.chastity(slave);
	App.Art.refreshSlaveArt(slave, 3, "artFrame");
	return;
};

repo_name: KnightBoulegard/fc

license: mit


code:
/**
 * Contains the parameters for the player's custom slave order.
 * Some members are ignored by huskSlave (particularly mental properties).
 * NOTE: $customSlave/$huskSlave IS NOT A SLAVE. Do not treat them like you would treat an instance of SlaveState.
 */
App.Entity.CustomSlaveOrder = class CustomSlaveOrder {
	constructor() {
		/** desired age, approximately
		 * Only certain values are valid; check seCustomSlaveDelivery.tw.
		 * @type {number}
		 */
		this.age = 19;

		/** desired health
		 * 0 = healthy, 1 = extremely healthy
		 * @type {number}
		 */
		this.health = 1;

		/** desired musculature
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.muscles = 0;

		/** desired lips
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.lips = 15;

		/** desired voice
		 * -1 = unimportant; other values as in SlaveState.
		 * @type {number}
		 */
		this.voice = -1;

		/** desired height category
		 * "greatly below average", "below average", "normal", "above average", or "greatly above average"
		 * @type {string}
		 */
		this.heightMod = "normal";

		/** desired weight
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.weight = 0;

		/** desired facial attractiveness
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.face = 0;

		/** desired race
		 * "ethnicity is unimportant" or other values as in SlaveState
		 * @type {string}
		 */
		this.race = "white";

		/** desired skin color
		 * "left natural" or other values as in SlaveState
		 * @type {string}
		 */
		this.skin = "left natural";

		/** desired boob size
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.boobs = 500;

		/** desired butt size
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.butt = 3;

		/** desired genetic sex and genitalia
		 * 1 = female (XX), 2 = male (XY), 3 = futanari (XX)
		 * @type {number}
		 */
		this.sex = 1;

		/** virginity required
		 * 0 = yes, 1 = no (and yes, you are reading that correctly)
		 * @type {number}
		 */
		this.virgin = 0;

		/** desired dick and foreskin size, male and futa only
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.dick = 2;

		/** desired balls and scrotum size, male and futa only
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.balls = 2;

		/** desired clit size, female and futa only
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.clit = 0;

		/** desired labia size, female and futa only
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.labia = 0;

		/** desired vaginal lubrication, female and futa only
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.vaginaLube = 1;

		/** anal virginity required
		 * 0 = yes, 1 = no (and yes, you are reading that correctly)
		 * @type {number}
		 */
		this.analVirgin = 0;

		/** desired sex skill rating (anal, oral, and vaginal)
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.skills = 15;

		/** desired skills rating (.whore controls both whoring and entertainment, .combat controls combat)
		 * Values as in SlaveState.
		 * @type {Object.<string, number>}
		 */
		this.skill = {whore: 15, combat: 0};

		/** desired intelligence level
		 * Range -3 to +3 (NOT the same range as SlaveState!)
		 * @type {number}
		 */
		this.intelligence = 0;

		/** desired education
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.intelligenceImplant = 0;

		/** desired nationality
		 * "Nationality is unimportant" or other values as in SlaveState.
		 * @type {string}
		 */
		this.nationality = "Stateless";

		/** desired left and right leg state
		 * @type {{left: App.Entity.LimbState, right: App.Entity.LimbState}}
		 */
		this.leg = {left: new App.Entity.LimbState(), right: new App.Entity.LimbState()};

		/** desired left and right arm state
		 * @type {{left: App.Entity.LimbState, right: App.Entity.LimbState}}
		 */
		this.arm = {left: new App.Entity.LimbState(), right: new App.Entity.LimbState()};

		/** desired eye state
		 * Only the "vision" property is used, all others are ignored
		 * @type {App.Entity.EyeState}
		 */
		this.eye = new App.Entity.EyeState();

		/** hearing
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.hears = 0;

		/** sense of smell
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.smells = 0;

		/** sense of taste
		 * Values as in SlaveState.
		 * @type {number}
		 */
		this.tastes = 0;
	}
};

/**
 * Checks to see if the custom slave has accidentally been turned into an actual slave object.
 * IF THIS FUNCTION RETURNS TRUE, YOU HAVE PROBABLY FUCKED UP A BACKCOMPAT. CHANGE YOUR BACKCOMPAT, NOT THIS FUNCTION!
 * @param {App.Entity.CustomSlaveOrder} slaveOrder
 * @returns {boolean}
 */
App.Utils.IsCustomSlaveMutated = function(slaveOrder) {
	/* ensure the absence of a few properties that slave orders definitely should not have, but every real slave has */
	if (slaveOrder.hasOwnProperty("rules") || slaveOrder.hasOwnProperty("pronoun")) {
		return true;
	/* ensure the presence of a few properties that slave orders definitely should have, but no real slave should */
	} else if (!slaveOrder.hasOwnProperty("age") || !slaveOrder.hasOwnProperty("sex")) {
		return true;
	}
	return false;
};