code:
:: Widgets Canvas Low-Level API [widget]
<!--

Low-level canvas renderer composition functions.

Example usage:

<<set _wetness to 0.9>>
<<canvasstart 256 256>>
<<run canvaslayer(10, 'img/shirt.png', {blend:'#ff0000',alpha:_wetness})>>
<<run canvaslayer(11, 'img/shirt_acc.png', {alpha:_wetness})>>
<<run canvaslayer( 8, 'img/skirt.png', {blend:'#ff0000',alpha:_wetness})>>
<<canvasdraw>>

will create a 256x256 canvas
and render 3 images in it: skirt, shirt, and shirt_acc (order by z-index)
shirt and skirt are multiplied by red (#ff0000) colour (blend option)
the images are semi-transparent (alpha=_wetness=0.9, alpha option)
actual <canvas> element will be placed where <<canvasdraw>> is called

-->

<<widget "canvasstart">>
<!--
Creates an off-screen <canvas> element.
Usage: <<canvasstart WIDTH HEIGHT FRAMES>>
-->
<<if _Canvas !== undefined>>
<<run throw "Duplicate 'canvasstart' call">>
<<elseif $args.length !== 3 or typeof $args[0] !== 'number' or typeof $args[1] !== 'number' or typeof $args[2] !== 'number'>>
<<run throw "Invalid 'canvasstart' call">>
<<else>>
<<set _Canvas = Renderer.createCanvas($args[0]*$args[2], $args[1])>>
<<set _CanvasLayers = []>>
<<set _CanvasFrames = $args[2];>>
<</if>>
<</widget>>

<<widget "canvaslayer">>
<!--
Prepares a layer to be rendered
Usage: <<canvaslayer Z SOURCE [OPTIONS...]*>>
where:
	Z: z-index of the layer (bigger above lower).
	SOURCE: is URL to the image
	OPTIONS: Extra CompositeLayerSpec option objects - they are merged, last has most priority
Example:
	<<canvaslayer 20 'img/clothers/upper/schoolshirt/full.png' `{blend:'#00ff00', blendMode:'hard-light'}`>>
-->
<<twinescript>>
var opts = {z:$args[0],src:$args[1]};
for (var i = 2; i < $args.length; i ++) opts = jQuery.extend(opts, $args[i]);
_CanvasLayers.push(opts);
<</twinescript>>
<</widget>>

<<widget "canvasanimate">>
<!--
Insert HTML <canvas> element right here.
Render and animate previously prepared images into it.
Usage: <<canvasanimate [CSS_CLASSES]>>
-->
<<twinescript>>
if (!_Canvas) {
	Errors.report("'canvasdraw' without 'canvasstart'");
} else {
	Renderer.animateLayers(_Canvas, _CanvasLayers, Renderer.Animations, Renderer.defaultListener);
	if (typeof $args[0] === 'string') {
		_Canvas.canvas.className = $args[0];
	}
	output.appendChild(_Canvas.canvas);
}
<</twinescript>>
<<unset _Canvas,_CanvasLayers,_CanvasFrames>>
<</widget>>

<<widget "canvasdraw">>
<!--
Insert HTML <canvas> element right here.
Render previously prepared images into it.
Usage: <<canvasdraw [FRAMECOUNT] [CSS_CLASSES]>>
-->
<<twinescript>>
if (!_Canvas) {
	Errors.report("'canvasdraw' without 'canvasstart'");
} else {
	Renderer.composeLayers(_Canvas, _CanvasLayers, $args[0] || 1, Renderer.defaultListener);
	if (typeof $args[1] === 'string') {
		_Canvas.canvas.className = $args[1];
	}
	output.appendChild(_Canvas.canvas);
}
<</twinescript>>
<<unset _Canvas,_CanvasLayers,_CanvasFrames>>
<</widget>>


code:
:: Widgets Canvas Model Main [widget]

<!--
<<canvasimg [CSSCLASSES]>>
Render full player image.
-->
<<widget "canvasimg">>
	<<selectmodel "main" "sidebar">>
	<<modelprepare-player-body>>
	<<modelprepare-player-clothes>>
	<<if $sidebarAnimations isnot false>>
		<<animatemodel $args[0]>>
	<<else>>
		<<rendermodel $args[0]>>
	<</if>>
<</widget>>

<!--
Set model options & filters from player body
Requires prior <<selectmodel "main">>
-->
<<widget "modelprepare-player-body">>

/*Prep for image checks*/
<<set _disabled to ["disabled","hidden"]>>

<!-- unwrap tanLoc/tanValues array -->
<<twinescript>>
let tanValByName = {
	body: 0,
	breasts: -0.01,
	penis: -0.01,
	swimshorts: -0.01,
	swimsuitTop: -0.01,
	swimsuitBottom: -0.01,
	bikiniTop: -0.01,
	bikiniBottom: -0.01,
	tshirt: -0.01 /* No sprites yet? */
};
for (let i = 0; i < $skinColor.tanLoc.length; i++) {
	tanValByName[$skinColor.tanLoc[i]] = $skinColor.tanValues[i]/100;
}

_modeloptions.skin_type = $skinColor.natural || "light";
_modeloptions.skin_tone = tanValByName["body"];
if ($skinColor.tanningEnabled is true){
	for (let loc in tanValByName) {
		if (loc !== 'body') {
			_modeloptions['skin_tone_'+loc] = tanValByName[loc];
		}
	}
} else {
	_modeloptions.show_tanlines = false;
}
<</twinescript>>

<<if $makeup.eyeshadow != 0>>
	<<set _modeloptions.eyeshadow_colour to $makeup.eyeshadow>>
<</if>>
<<if $makeup.mascara != 0>>
	<<set _modeloptions.mascara_colour to $makeup.mascara>>
<</if>>
<<if $makeup.lipstick != 0>>
	<<set _modeloptions.lipstick_colour to $makeup.lipstick>>
<</if>>

<<if $possessed>>
	<<set _modeloptions.eyes_colour = ($wraith and $wraith.state is "haunt" and !$schism ? "red possessed" : "blue possessed")>>
<<else>>
	<<set _modeloptions.eyes_colour = ($makeup.eyelenses != 0 ? $makeup.eyelenses : $eyecolour)>>
<</if>>
<<set _modeloptions.hair_colour = $haircolour>>
<<set _modeloptions.brows_colour = ($makeup.browscolour != 0 ? $makeup.browscolour : $naturalhaircolour)>>
<<set _modeloptions.pbhair_colour = ($makeup.pbcolour != 0 ? $makeup.pbcolour : $naturalhaircolour)>>

<!--
	 ██████   █████  ███████ ███████
	 ██   ██ ██   ██ ██      ██
	 ██████  ███████ ███████ █████
	 ██   ██ ██   ██      ██ ██
	 ██████  ██   ██ ███████ ███████
-->

<<switch $player.perceived_breastsize>>
	<<case 12>>
		<<set _modeloptions.breast_size to 6>>
	<<case 8 9 10 11>>
		<<set _modeloptions.breast_size to 5>>
	<<case 6 7>>
		<<set _modeloptions.breast_size to 4>>
	<<case 4 5>>
		<<set _modeloptions.breast_size to 3>>
	<<case 3>>
		<<set _modeloptions.breast_size to 2>>
	<<case 0 1 2>>
		<<set _modeloptions.breast_size to 1>>
<</switch>>
<<set _modeloptions.breasts to "default">>
<<if $sexStats>>
	<<set _modeloptions.belly to $sexStats.vagina.pregnancy.bellySize>>
<</if>>

<<if $wraithSkin>>
    <<set _modeloptions.mannequin to true>>
    <<set _modeloptions.skin_type to 'custom'>>
    <<set _modeloptions.filters.body to {blend:'#ffffff',blendMode:'multiply',desaturate:true}>>
    <<set _modeloptions.filters.breasts to _modeloptions.filters.body>>
    <<set _modeloptions.filters.penis to _modeloptions.filters.body>>
    <<set _modeloptions.show_tanlines to false>>
<</if>>

<!--
 -    ██   ██  █████  ██ ██████
 -    ██   ██ ██   ██ ██ ██   ██
 -    ███████ ███████ ██ ██████
 -    ██   ██ ██   ██ ██ ██   ██
 -    ██   ██ ██   ██ ██ ██   ██
 -
 -
-->

<<set _modeloptions.hair_sides_length to $hairlengthstage>>
<<set _modeloptions.hair_sides_type to $hairtype>>
<<set _modeloptions.hair_sides_position to $hairposition>>
<<set _modeloptions.hair_fringe_length to $fringelengthstage>>
<<set _modeloptions.hair_fringe_type to $fringetype>>

<!--
 -     █████  ██████  ███    ███ ███████
 -    ██   ██ ██   ██ ████  ████ ██
 -    ███████ ██████  ██ ████ ██ ███████
 -    ██   ██ ██   ██ ██  ██  ██      ██
 -    ██   ██ ██   ██ ██      ██ ███████
 -
 -->

<<if $leftarm isnot "bound" and $leftarm isnot "grappled">>
	<<if $dontHide is false and $worn.over_upper.exposed gte 1 and ($worn.upper.exposed gte 1 or $upperwetstage gte 3)
	and ($exposed gte 2 and $uncomfortable.nude is true or $exposed is 1 and $uncomfortable.underwear is true)>>
		<<set _coverBreasts to true>>
		<<set _modeloptions.arm_left to "cover">> <!-- might be changed back to "idle" if covering with wings -->
	<<else>>
		<<set _coverBreasts to false>>
		<<set _modeloptions.arm_left to "idle">>
	<</if>>
<<else>>
	<<set _modeloptions.arm_left to "none">>
<</if>>

<<if $rightarm isnot "bound" and $rightarm isnot "grappled">>
	<<if $dontHide is false and $worn.over_lower.exposed gte 1 and ($worn.lower.exposed gte 1 or $lowerwetstage gte 3)
	and ($exposed gte 2 and $uncomfortable.nude is true or $exposed is 1 and $uncomfortable.underwear is true)>>
		<<set _coverCrotch to true>>
		<<set _modeloptions.arm_right to "cover">> <!-- might be changed back to "idle" if covering with wings/tail -->
	<<else>>
		<<set _coverCrotch to false>>
		<<set _modeloptions.arm_right to "idle">>
	<</if>>
<<else>>
	<<set _modeloptions.arm_right to "none">>
<</if>>

<<if $leftarm isnot "bound" and $leftarm isnot "grappled">>

	<<if _coverBreasts is false>>
		<<if $exposed gte 2 and $dontHide is false and $uncomfortable.flaunting is false>>
			<<set _modeloptions.demon_wings_state to "flaunt">>
		<<else>>
			<<set _modeloptions.demon_wings_state to "idle">>
		<</if>>
		<<set _modeloptions.angel_wing_right to "idle">>
		<<set _modeloptions.fallen_wing_right to "idle">>
		<<set _modeloptions.bird_wing_right to "idle">>
	<<elseif _coverBreasts is true>>
		<<if !_disabled.includes($transformationParts.demon.wings)>>
			<<set _modeloptions.demon_wings_state to "cover">>
			<<set _modeloptions.arm_left to "idle">>
		<<elseif !_disabled.includes($transformationParts.angel.wings)>>
			<<set _modeloptions.angel_wing_right to "cover">>
			<<set _modeloptions.arm_left to "idle">>
		<<elseif !_disabled.includes($transformationParts.fallenAngel.wings)>>
			<<set _modeloptions.fallen_wing_right to "cover">>
			<<set _modeloptions.arm_left to "idle">>
		<<elseif !_disabled.includes($transformationParts.bird.wings)>>
			<<set _modeloptions.bird_wing_right to "cover">>
			<<set _modeloptions.arm_left to "idle">>
		<</if>>
	<</if>>
<</if>>

<<if $rightarm isnot "bound" and $rightarm isnot "grappled">>
	<<if _coverCrotch is false>>
		<<if !_disabled.includes($transformationParts.demon.tail)>>
			<<if $exposed gte 2 and $dontHide is false and $uncomfortable.flaunting is false>>
				<<set _modeloptions.demon_tail_state to "flaunt">>
			<<else>>
				<<set _modeloptions.demon_tail_state to "idle">>
			<</if>>
		<</if>>
		<<set _modeloptions.angel_wing_left to "idle">>
		<<set _modeloptions.fallen_wing_left to "idle">>
		<<set _modeloptions.bird_wing_left to "idle">>
	<<elseif _coverCrotch is true>>
		<<if !_disabled.includes($transformationParts.demon.wings)>>
			<<set _modeloptions.demon_tail_state to "cover">>
			<<set _modeloptions.arm_right to "idle">>
		<<elseif !_disabled.includes($transformationParts.angel.wings)>>
			<<set _modeloptions.angel_wing_left to "cover">>
			<<set _modeloptions.arm_right to "idle">>
		<<elseif !_disabled.includes($transformationParts.fallenAngel.wings)>>
			<<set _modeloptions.fallen_wing_left to "cover">>
			<<set _modeloptions.arm_right to "idle">>
		<<elseif !_disabled.includes($transformationParts.bird.wings)>>
			<<set _modeloptions.bird_wing_left to "cover">>
			<<set _modeloptions.arm_right to "idle">>
		<</if>>
	<</if>>
<</if>>

<!--
 -    ██     ██ ██████  ██ ████████ ██ ███    ██  ██████  ███████
 -    ██     ██ ██   ██ ██    ██    ██ ████   ██ ██       ██
 -    ██  █  ██ ██████  ██    ██    ██ ██ ██  ██ ██   ███ ███████
 -    ██ ███ ██ ██   ██ ██    ██    ██ ██  ██ ██ ██    ██      ██
 -     ███ ███  ██   ██ ██    ██    ██ ██   ████  ██████  ███████
-->

<<if $bodywritingImages is true>>
	<<for _label, _value range $skin>>
		<<if _value.writing>>
			<<set _modeloptions["writing_"+_label] to setup.bodywriting_namebyindex[_value.index]>>
		<</if>>
	<</for>>
<</if>>

<!--
 -    ███████  █████   ██████ ███████
 -    ██      ██   ██ ██      ██
 -    █████   ███████ ██      █████
 -    ██      ██   ██ ██      ██
 -    ██      ██   ██  ██████ ███████
 -->

<<set _modeloptions.facestyle to $facestyle>>

<<set _modeloptions.freckles = $player.freckles == true and $makeup.concealer != 1>>

<!-- Eyes -->
<<if $possessed>>
	<<set _modeloptions.trauma to $possessed>>
<<else>>
	<<set _modeloptions.trauma to $trauma gte ($traumamax * 0.9)>>
<</if>>
<<set _modeloptions.blink to $blinkingdisable is "f">>
<<set _modeloptions.eyes_bloodshot to $pain gte 100 and $willpowerpain is 0>>
<<set _modeloptions.eyes_half to $halfcloseddisable isnot "t" and ($arousal gte ($arousalmax / 5) * 4 or $orgasmdown gte 1) and $trauma lt ($traumamax * 0.9) and $pain lt 60 and $eyelidTEST is true or $possessed>>

<!-- Brows -->
<<if $trauma gte $traumamax or $possessed>>
	<<set _modeloptions.brows = "top">>
<<elseif $pain gte 60>>
	<<set _modeloptions.brows = "low">>
<<elseif $arousal gte ($arousalmax / 5) * 4 or $orgasmdown gte 1>>
	<<set _modeloptions.brows = "orgasm">>
<<elseif $pain gte 20>>
	<<set _modeloptions.brows = "mid">>
<<else>>
	<<set _modeloptions.brows = "top">>
<</if>>

<!-- Mouth -->
<<if $trauma gte $traumamax>>
	<<set _modeloptions.mouth = "neutral">>
<<elseif $pain gte 60 or $orgasmdown gte 1 or ($possessed and !$schism)>>
	<<set _modeloptions.mouth = "cry">>
<<elseif $exposed is 2 and $uncomfortable.nude is true and $dontHide is false or $pain gte 20>>
	<<set _modeloptions.mouth = "frown">>
<<elseif $pain gte 1 or ($exposed is 1 and $uncomfortable.underwear is true) or ($combat is 1 and $consensual isnot 1)>>
	<<set _modeloptions.mouth = "neutral">>
<<else>>
	<<set _modeloptions.mouth = "smile">>
<</if>>

<!-- Blush -->
<<set _modeloptions.blush = Math.min(5, Math.floor($arousal / 2000) + 1)>>
<<if _modeloptions.blush lt 2 and $exposed gte 2>>
	<<set _modeloptions.blush = 2>>
<<elseif $arousal lt 100 and $exposed lt 1>>
	<<set _modeloptions.blush = 0>>
<</if>>
<<if !$worn.over_upper.type.includes("naked") and !$worn.over_lower.type.includes("naked") and
$worn.upper.type.includes("naked") and $worn.lower.type.includes("naked") and
$worn.under_upper.type.includes("naked") and $worn.under_lower.type.includes("naked")>>
	<<set _modeloptions.blush = 2>>
<</if>>

<!-- Tears -->
<<set _modeloptions.tears = Math.floor(Math.clamp($pain, 0, 99) / 20)>>

<!--
 -    ████████ ███████ ███████
 -       ██    ██      ██
 -       ██    █████   ███████
 -       ██    ██           ██
 -       ██    ██      ███████
 -->

<!-- wing and tail idle/cover/flaunt state is configured in the arms section above -->

<<set _modeloptions.angel_wings_type to $transformationParts.angel.wings>>
<<set _modeloptions.angel_halo_type to $transformationParts.angel.halo>>

<<set _modeloptions.fallen_wings_type to $transformationParts.fallenAngel.wings>>
<<set _modeloptions.fallen_halo_type to $transformationParts.fallenAngel.halo>>

<<set _modeloptions.demon_wings_type to $transformationParts.demon.wings>>
<<set _modeloptions.demon_tail_type to $transformationParts.demon.tail>>
<<set _modeloptions.demon_horns_type to $transformationParts.demon.horns>>

<<set _modeloptions.wolf_tail_type to $transformationParts.wolf.tail>>
<<set _modeloptions.wolf_ears_type to $transformationParts.wolf.ears>>
<<set _modeloptions.wolf_pits_type to $transformationParts.wolf.pits>>
<<set _modeloptions.wolf_pubes_type to $transformationParts.wolf.pubes>>
<<set _modeloptions.wolf_cheeks_type to $transformationParts.wolf.cheeks>>

<<set _modeloptions.cat_tail_type to $transformationParts.cat.tail>>
<<set _modeloptions.cat_ears_type to $transformationParts.cat.ears>>

<<set _modeloptions.cow_horns_type to $transformationParts.cow.horns>>
<<set _modeloptions.cow_tail_type to $transformationParts.cow.tail>>
<<set _modeloptions.cow_ears_type to $transformationParts.cow.ears>>

<<set _modeloptions.bird_wings_type to $transformationParts.bird.wings>>
<<set _modeloptions.bird_tail_type to $transformationParts.bird.tail>>
<<set _modeloptions.bird_eyes_type to $transformationParts.bird.eyes>>
<<set _modeloptions.bird_malar_type to $transformationParts.bird.malar>>
<<set _modeloptions.bird_plumage_type to $transformationParts.bird.plumage>>
<<set _modeloptions.bird_pubes_type to $transformationParts.bird.pubes>>

<<set _modeloptions.bunny_ears_type to $transformationParts.bunny.ears>>

<!--
 -     ██████ ██████   ██████  ████████  ██████ ██   ██
 -    ██      ██   ██ ██    ██    ██    ██      ██   ██
 -    ██      ██████  ██    ██    ██    ██      ███████
 -    ██      ██   ██ ██    ██    ██    ██      ██   ██
 -     ██████ ██   ██  ██████     ██     ██████ ██   ██
-->

<<set _modeloptions.crotch_visible to true>>
<<if $pbdisable is "f">>
	<<set _modeloptions.pbhair_level = $pblevel>>
	<<set _modeloptions.pbhair_strip = $pbstrip>>
	<<set _modeloptions.pbhair_balls = $pblevelballs>>
<</if>>
<<if $player.penisExist>>
	<<set _modeloptions.penis_size to Math.clamp($penissize, -2, 4)>>
	<<set _modeloptions.penis to ($player.virginity.penile === true ? "virgin" : "default") >>
	<<set _modeloptions.balls to $player.ballsExist>>
	<<set _modeloptions.penis_parasite to $parasite.penis.name>>
<</if>>
<<if $player.vaginaExist>>
	<<set _modeloptions.clit_parasite to $parasite.clit.name>>
<</if>>

<<switch setup.bodyliquid.combined("vagina")>>
	<<case 5 6 7 8 9 10>><<set _modeloptions.drip_vaginal = "VeryFast">>
	<<case 4>><<set _modeloptions.drip_vaginal = "Fast">>
	<<case 3>><<set _modeloptions.drip_vaginal = "Slow">>
	<<case 2>><<set _modeloptions.drip_vaginal = "VerySlow">>
	<<case 1>><<set _modeloptions.drip_vaginal = "Start">>
<</switch>>

<<switch setup.bodyliquid.combined("anus")>>
	<<case 5 6 7 8 9 10>><<set _modeloptions.drip_anal = "VeryFast">>
	<<case 4>><<set _modeloptions.drip_anal = "Fast">>
	<<case 3>><<set _modeloptions.drip_anal = "Slow">>
	<<case 2>><<set _modeloptions.drip_anal = "VerySlow">>
	<<case 1>><<set _modeloptions.drip_anal = "Start">>
<</switch>>

<<switch setup.bodyliquid.combined("mouth")>>
	<<case 5 6 7 8 9 10>><<set _modeloptions.drip_mouth = "VeryFast">>
	<<case 4>><<set _modeloptions.drip_mouth = "Fast">>
	<<case 3>><<set _modeloptions.drip_mouth = "Slow">>
	<<case 2>><<set _modeloptions.drip_mouth = "VerySlow">>
	<<case 1>><<set _modeloptions.drip_mouth = "Start">>
<</switch>>

<<if $worn.upper.exposed gte 2 and $worn.under_upper.exposed gte 1>>
	<<set _chestVisible to true>>
<<elseif ($upperwetstage gt 0 or $worn.upper.type.includes("naked")) and ($underupperwetstage gt 0 or $worn.under_upper.type.includes("naked"))>>
	<<set _chestVisible to true>>
<</if>>
<<if _chestVisible>>
	<<set _modeloptions.nipples_parasite to $parasite.nipples.name>>
<</if>>

<</widget>>

<!--
 -     ██████ ██       ██████  ████████ ██   ██ ███████ ███████
 -    ██      ██      ██    ██    ██    ██   ██ ██      ██
 -    ██      ██      ██    ██    ██    ███████ █████   ███████
 -    ██      ██      ██    ██    ██    ██   ██ ██           ██
 -     ██████ ███████  ██████     ██    ██   ██ ███████ ███████
 -->
<!--
Set model options & filters for player clothes
-->
<<widget "modelprepare-player-clothes">>

<<if $worn.upper.type.includes("naked") and $worn.over_upper.type.includes("naked")>>
	<<if !$worn.under_upper.type.includes("naked")>>
		<<set _modeloptions.breasts to "cleavage">>
	<<else>>
		<<set _modeloptions.breasts to "default">>
	<</if>>
<<else>>
	<<set _modeloptions.breasts to "">>
<</if>>

<<if $worn.under_upper.type.includes("chest_bind")>>
	<<set _modeloptions.breast_size to 1>>
<</if>>

<<if $worn.lower.exposed gte 2 and $worn.under_lower.exposed gte 1>>
	<<set _modeloptions.crotch_visible to true>>
	<<set _modeloptions.crotch_exposed to true>>
<<elseif ($lowerwetstage gt 0 or $worn.lower.type.includes("naked")) and ($underlowerwetstage gt 0 or $worn.under_lower.type.includes("naked"))>>
	<<set _modeloptions.crotch_visible to true>>
	<<set _modeloptions.crotch_exposed to false>>
<<else>>
	<<set _modeloptions.crotch_visible to false>>
<</if>>

<<set _modeloptions.hood_down to $hoodDown>>
<<if ((($worn.over_head.hood is 1 and $worn.over_head.mask_img isnot 1) or ($worn.head.hood is 1 and $worn.head.mask_img isnot 1))) and $hoodDown is 0>>
	<<set _modeloptions.hair_sides_length to "short">>
	<<set _modeloptions.hair_fringe_length to "short">>
<</if>>

<<set _modeloptions.upper_tucked to $upperTucked and !setup.clothes.upper[clothesIndex('upper', $worn.upper)].notuck and $worn.upper.outfitPrimary is undefined>>

<<twinescript>>
	let slots = [
		["upper", $upperwetstage],
		["over_upper"],
		["genitals"],
		["lower", $lowerwetstage],
		["over_lower"],
		["under_lower", $underlowerwetstage],
		["under_upper", $underupperwetstage],
		["hands"],
		["head"],
		["over_head"],
		["face"],
		["neck"],
		["legs"],
		["feet"],
	];
	for (let slotobj of slots) {
		let slot = slotobj[0];
		let worn = $worn[slot];
		switch (slotobj[1]) {
			case 1: _modeloptions['worn_'+slot+'_alpha'] = 0.9; break;
			case 2: _modeloptions['worn_'+slot+'_alpha'] = 0.7; break;
			case 3: _modeloptions['worn_'+slot+'_alpha'] = 0.5; break;
			default: _modeloptions['worn_'+slot+'_alpha'] = 1.0; break;
		}
		_modeloptions['worn_'+slot] = clothesIndex(slot,worn);
		_modeloptions['worn_'+slot+'_integrity'] = integrityKeyword(worn,slot);
		_modeloptions['worn_'+slot+'_colour'] = worn.colour;
		if (worn.colour === 'custom') {
			/* TODO @aimozg We recalculate custom colour RGB here; in future versions, we should store custom colours in canvasfilter-friendly way */
			_modeloptions.filters['worn_'+slot+'_custom'] = worn.colourCanvasFilter || getCustomClothesColourCanvasFilter(worn.colourCustom);
		}
		_modeloptions['worn_'+slot+'_acc_colour'] = worn.accessory_colour;
		if (worn.accessory_colour === 'custom') {
			_modeloptions.filters['worn_'+slot+'_acc_custom'] = worn.accessory_colourCanvasFilter || getCustomClothesColourCanvasFilter(worn.accessory_colourCustom);
		}
	}
<</twinescript>>

<</widget>>

<<widget "canvas-player-base-body">>
	<<selectmodel "main">>
	<<modelprepare-player-body>>

	<!-- Reset covering -->
	<<set _modeloptions.arm_left to "idle">>
	<<set _modeloptions.arm_right to "idle">>
	<<set _modeloptions.angel_wing_left to "idle">>
	<<set _modeloptions.angel_wing_right to "idle">>
	<<set _modeloptions.fallen_wing_left to "idle">>
	<<set _modeloptions.fallen_wing_right to "idle">>
	<<set _modeloptions.demon_wing_left to "idle">>
	<<set _modeloptions.demon_wing_right to "idle">>
	<<set _modeloptions.bird_wing_left to "idle">>
	<<set _modeloptions.bird_wing_right to "idle">>
	<!-- Reset face -->
	<<set _modeloptions.blink to false>>
	<<set _modeloptions.eyes_half to false>>
	<<set _modeloptions.brows to "top">>
	<<set _modeloptions.mouth to "neutral">>
	<<set _modeloptions.tears to 0>>
	<<set _modeloptions.blush to 0>>
	<!-- Reset effects -->
	<<set _modeloptions.drip_vaginal to "">>
	<<set _modeloptions.drip_anal to "">>
	<<set _modeloptions.drip_mouth to "">>

	<<if $neverNudeMenus>>
		<<set _modeloptions.crotch_visible to false>>
		<<set _modeloptions.penis to "">>
		<<if $player.gender_appearance neq "m" or $player.perceived_breastsize gte 3>>
			<<set _modeloptions.worn_under_upper to 12>>
			<<set _modeloptions.worn_under_upper_colour to "pale white">>
		<</if>>
		<<set _modeloptions.worn_under_lower_colour to "pale white">>
		<<if $player.gender_appearance is "m">>
			<<set _modeloptions.worn_under_lower to 4>>
		<<else>>
			<<set _modeloptions.worn_under_lower to 1>>
		<</if>>
	<</if>>

	<<if $sidebarRenderer is 'both'>>
		<<rendermodel 'canvasimg-both'>>
	<<else>>
		<<rendermodel>>
	<</if>>
<</widget>>

repo_name: Area/degrees

license: mit


code:
:: Widgets Canvas Model [widget]
<!--
High-level canvas model widgets.

Example #1:
<<selectmodel "main">>

/* set model parameters. see model source/docs on required options and filters */
<<set _modeloptions.showEyes to true>>
<<modelfilter eyes setup.colours.eyes["hazel"].canvasfilter>>

/* show layers */
<<showlayer "base" `{alpha:0.5}`>>
<<showlayer "eyes">>

/* ignite the sin machine */
<<animatemodel>> /* Will insert <canvas> element here and animate it */
/* <<rendermodel>> can be used for static (non-animated) model */
-->

<!--
Example #2.
Rerender model with new options.

<<selectmodel "main">>
	/* set options and filters */
	<<set _modeloptions.size to 10>>
<<animatemodel>>
/* _modelclass is used to keep model; preserve it somewhere */
<<set _testmodel to _modelclass>>

<<button "Randomize me">>
	<<set _testmodel.options.size to random(20)>>
	<<run _testmodel.redraw()>>
<</button>>

-->

<!--
Select model and prepare for rendering
<<selectmodel NAME [INSTANCE]>>
Parameter INSTANCE is id for caching between passages.
Do not render instance multiple times on same passage.
-->
<<widget selectmodel>>
<<set _modelclass to Renderer.locateModel($args[0], $args[1])>>
<<set _modeloptions to _modelclass.defaultOptions()>>
<<run _modelclass.reset()>>
<</widget>>

<!--
Show layer and optionaly add filters
<<showlayer LAYERNAME [...FILTERS]>>
-->
<<widget showlayer>>
<<run _modelclass.showLayer($args[0], $args.slice(1))>>
<</widget>>

<!--
Hide layer
<<hidelayer LAYERNAME>>
-->
<<widget hidelayer>>
<<run _modelclass.hideLayer($args[0])>>
<</widget>>

<!--
Set model filter object.
<<modelfilter FILTERNAME FILTER>>
Will do a copy, so you can safely edit filter options
-->
<<widget modelfilter>>
<<set _modeloptions.filters[$args[0]] to clone($args[1])>>
<</widget>>

<!--
Set model filter option
<<modelfilterset FILTERNAME OPTIONNAME OPTIONVALUE>>
-->
<<widget modelfilterset>>
<<twinescript>>
var filter = _modeloptions.filters[$args[0]];
if (!filter) filter = _modeloptions.filters[$args[0]] = {};
filter[$args[1]] = $args[2];
<</twinescript>>
<</widget>>

<!--
<<animatemodel [CSSCLASS]>>
Render model and JS-animate it
-->
<<widget animatemodel>>
<<twinescript>>
var canvas = _modelclass.canvas || _modelclass.createCanvas();
_modelclass.animate(canvas, _modeloptions, Renderer.defaultListener);
canvas.canvas.className = typeof $args[0] is 'string' ? $args[0] : '';
output.append(canvas.canvas);
<</twinescript>>
<</widget>>

<!--
<<rendermodel [CSSCLASS] [CSSANIM]>>
Render model as a static image
If CSSANIM is true (default false), render multiple frames for CSS animation
-->
<<widget rendermodel>>
<<twinescript>>
var canvas = _modelclass.createCanvas(!!$args[1]);
_modelclass.render(canvas, _modeloptions, Renderer.defaultListener);
canvas.canvas.className = typeof $args[0] is 'string' ? $args[0] : '';
output.append(canvas.canvas);
<</twinescript>>
<</widget>>


code:
:: Widgets Clothing caption text [widget]

<<widget "clothingCaptionText">>
<<run window.outfitChecks()>>
<<if _fullyNaked is false>>
	<<set _clothingCaptionItems to []>>
	<<set _finally to ".">>
	<<set _text_output to "">>

	<<set _wearing to "You are " + (_topless ? "topless, " : "") + "wearing ">>

	<<if !_overNaked>>
		<<clothingCaptionTextOver>>
	<</if>>

	<<if !_middleNaked>>
		<<clothingCaptionTextMiddle>>
	<</if>>

	<<clothingCaptionTextUnder>>

	<<switch Math.clamp(_clothingCaptionItems.length, 0, 3)>>
	<<case 3>>
		<<set _lastItem to _clothingCaptionItems.pop()>>
		<<set _text_output to _wearing + _clothingCaptionItems.join(", ") + " and " + _lastItem>>
	<<case 2>>
		<<set _text_output to _wearing + _clothingCaptionItems[0] + " and " + _clothingCaptionItems[1]>>
	<<case 1>>
		<<set _text_output to _wearing + (_nothingBut ? "nothing but" : "only ") + _clothingCaptionItems[0]>>
	<<default>>
		/* print nothing. but technically, should be impossible */
	<</switch>>
	<<set _text_output += _finally>>
	<<print _text_output>>

	<<clothingCaptionTextGenitals>>
<</if>>
<<clothingCaptionTextNothing>>
<<clothingCaptionTextMask>>

<<if window.checkForExposedClothing()>>
	<<clothingCaptionTextStrip>>
<</if>>

<<clothingCaptionTextGender>>

<</widget>>

<<widget "pushClothingCaption">>
	<<set $_output to " ">>
	<<set $_wornItem to $worn[$args[0]]>>

	/* word 1: article, example: "a" or "an" or "a pair of" */
	<<if def $args[1]>>
		<<set $_output += $args[1] + " ">>
	<<else>>
		<<set $_wornItemWord to setup.clothes[$args[0]][clothesIndex($args[0],$_wornItem)].word>>
		<<set $_output += ($_wornItemWord isnot "n" ? $_wornItemWord : "") + " ">>
	<</if>>

	/* word 2: damage, example "frayed" */
	<<run $_output += window.integrityWord($_wornItem,$args[0])>>

	/* word 3: colour, example: "red" */
	<<run $_output += window.clothesColour($_wornItem) + " ">>

	/* word 4: clothes name, example: "school shirt" */
	<<set $_output += $_wornItem.name>>

	/* push */
	<<set _clothingCaptionItems.pushUnique($_output)>>
<</widget>>

<<widget "clothingCaptionTextOver">><<silently>>
	<<if $worn.over_upper.name isnot "naked">>

		<<pushClothingCaption "over_upper">>
	<</if>>
	<<if $worn.over_lower.name isnot "naked" and !_overOutfit>>

		<<pushClothingCaption "over_lower">>
	<</if>>
<</silently>><</widget>>

<<widget "clothingCaptionTextMiddle">><<silently>>
	<<if $worn.upper.name isnot "naked">>

		<<pushClothingCaption "upper">>
	<</if>>
	<<if $worn.lower.name isnot "naked" and !_middleOutfit>>

		<<pushClothingCaption "lower">>
	<</if>>
<</silently>><</widget>>

<<widget "clothingCaptionTextUnder">><<silently>>
<<set $_exposed to (_overNaked and _middleNaked)>>

<<if _underNaked>>

	<<if ($worn.over_upper.name isnot "naked" or $worn.upper.name isnot "naked") and
	($worn.over_lower.name isnot "naked" or $worn.lower.name isnot "naked")>>
		<<set _finally to " with nothing beneath.">>
	<<elseif $worn.over_upper.name is "naked" or $worn.over_lower.name is "naked" or
	$worn.upper.name is "naked" or $worn.lower.name is "naked">>
		<<set _finally to " and no underwear.">>
	<</if>>
<<else>>
	<<if $_exposed>>
		<<set _wearing to "You are " + (_topless ? "topless, " : "") + "wearing ">>
		<<set _finally to ".">>
	<</if>>
	<<if $worn.under_upper.name isnot "naked" and $worn.under_lower.name isnot "naked">>

		<<set _nothingBut to $_exposed and _underOutfit>>

		<<pushClothingCaption "under_upper">>
		<<if !_underOutfit>>
			<<pushClothingCaption "under_lower">>
		<</if>>
	<<elseif $worn.under_upper.name isnot "naked">>

		<<pushClothingCaption "under_upper">>

		<<set _nothingBut to $_exposed>>
		<<if !$_exposed and !_bottomless>>
			<<set _finally to ". You are not wearing " + ($player.gender isnot "m" ? "any panties" : "undies") + ".">>
		<</if>>
	<<elseif $worn.under_lower.name isnot "naked">>

		<<set $_pair to ($worn.under_lower.name.last() is "s" ? "a pair of" : "<<word under_lower>>")>>
		<<pushClothingCaption "under_lower" $_pair>>

		<<set _nothingBut to $_exposed>>
		<<if !$_exposed and !_topless and $breastsize gte 4 and ($player.gender isnot "m" or $backgroundTraits.includes("crossdresser"))>>
			<<set _finally to ". You are not wearing a bra.">>
		<</if>>
	<</if>>
<</if>>
<</silently>><</widget>>

<<widget "clothingCaptionTextGenitals">><<silently>>
<<if $worn.genitals.name isnot "naked">>
	<<if _bottomless>>
		<<set $_text_output to " Your <<genitalsintegrity>> $worn.genitals.name <<if $worn.genitals.anal_shield is 1>>with an anal shield<</if>> gives you no comfort.">>
	<<else>>
		<<set $_text_output to " You wear <<genitalsword>> <<genitalsintegrity>> $worn.genitals.name<<if $worn.genitals.anal_shield is 1>> with an anal shield<</if>>.">>
	<</if>>
<</if>>
<</silently>><<if $_text_output>><<print $_text_output>><</if>>
<</widget>>

<<widget "clothingCaptionTextMask">>
	<<if $worn.face.type.includes("mask")>>
Your identity is concealed by your $worn.face.name.<</if>>
<</widget>>

<<widget "clothingCaptionTextNothing">><<silently>>
<<if _fullyNaked>>
	<<if $worn.genitals.name isnot "naked">>
		<<set $_text_output to "Your <<genitalsintegrity>> $worn.genitals.name <<if $worn.genitals.anal_shield is 1>>with an anal shield<</if>> gives you no comfort.">>
	<<else>>
		<<set $_text_output to "You are completely naked!">>
	<</if>>
<<elseif _bottomless>>
	<<set $_text_output to "Your bottom half is completely exposed!">>
<</if>>
<</silently>><<if $_text_output>><<print $_text_output>><</if>>
<</widget>>

<<widget "clothingstatecompare">>
	/* One argument, a clothing article whose state you want to compare against its original state. Must be the ENTIRE variable, not .name! */
	/* Returns the difference between the current and base states. Negative means it's pulled down, positive means it's pulled up.  */
	/* If the clothing was pulled to the side, this returns 0. It would also return 0 if the current state is the base state. */
	<<set _compare_result to _clothing_levels.indexOf($worn[$args[0]].state) - _clothing_levels.indexOf(setup.clothes[$args[0]][clothesIndex($args[0],$worn[$args[0]])].state_base)>>
	<<if $worn[$args[0]].state is "totheside">><<set _compare_result to 0>><</if>>
<</widget>>

<<widget "clothingCaptionTextStrip">>
	<<set _captionCount to 0>>
	<<set _clothing_levels to [0,"ankles","knees","thighs","waist","midriff","chest"]>>
	<<clothingCaptionExposed "upper">>
	<<clothingCaptionExposed "lower">>

	<<if _captionCount gte 1>>

 /* insert extra newlines after the caption, if there is one, for better style */
	<</if>>
	<<unset _captionCount>>
<</widget>>

<<widget "clothingCaptionExposed">>
	<<set $_clothes to {"naked": [], "wet": [], "up": [], "down": [], "totheside": [], "exposed": []}>>
	<<set $_plural to {"naked": false, "wet": false, "up": false, "down": false, "totheside": false, "exposed": false}>>
	<<set $_isExposed to false>>
	<<set $_revealColour to "purple">>
	<<set $_highestLevelCovered to "">>
	<<set $_clothingRevealType to {}>>
	<<set $_outfitType to $args[0]>>

	/* Find which clothes are failing to cover the player */
	<<for $_i, $_outfitLayer range ["over", "", "under"]>>
		<<set $_clothing to [$_outfitLayer, $_outfitType].filter(Boolean).join("_")>>
		<<set _wetstage to $_outfitLayer + $_outfitType + "wetstage">>
		<<set $_wornClothing to $worn[$_clothing]>>

		<<if $_wornClothing.type.includes("naked")>>
			<<set $_clothingRevealType[$_clothing] to "naked">>
			<<continue>>
		<<elseif $_wornClothing.state isnot setup.clothes[$_clothing][clothesIndex($_clothing,$_wornClothing)].state_base>>
			<<clothingstatecompare $_clothing>>
			<<if _compare_result gte 1>>
				<<set $_clothingRevealType[$_clothing] to "up">>
			<<elseif _compare_result lte -1>>
				<<set $_clothingRevealType[$_clothing] to "down">>
			<<else>>
				<<set $_clothingRevealType[$_clothing] to "totheside">>
			<</if>>
		<<elseif $_wornClothing.exposed is 2>>
			<<set $_clothingRevealType[$_clothing] to "exposed">>
		<<elseif V[_wetstage] gte 3>>
			<<set $_clothingRevealType[$_clothing] to "wet">>
		<<else>>
			<<set $_clothingRevealType[$_clothing] to false>>
			<<set $_highestLevelCovered to $_wornClothing.name>>
			<<break>> /* don't check clothing below the current layer if this layer is blocking visibility */
		<</if>>

		<<set $_revealType to $_clothingRevealType[$_clothing]>>

		<<set $_clothes[$_revealType].pushUnique($_wornClothing.name)>>
		<<set $_plural[$_revealType] to ($_plural[$_revealType] or ($_wornClothing.plural is 1))>>
		<<set $_isExposed to true>>
	<</for>>

	<<if $_isExposed>>
		/* Find which areas are exposed */
		<<if $_highestLevelCovered is "">>
			<<silently>>
			<<if $_outfitType is "upper">>
				<<breasts>><<set $_undertext to _text_output>>
			<<else>>
				<<set $_revealColour to "pink">>
				<<genitals>><<set $_undertext to _text_output>>
			<</if>>
			<</silently>>
		<<else>>
			<<set $_undertext to $_highestLevelCovered>>
		<</if>>

		/* Piece together the caption */
		<<set _output to "">>
		<<for $_type range ["wet", "up", "down", "totheside", "exposed"]>>
			<<if $_clothes[$_type].length lte 0>>
				<<continue>>
			<</if>>
			<<set $_verbIsPlural to ($_clothes[$_type].length gte 2 or $_plural[$_type])>>
			<<switch $_type>>
				<<case "wet">> 		 <<set $_verb to ($_verbIsPlural ? " are drenched, " : " is drenched, ")>>
				<<case "exposed">> 	 <<set $_verb to ($_verbIsPlural ? " have been pulled aside, " : " has been pulled aside, ")>>
				<<case "up">> 		 <<set $_verb to ($_verbIsPlural ? " have been pulled up, " : " has been pulled up, ")>>
				<<case "down">> 	 <<set $_verb to ($_verbIsPlural ? " have been pulled down, " : " has been pulled down, ")>>
				<<case "totheside">> <<set $_verb to ($_verbIsPlural ? " have been pulled to the side, " : " has been pulled to the side, ")>>
			<</switch>>

			<<if _output isnot "">><<set _output += " and your ">><</if>>
			<<if $_clothes[$_type].length is 1>>
				<<set _output += $_clothes[$_type][0] + $_verb>>
			<<elseif $_clothes[$_type].length is 2>>
				<<set _output += $_clothes[$_type][0] + " and " + $_clothes[$_type][1] + $_verb>>
			<<else>>
				<<set _lastClothes to $_clothes[$_type].pop()>>
				<<set _output += $_clothes[$_type].join(", ") + "and _lastClothes" + $_verb>>
			<</if>>
		<</for>>

		/* Print the caption */
		<<set _captionCount += 1>>

		Your _output revealing your $_undertext.
	<</if>>
<</widget>>

<<widget "clothingCaptionTextGender">><<silently>>

<<if $player.gender isnot "f" and $player.gender_appearance is "f">>
	<<if $breastindicator is 1>>
		<<set $_text_output to "Your exposed breasts will make people think you're a girl!">>
	<<elseif $exposed gte 2>>
		<<set $_text_output to "The way you look, people will think you're a girl!">>
	<<else>>
		<<set $_text_output to "The way you're dressed, people will think you're a girl!">>
	<</if>>
<<elseif $player.gender isnot "m" and $player.gender_appearance is "m">>
	<<if $breastindicator is 0 and $worn.upper.exposed is 2 and $worn.under_upper.exposed gte 1>>
		<<set $_text_output to "Your exposed flat chest will make people think you're a boy!">>
	<<elseif $exposed gte 2>>
		<<set $_text_output to "The way you look, people will think you're a boy!">>
	<<else>>
		<<set $_text_output to "The way you're dressed, people will think you're a boy!">>
	<</if>>
<</if>>
<</silently>><<if $_text_output>><<print $_text_output>><</if>>
<</widget>>


code:
:: Widgets Face [widget]
<!-- For any item that has a colour_combat tag, set it to 0 if that item ever gets its own combat sprites. -->
<<widget "init_face">>
<<set setup.clothes.face to [

	{index: 0,
	name: "naked",
	name_cap: "Naked",
	variable: "naked",
	integrity: 10,
	integrity_max: 10,
	fabric_strength: 20,
	reveal: 1,
	word: "a",
	plural: 0,
	colour: 0,
	colour_options: [],
	type: ["naked"],
	gender: "n",
	warmth: 0,
	cost: 0,
	description: "naked",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: 0,
	accIcon: 0,
	mainImage:0
},

	{index: 1,
	name: "glasses",
	name_cap: "Glasses",
	variable: "glasses",
	integrity: 20,
	integrity_max: 20,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["glasses"],
	gender: "n",
	warmth: 0,
	cost: 5000,
	description: "Makes studying easier, but you might be picked on at school.",
	shop: ["clothing", "school"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Glasses.png",
	accIcon: 0
},

	{index: 2,
	name: "cool shades",
	name_cap: "Cool shades",
	variable: "coolshades",
	integrity: 30,
	integrity_max: 30,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["cool"],
	gender: "n",
	warmth: 0,
	cost: 7000,
	description: "Makes status rise faster at school.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Cool shades.png",
	accIcon: 0
},

	{index: 3,
	name: "surgical mask",
	name_cap: "Surgical mask",
	variable: "surgicalmask",
	integrity: 20,
	integrity_max: 20,
	fabric_strength: 20,
	reveal: 1,
	word: "a",
	plural: 0,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["mask"],
	gender: "n",
	warmth: 10,
	cost: 2000,
	description: "Hides your identity.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Surgical mask.png",
	accIcon: 0
},

	{index: 4,
	name: "gag",
	name_cap: "Gag",
	variable: "gag",
	integrity: 20,
	integrity_max: 20,
	fabric_strength: 20,
	reveal: 500,
	word: "a",
	plural: 0,
	colour: 0,
	colour_options: [],
	colour_combat: 0,
	type: ["fetish", "gag"],
	gender: "n",
	warmth: 0,
	cost: 2000,
	description: "Keeps your mouth shut.",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 1,
	location: 0,
	iconFile: "",
	accIcon: 0
},

	{index: 5,
	name: "blindfold",
	name_cap: "Blindfold",
	variable: "blindfold",
	integrity: 20,
	integrity_max: 20,
	fabric_strength: 20,
	reveal: 500,
	word: "a",
	plural: 0,
	colour: 0,
	colour_options: [],
	colour_combat: 0,
	type: ["fetish", "blindfold"],
	gender: "n",
	warmth: 0,
	cost: 2000,
	description: "Keeps you in the dark.",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 1,
	location: 0,
	iconFile: "",
	accIcon: 0
},

	{index: 6,
	name: "gag and blindfold",
	name_cap: "Gag and blindfold",
	variable: "gagblindfold",
	integrity: 30,
	integrity_max: 30,
	fabric_strength: 20,
	reveal: 1000,
	word: "a",
	plural: 0,
	colour: 0,
	colour_options: [],
	colour_combat: 0,
	type: ["fetish", "gag", "blindfold"],
	gender: "n",
	warmth: 0,
	cost: 3000,
	description: "Keeps your mouth shut and eyes covered.",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 1,
	location: 0,
	iconFile: "",
	accIcon: 0
},

	{index: 7,
	name: "skulduggery mask",
	name_cap: "Skulduggery mask",
	variable: "skulmask",
	integrity: 30,
	integrity_max: 30,
	fabric_strength: 20,
	reveal: 1,
	word: "a",
	plural: 0,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["mask", "stealthy"],
	gender: "n",
	warmth: 0,
	cost: 23000,
	description: "For those up to no good.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Skulduggery mask.png",
	accIcon: 0
},

	{index: 8,
	name: "low frame glasses",
	name_cap: "Low frame glasses",
	variable: "lowframe",
	integrity: 20,
	integrity_max: 20,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["glasses"],
	gender: "n",
	warmth: 0,
	cost: 5000,
	description: "Makes studying easier, but you might be picked on at school.",
	shop: ["clothing", "school"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Low frame glasses.png",
	accIcon: 0
},

	{index: 9,
	name: "half moon glasses",
	name_cap: "Half moon glasses",
	variable: "halfmoon",
	integrity: 20,
	integrity_max: 20,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["glasses"],
	gender: "n",
	warmth: 0,
	cost: 5000,
	description: "Makes studying easier, but you might be picked on at school.",
	shop: ["clothing", "school"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Half moon glasses.png",
	accIcon: 0
},

	{index: 10,
	name: "deep frame glasses",
	name_cap: "Deep frame glasses",
	variable: "deepframe",
	integrity: 20,
	integrity_max: 20,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["glasses"],
	gender: "n",
	warmth: 0,
	cost: 5000,
	description: "Makes studying easier, but you might be picked on at school.",
	shop: ["clothing", "school"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Deep frame glasses.png",
	accIcon: 0
},

	{index: 11,
	name: "square shades",
	name_cap: "Square shades",
	variable: "square",
	integrity: 30,
	integrity_max: 30,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["cool"],
	gender: "n",
	warmth: 0,
	cost: 7000,
	description: "Makes status rise faster at school.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Square shades.png",
	accIcon: 0
},

	{index: 12,
	name: "round shades",
	name_cap: "Round shades",
	variable: "round",
	integrity: 30,
	integrity_max: 30,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["cool"],
	gender: "n",
	warmth: 0,
	cost: 7000,
	description: "Makes status rise faster at school.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Round shades.png",
	accIcon: 0
},

	{index: 13,
	name: "shield shades",
	name_cap: "Shield shades",
	variable: "shield",
	integrity: 30,
	integrity_max: 30,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["cool"],
	gender: "n",
	warmth: 0,
	cost: 7000,
	description: "Makes status rise faster at school.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Shield shades.png",
	accIcon: 0
},

	{index: 14,
	name: "cat eye shades",
	name_cap: "Cat eye shades",
	variable: "cateye",
	integrity: 30,
	integrity_max: 30,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["cool"],
	gender: "n",
	warmth: 0,
	cost: 7000,
	description: "Makes status rise faster at school.",
	shop: ["clothing"],
	accessory: 1,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Cat eye shades.png",
	accIcon: 0
},

	{index: 15,
	name: "aviators",
	name_cap: "Aviators",
	variable: "aviator",
	integrity: 30,
	integrity_max: 30,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["cool"],
	gender: "n",
	warmth: 0,
	cost: 7000,
	description: "Makes status rise faster at school.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Aviators.png",
	accIcon: 0
},

	{index: 16,
	name: "punk shades",
	name_cap: "Punk shades",
	variable: "punk",
	integrity: 30,
	integrity_max: 30,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["cool"],
	gender: "n",
	warmth: 0,
	cost: 3500,
	description: "Makes status rise faster at school.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Punk shades.png",
	accIcon: 0
},

	{index: 17,
	name: "muzzle",
	name_cap: "Muzzle",
	variable: "muzzle",
	integrity: 30,
	integrity_max: 30,
	fabric_strength: 20,
	reveal: 200,
	word: "a",
	plural: 0,
	colour: 0,
	colour_options: [],
	colour_combat: 0,
	type: ["gag"],
	gender: "n",
	warmth: 0,
	cost: 0,
	description: "Keeps your dangerous mouth shut.",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 1,
	location: 0,
	iconFile: "",
	accIcon: 0
},

	{index: 18,
	name: "mummy facewrap",
	name_cap: "Mummy facewrap",
	variable: "mummy",
	integrity: 10,
	integrity_max: 10,
	fabric_strength: 1,
	reveal: 1,
	word: "a",
	plural: 0,
	colour: 0,
	colour_options: [],
	colour_combat:"white",
	type: ["costume"],
	gender: "n",
	warmth: 10,
	cost: 500,
	description: "Feels like it's made from toilet paper.",
	shop: ["forest"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Mummy facewrap.png",
	accIcon: 0
},

	{index: 19,
	name: "swimming goggles",
	name_cap: "Swimming goggles",
	variable: "swimgoggles",
	integrity: 70,
	integrity_max: 70,
	fabric_strength: 25,
	reveal: 1,
	word: "a",
	plural: 0,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["swim", "diving"],
	gender: "n",
	warmth: 10,
	cost: 1500,
	description: "For keeping your vision clear down below.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Swimming goggles.png",
	accIcon: 0
}

]>>

<!--
	Clothes that modders add go into this array, this should be empty in the base game at all times.
	These items should have a `modder` variable with a the modders name in a short string
-->
<<set setup.moddedClothes.face to []>>

<<run setup.moddedClothes.face.forEach( (x,i) => x.index = setup.clothes.face.length + i )>>
<<run setup.clothes.face.push(...setup.moddedClothes.face)>>
<</widget>>


code:
:: Widgets Feet [widget]
<!-- For any item that has a colour_combat tag, set it to 0 if that item ever gets its own combat sprites. -->
<<widget "init_feet">>
<<set setup.clothes.feet to [

	{index: 0,
	name: "naked",
	name_cap: "Naked",
	variable: "naked",
	integrity: 10,
	integrity_max: 10,
	fabric_strength: 20,
	reveal: 1,
	word: "a",
	plural: 0,
	colour: 0,
	colour_options: [],
	type: ["naked"],
	gender: "n",
	warmth: 0,
	cost: 0,
	description: "naked",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: 0,
	accIcon: 0,
	mainImage:0
},

	{index: 1,
	name: "school shoes",
	name_cap: "School shoes",
	variable: "schoolshoes",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["school"],
	gender: "n",
	warmth: 10,
	cost: 2500,
	description: "Smart and suitable for school.",
	shop: ["clothing", "school"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "School shoes.png",
	accIcon: 0
},

	{index: 2,
	name: "tuxedo shoes",
	name_cap: "Tuxedo shoes",
	variable: "tuxedoshoes",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["formal"],
	gender: "m",
	femininity: -100,
	warmth: 15,
	cost: 10000,
	description: "Smart and sophisticated.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Tuxedo shoes.png",
	accIcon: 0
},

	{index: 3,
	name: "ankle cuffs",
	name_cap: "Ankle cuffs",
	variable: "anklecuffs",
	integrity: 400,
	integrity_max: 400,
	fabric_strength: 20,
	reveal: 200,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["fetish", "shackle"],
	gender: "n",
	warmth: 0,
	cost: 10000,
	description: "Requires a special tool to unlock.",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 1,
	location: 0,
	iconFile: 0,
	accIcon: 0
},

	{index: 4,
	name: "sandals",
	name_cap: "Sandals",
	variable: "sandals",
	integrity: 100,
	integrity_max: 100,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["normal"],
	gender: "n",
	warmth: 0,
	cost: 2000,
	description: "Cool in summer.",
	shop: ["clothing"],
	accessory: 1,
	accessory_colour: 0,
	accessory_colour_options: [],
	accessory_colour_combat:"brown",
	cursed: 0,
	location: 0,
	iconFile: "Sandals.png",
	accIcon: 0
},

	{index: 5,
	name: "dress sandals",
	name_cap: "Dress sandals",
	variable: "dresssandals",
	integrity: 100,
	integrity_max: 100,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["formal"],
	gender: "f",
	femininity: 200,
	warmth: 0,
	cost: 10000,
	description: "Fashionable and sophisticated.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Dress sandals.png",
	accIcon: 0
},

	{index: 6,
	name: "trainers",
	name_cap: "Trainers",
	variable: "trainers",
	integrity: 250,
	integrity_max: 250,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["normal"],
	gender: "n",
	warmth: 10,
	cost: 3000,
	description: "Casual and practical.",
	shop: ["clothing"],
	accessory: 1,
	accessory_colour: 0,
	accessory_colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	accessory_colour_sidebar: 1,
	cursed: 0,
	location: 0,
	iconFile: "Trainers.png",
	accIcon: "Trainers_acc.png"
},

	{index: 7,
	name: "witch shoes",
	name_cap: "Witch shoes",
	variable: "witch",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["costume"],
	gender: "f",
	femininity: 200,
	warmth: 20,
	cost: 4000,
	description: "Waterproof.",
	shop: ["forest"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Witch shoes.png",
	accIcon: 0
},

	{index: 8,
	name: "wellies",
	name_cap: "Wellies",
	variable: "wellies",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["normal", "rugged"],
	gender: "n",
	warmth: 50,
	cost: 5000,
	description: "Waterproof.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Wellies.png",
	accIcon: 0
},

	{index: 9,
	name: "platform heels",
	name_cap: "Platform heels",
	variable: "platformheels",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 800,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "custom"],
	colour_sidebar: 1,
	type: ["formal", "serving", "bimbo", "heels"],
	gender: "f",
	femininity: 200,
	warmth: 10,
	cost: 5000,
	description: "Makes you feel rather girly.",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Platform heels.png",
	accIcon: 0
},

	{index: 10,
	name: "kitten heels",
	name_cap: "Kitten heels",
	variable: "kittenheels",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 50,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["formal", "heels"],
	gender: "f",
	femininity: 200,
	warmth: 10,
	cost: 10000,
	description: "It's called a kitten heel because it's only three centimetres.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Kitten heels.png",
	accIcon: 0
},

	{index: 11,
	name: "wedge sandals",
	name_cap: "Wedge sandals",
	variable: "wedgesandals",
	integrity: 100,
	integrity_max: 100,
	fabric_strength: 20,
	reveal: 400,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["normal", "heels"],
	gender: "f",
	femininity: 200,
	warmth: 0,
	cost: 3500,
	description: "Great for the beach.",
	shop: ["clothing"],
	accessory: 1,
	accessory_colour: 0,
	accessory_colour_options: [],
	accessory_colour_combat: 0,
	cursed: 0,
	location: 0,
	iconFile: "Wedge sandals.png",
	accIcon: 0,
},

	{index: 12,
	name: "court heels",
	name_cap: "Court heels",
	variable: "courtheels",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 500,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["formal", "serving", "heels"],
	gender: "f",
	femininity: 200,
	warmth: 10,
	cost: 12500,
	description: "Quite tall and very grown-up.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Court heels.png",
	accIcon: 0
},

	{index: 13,
	name: "heeled boots",
	name_cap: "Heeled boots",
	variable: "bootheels",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 600,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["fetish", "serving", "heels"],
	gender: "f",
	femininity: 200,
	warmth: 20,
	cost: 16000,
	description: "A powerful choice.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Heeled boots.png",
	accIcon: 0
},

	{index: 14,
	name: "stripper heels",
	name_cap: "Stripper heels",
	variable: "stripperheels",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 800,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["dance", "fetish", "heels"],
	gender: "f",
	femininity: 200,
	warmth: 10,
	cost: 25000,
	description: "Crazy tall and very slutty.",
	shop: ["clothing"],
	accessory: 1,
	accessory_colour: 0,
	accessory_colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	accessory_colour_sidebar: 1,
	cursed: 0,
	location: 0,
	iconFile: "Stripper heels.png",
	accIcon: 0
},

	{index: 15,
	name: "horsebit loafers",
	name_cap: "Horsebit loafers",
	variable: "horsebitloafers",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["normal"],
	gender: "m",
	femininity: -100,
	warmth: 10,
	cost: 20000,
	description: "A pair of black horsebit loafers.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Horsebit loafers.png",
	accIcon: 0
},

	{index: 16,
	name: "cordovan loafers",
	name_cap: "Cordovan loafers",
	variable: "cordovanloafers",
	integrity: 300,
	integrity_max: 300,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["normal"],
	gender: "m",
	femininity: -100,
	warmth: 10,
	cost: 40000,
	description: "A pair of shell cordovan loafers. Pricey, but very high quality.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Cordovan loafers.png",
	accIcon: 0
},

	{index: 17,
	name: "bunny slippers",
	name_cap: "Bunny slippers",
	variable: "bunny",
	integrity: 100,
	integrity_max: 100,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"white",
	type: ["normal"],
	gender: "f",
	femininity: 200,
	warmth: 40,
	cost: 2000,
	description: "Keeps your toes warm.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Bunny slippers.png",
	accIcon: 0
},

	{index: 18,
	name: "combat boots",
	name_cap: "Combat boots",
	variable: "combat",
	integrity: 500,
	integrity_max: 500,
	fabric_strength: 50,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["normal", "rugged"],
	gender: "m",
	femininity: -100,
	warmth: 20,
	cost: 20000,
	description: "Made from robust, high-quality materials.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Combat boots.png",
	accIcon: 0
},

	{index: 19,
	name: "field boots",
	name_cap: "Field boots",
	variable: "field",
	integrity: 400,
	integrity_max: 400,
	fabric_strength: 40,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["normal", "riding"],
	gender: "n",
	femininity: 0,
	warmth: 20,
	cost: 14500,
	description: "Flexible. For professional riding.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Field boots.png",
	accIcon: 0
},

	{index: 20,
	name: "paddock boots",
	name_cap: "Paddock boots",
	variable: "paddock",
	integrity: 300,
	integrity_max: 300,
	fabric_strength: 40,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["normal", "riding"],
	gender: "n",
	femininity: 0,
	warmth: 20,
	cost: 8000,
	description: "For casual riding.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Paddock boots.png",
	accIcon: 0
},

	{index: 21,
	name: "work boots",
	name_cap: "Work boots",
	variable: "work",
	integrity: 300,
	integrity_max: 300,
	fabric_strength: 40,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"brown",
	type: ["normal", "rugged"],
	gender: "n",
	femininity: 0,
	warmth: 20,
	cost: 6000,
	description: "Protects your toes.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Work boots.png",
	accIcon: 0
},

	{index: 22,
	name: "flippers",
	name_cap: "Flippers",
	variable: "flippers",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 60,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["swim", "diving"],
	gender: "n",
	femininity: 0,
	warmth: 30,
	cost: 2000,
	description: "Lets you dive faster.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Flippers.png",
	accIcon: 0
},

	{index: 23,
	name: "ice skates",
	name_cap: "Ice skates",
	variable: "iceskates",
	integrity: 100,
	integrity_max: 100,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["normal"],
	gender: "n",
	femininity: 0,
	warmth: 0,
	cost: 10000,
	description: "Sturdy, yet elegant, like those that perform in them.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Ice skates.png",
	accIcon: 0
},

	{index: 24,
	name: "long boots",
	name_cap: "Long boots",
	variable: "long",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 60,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["normal"],
	gender: "n",
	femininity: 0,
	warmth: 40,
	cost: 4500,
	description: "Covers your knees.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Long boots.png",
	accIcon: 0
},

	{index: 25,
	name: "light-up trainers",
	name_cap: "Light-up trainers",
	variable: "lightuptrainers",
	integrity: 250,
	integrity_max: 250,
	fabric_strength: 20,
	reveal: 200,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["normal"],
	gender: "n",
	warmth: 10,
	cost: 4500,
	description: "For better visibility.",
	shop: ["clothing"],
	accessory: 1,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Light-up trainers.png",
	accIcon: "Light-up trainers_acc.png"
},

	{index: 26,
	name: "ball and chain",
	name_cap: "Ball and chain",
	variable: "ballchain",
	integrity: 400,
	integrity_max: 400,
	fabric_strength: 20,
	reveal: 200,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"black",
	type: ["fetish", "shackle"],
	gender: "n",
	warmth: 0,
	cost: 10000,
	description: "Requires a special tool to unlock.",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 1,
	location: 0,
	iconFile: 0,
	accIcon: 0
},

	{index: 27,
	name: "cowboy boots",
	name_cap: "Cowboy boots",
	variable: "cowboy",
	integrity: 350,
	integrity_max: 350,
	fabric_strength: 40,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat:"brown",
	type: ["normal", "riding"],
	gender: "m",
	femininity: -200,
	warmth: 30,
	cost: 8500,
	description: "Spurs included.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	cursed: 0,
	location: 0,
	iconFile: "Cowboy boots.png",
	accIcon: 0
}

]>>

<!--
	Clothes that modders add go into this array, this should be empty in the base game at all times.
	These items should have a `modder` variable with a the modders name in a short string
-->
<<set setup.moddedClothes.feet to []>>

<<run setup.moddedClothes.feet.forEach( (x,i) => x.index = setup.clothes.feet.length + i )>>
<<run setup.clothes.feet.push(...setup.moddedClothes.feet)>>
<</widget>>


code:
:: Widgets Genitals [widget]
<!-- For any item that has a colour_combat tag, set it to 0 if that item ever gets its own combat sprites. -->
<<widget "init_genitals">>
<<set setup.clothes.genitals to [

	{index: 0,
	name: "naked",
	name_cap: "Naked",
	variable: "naked",
	integrity: 0,
	integrity_max: 0,
	fabric_strength: 0,
	reveal: 1,
	word: "n",
	plural: 0,
	colour: 0,
	colour_options: [],
	exposed: 1,
	exposed_base: 1,
	vagina_exposed: 1,
	vagina_exposed_base: 1,
	anus_exposed: 1,
	anus_exposed_base: 1,
	type: ["naked"],
	gender: "n",
	cost: 0,
	description: "naked",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	back_img: 0,
	cursed: 0,
	location: 0,
	hideUnderLower: [],
	iconFile: 0,
	accIcon: 0,
	mainImage:0
},
	{index: 1,
	name: "chastity belt",
	name_cap: "Chastity belt",
	variable: "chastitybelt",
	integrity: 2000,
	integrity_max: 2000,
	fabric_strength: 15,
	reveal: 1000,
	word: "a",
	one_piece: 0,
	state: "waist",
	state_base: "waist",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat: 0,
	exposed: 0,
	exposed_base: 0,
	vagina_exposed: 0,
	vagina_exposed_base: 0,
	anus_exposed: 1,
	anus_exposed_base: 1,
	type: ["chastity", "hidden"],
	anal_shield: 0,
	set: "genitals",
	gender: "f",
	femininity: 300,
	cost: 0,
	description: "Restrictive.",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	penis_img: 0,
	high_img: 0,
	cursed: 1,
	location: 0,
	hideUnderLower: ["leotard bottom","full body leotard bottom"],
	iconFile: 0,
	accIcon: 0
},
	{index: 2,
	name: "chastity cage",
	name_cap: "Chastity cage",
	variable: "chastitycage",
	integrity: 2000,
	integrity_max: 2000,
	fabric_strength: 15,
	reveal: 1000,
	word: "a",
	one_piece: 0,
	state: "waist",
	state_base: "waist",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat: 0,
	exposed: 1,
	exposed_base: 1,
	vagina_exposed: 0,
	vagina_exposed_base: 0,
	anus_exposed: 1,
	anus_exposed_base: 1,
	type: ["chastity", "cage"],
	anal_shield: null,
	set: "genitals",
	gender: "m",
	cost: 0,
	description: "Restrictive.",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	penis_img: 0,
	high_img: 0,
	cursed: 1,
	location: 0,
	hideUnderLower: ["plain panties", "bikini bottoms", "lace panties", "briefs", "school swimsuit bottom", "school swim shorts", "leotard bottom", "full body leotard bottom", "skimpy leotard bottom", "foreign school swimsuit bottom", "swimsuit bottom", "bunny leotard bottom", "boyshorts", "catgirl panties", "G-string", "microkini bottom", "speedo", "striped panties", "thong", "classic plain panties", "classic bikini bottoms", "classic lace panties", "classic briefs", "classic school swimsuit bottom"],
	iconFile: 0,
	accIcon: 0
},
	{index: 3,
	name: "gold chastity belt",
	name_cap: "Gold chastity belt",
	variable: "goldchastitybelt",
	integrity: 6000,
	integrity_max: 6000,
	fabric_strength: 15,
	reveal: 1000,
	word: "a",
	one_piece: 0,
	state: "waist",
	state_base: "waist",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_combat: 0,
	exposed: 0,
	exposed_base: 0,
	vagina_exposed: 0,
	vagina_exposed_base: 0,
	anus_exposed: 1,
	anus_exposed_base: 1,
	type: ["chastity", "hidden"],
	anal_shield: 0,
	set: "genitals",
	gender: "f",
	femininity: 300,
	cost: 0,
	description: "Luxurious and restrictive.",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	penis_img: 0,
	high_img: 0,
	cursed: 1,
	location: 0,
	hideUnderLower: ["leotard bottom", "full body leotard bottom"],
	iconFile: 0,
	accIcon: 0
}

]>>

<!--
	Clothes that modders add go into this array, this should be empty in the base game at all times.
	These items should have a `modder` variable with a the modders name in a short string
-->
<<set setup.moddedClothes.genitals to []>>

<<run setup.moddedClothes.genitals.forEach( (x,i) => x.index = setup.clothes.genitals.length + i )>>
<<run setup.clothes.genitals.push(...setup.moddedClothes.genitals)>>
<</widget>>


code:
:: Widgets Hands [widget]
<!-- For any item that has a colour_combat tag, set it to 0 if that item ever gets its own combat sprites. -->
<<widget "init_hands">>
<<set setup.clothes.hands to [
	{index: 0,
	name: "naked",
	name_cap: "Naked",
	variable: "naked",
	integrity: 0,
	integrity_max: 0,
	fabric_strength: 0,
	reveal: 1,
	word: "n",
	plural: 0,
	colour: 0,
	colour_options: [],
	type: ["naked"],
	gender: "n",
	warmth: 0,
	cost: 0,
	description: "naked",
	shop: [],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	back_img: 0,
	cursed: 0,
	location: 0,
	iconFile: 0,
	accIcon: 0,
	mainImage:0
},

	{index: 1,
	name: "fingerless gloves",
	name_cap: "Fingerless gloves",
	variable: "fingerlessgloves",
	integrity: 50,
	integrity_max: 50,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["normal"],
	gender: "n",
	warmth: 5,
	cost: 1000,
	description: "Fingerless gloves to keep your hands warm.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	back_img: 0,
	cursed: 0,
	location: 0,
	iconFile: "Fingerless gloves.png",
	accIcon: 0,
	mainImage:0,
	leftImage:1,
	rightImage:1
},

	{index: 2,
	name: "mittens",
	name_cap: "Mittens",
	variable: "mittens",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 1,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["normal"],
	gender: "n",
	warmth: 50,
	cost: 400,
	description: "Isn't shaped for individual fingers, but that shouldn't be a problem.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	back_img: 0,
	cursed: 0,
	location: 0,
	iconFile: "Mittens.png",
	accIcon: 0,
	mainImage:0,
	leftImage:1,
	rightImage:1
},

	{index: 3,
	name: "arm warmers",
	name_cap: "Arm warmers",
	variable: "armwarmers",
	integrity: 100,
	integrity_max: 100,
	fabric_strength: 20,
	reveal: 100,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	colour_sidebar: 1,
	type: ["normal"],
	gender: "n",
	warmth: 40,
	cost: 1000,
	description: "Keep your arms warm.",
	shop: ["clothing"],
	accessory: 1,
	accessory_colour: 0,
	accessory_colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "tangerine", "teal", "white", "yellow", "custom"],
	accessory_colour_sidebar: 1,
	back_img: 0,
	cursed: 0,
	location: 0,
	iconFile: "Arm warmers.png",
	accIcon: "Arm warmers_acc.png",
	mainImage:0,
	leftImage:1,
	rightImage:1
},

	{index: 4,
	name: "lace arm warmers",
	name_cap: "Lace arm warmers",
	variable: "lacewarmers",
	integrity: 30,
	integrity_max: 30,
	fabric_strength: 15,
	reveal: 500,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "pale tangerine", "teal", "pale white", "pale yellow", "custom"],
	colour_sidebar: 1,
	type: ["formal"],
	gender: "f",
	warmth: 5,
	cost: 2500,
	description: "Fashionable.",
	shop: ["clothing"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	back_img: 0,
	cursed: 0,
	location: 0,
	iconFile: "Lace arm warmers.png",
	accIcon: 0,
	mainImage:0,
	leftImage:1,
	rightImage:1
},

	{index: 5,
	name: "long leather gloves",
	name_cap: "Long leather gloves",
	variable: "longleathergloves",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 500,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	colour_sidebar: 0,
	type: ["normal","sticky_fingers","stealthy"],
	gender: "n",
	warmth: 10,
	cost: 8000,
	description: "Fashionable and ready to slip into pockets.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	back_img: 0,
	cursed: 0,
	location: 0,
	iconFile: "Long leather gloves.png",
	accIcon: 0,
	mainImage:0,
	leftImage:1,
	rightImage:1
},

	{index: 6,
	name: "pom poms",
	name_cap: "Pom poms",
	variable: "pompoms",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 300,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: ["black", "blue", "brown", "green", "pink", "purple", "red", "pale tangerine", "teal", "pale white", "pale yellow", "custom"],
	colour_sidebar: 1,
	type: ["costume", "athletic"],
	gender: "f",
	femininity: 200,
	warmth: 15,
	cost: 1500,
	description: "For cheering your team to victory.",
	shop: ["clothing", "school"],
	accessory: 1,
	accessory_colour: 0,
	accessory_colour_options: [],
	back_img: 0,
	cursed: 0,
	location: 0,
	iconFile: "Pom poms.png",
	accIcon: 0,
	mainImage:0,
	leftImage:1,
	rightImage:1
},

	{index: 7,
	name: "gold bracelets",
	name_cap: "Gold bracelets",
	variable: "gold",
	integrity: 200,
	integrity_max: 200,
	fabric_strength: 20,
	reveal: 300,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	type: ["costume", "serving"],
	gender: "n",
	femininity: 0,
	warmth: 0,
	cost: 25000,
	description: "Eye-catching and exotic.",
	shop: ["clothing", "cult"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	back_img: 0,
	cursed: 0,
	location: 0,
	iconFile: "Gold bracelets.png",
	accIcon: 0,
	mainImage:0,
	leftImage:1,
	rightImage:1
},

	{index: 8,
	name: "cow sleeves",
	name_cap: "Cow sleeves",
	variable: "cow",
	integrity: 100,
	integrity_max: 100,
	fabric_strength: 20,
	reveal: 100,
	word: "n",
	plural: 1,
	colour: 0,
	colour_options: [],
	type: ["costume"],
	gender: "n",
	warmth: 20,
	cost: 1000,
	description: "Cute cow print.",
	shop: ["forest"],
	accessory: 0,
	accessory_colour: 0,
	accessory_colour_options: [],
	back_img: 0,
	cursed: 0,
	location: 0,
	iconFile: "Cow sleeves.png",
	accIcon: "",
	mainImage:0,
	leftImage:1,
	rightImage:1
}

]>>

<!--
	Clothes that modders add go into this array, this should be empty in the base game at all times.
	These items should have a `modder` variable with a the modders name in a short string
-->
<<set setup.moddedClothes.hands to []>>

<<run setup.moddedClothes.hands.forEach( (x,i) => x.index = setup.clothes.hands.length + i )>>
<<run setup.clothes.hands.push(...setup.moddedClothes.hands)>>
<</widget>>