:: wardrobe[menu]
	<<debug>>
		<pre>
		<<=JSON.stringify($wardrobe,null,'\t') >>
		</pre>
	<</debug>>
	<<ret>>
	<<set _actionBarOverride = 1>>

	<h2>Wardrobe</h2>
	<h3>Currently Wearing</h3>
		<div id="wardrobeWornItems">
			<div class="doubleLinkedImage clothes">
				<<image `setup.func('$pc.body_image','clothes')`>>
				<<actCLA "Show All">><<gt  'wardrobe_type_overview' 'clothes'>><</actCLA>>
				<<if $wardrobe.isWeargingItemAtSlot('clothes')>>
					<<actCLA "Strip">>
						<<run $wardrobe.strip('clothes')>>
						<<gt  'wardrobe'>>
					<</actCLA>>
				<</if>>
			</div>

			<div class="doubleLinkedImage shoes">
				<<image `setup.func('$pc.body_image','shoes')`>>
				<<actCLA "Show All">><<gt  'wardrobe_type_overview'  'shoes'>><</actCLA>>
				<<if $wardrobe.isWeargingItemAtSlot('shoes')>>
					<<actCLA "Strip">>
						<<run $wardrobe.strip('shoes')>>
						<<gt  'wardrobe'>>
					<</actCLA>>
				<</if>>
			</div>

		<<if getvar("$underwear['type']") == 0>>
			<div class="doubleLinkedImage bra">
				<<image `setup.func('$pc.body_image','bra')`>>
				<<actCLA "Show All">><<gt  'wardrobe_type_overview' 'underwear'  'bra'>><</actCLA>>
				<<if $wardrobe.isWeargingItemAtSlot('bra')>>
					<<actCLA "Strip">>
						<<run $wardrobe.strip('bra')>>
						<<gt  'wardrobe'>>
					<</actCLA>>
				<</if>>
			</div>
			<div class="doubleLinkedImage panties">
				<<image `setup.func('$pc.body_image','panties')`>>
				<<actCLA "Show All">><<gt  'wardrobe_type_overview' 'underwear'  'panties'>><</actCLA>>
				<<if $wardrobe.isWeargingItemAtSlot('panties')>>
					<<actCLA "Strip">>
						<<run $wardrobe.strip('panties')>>
						<<gt  'wardrobe'>>
					<</actCLA>>
				<</if>>
			</div>
		<<else>>
			<div class="doubleLinkedImage bodysuit">
				<<image `setup.func('$pc.body_image','bodysuit')`>>
				<<actCLA "Show All">><<gt  'wardrobe_type_overview' 'underwear'  'full'>><</actCLA>>
			</div>
		<</if>>

		<div class="doubleLinkedImage coat">
			<<image `setup.func('$pc.body_image','coat')`>>
			<<actCLA "Show All">><<gt  'wardrobe_type_overview' 'coat' 'full'>><</actCLA>>
			<<if $wardrobe.isWeargingItemAtSlot('coat')>>
				<<actCLA "Strip">>
					<<run $wardrobe.strip('coat')>>
					<<gt  'wardrobe'>>
				<</actCLA>>
			<</if>>
		</div>

		<<if $wardrobe.purseEquipped>>
			<div class="doubleLinkedImage purse">
				<<image $wardrobe.itemImageAtSlot('purse')>>
				<<actCLA "Show All">><<gt 'wardrobe_type_overview' 'purse' 'full'>><</actCLA>>
			</div>
		<<else>>
			<div class="emptySlot">
				<<link "Purse">><<gt 'wardrobe_type_overview' 'purse' 'full'>><</link>>
				<span class="label">Purse</span>
			</div>
		<</if>>
		</div>

	<div class="button">
	<<link 'Strip all clothing'>>
		<<run $wardrobe.strip('bra')>>
		<<run $wardrobe.strip('clothes')>>
		<<run $wardrobe.strip('panties')>>
		<<run $wardrobe.strip('shoes')>>
		<<gt 'wardrobe'>>
	<</link>>
	</div>

	<h3>Outfit Sets</h3>
	<div>
		<<for _outfitKey, _outfitData range $wardrobe.outfits>>
			<<capture _outfitKey>>
			<div class="outfitSet">
				<<set _wearable_clothes = $wardrobe.wearable(_outfitData.clothes)>>
				<<set _wearable_shoes = $wardrobe.wearable(_outfitData.shoes)>>
				<<set _wearable_bra = $wardrobe.wearable(_outfitData.bra)>>
				<<set _wearable_panties = $wardrobe.wearable(_outfitData.panties)>>
				<<set _wearable = $wardrobe.outfitIsWearable(_outfitKey)>>
				
				<h4 class="label">
					_outfitKey
				</h4>
				<div class="button buttonWear">
					<<if _wearable == true>>
						<<actCLA 'Wear' 1>>
							<<run $wardrobe.wearOutfit(_outfitKey)>>
							<<addtime 5>>
							<<video "pc/activities/misc/dress_1.mp4">>
							<<act 'Continue' -1>>
								<<gt 'wardrobe'>>
							<</act>>
						<</actCLA>>
					<<else>>
						<<textWithTooltip _outfitKey>>
							At least one part of this set is not wearable.
						<</textWithTooltip>>
					<</if>>
				</div>
				<div class="button buttonManage">
					<<link 'Manage'>>
						<<toggleclass `'#outfitManagement_'+_outfitKey` "visible">>
					<</link>>
				</div>

				<div class="itemPreview clothes">
					<<if _wearable_clothes.owned == false>>
						<div class="notOwnedOverlay"></div>
						<<imageWithTooltip `$wardrobe.itemImage(_outfitData.clothes)`>>
							You no longer have this in your possession.
						<</imageWithTooltip>>
					<<elseif _wearable_clothes.health == false>>
						<div class="destroyedOverlay"></div>
						<<imageWithTooltip `$wardrobe.itemImage(_outfitData.clothes)`>>
							This outfit is completely worn-out. You don't want to wear it.
						<</imageWithTooltip>>
					<<elseif _wearable_clothes.hips == false>>
						<div class="destroyedOverlay"></div>
						<<imageWithTooltip `$wardrobe.itemImage(_outfitData.clothes)`>>
							This outfit doesn't fit you.
						<</imageWithTooltip>>
					<<elseif _wearable_clothes.inhibition == false>>
						<div class="insufficientInhibitionOverlay"></div>
						<<imageWithTooltip `$wardrobe.itemImage(_outfitData.clothes)`>>
							This outfit is too revealing for your taste.
						<</imageWithTooltip>>
					<<else>>
						<<image `$wardrobe.itemImage(_outfitData.clothes)`>>
					<</if>>
				</div>
				<div class="itemPreview shoes">
					<<if _wearable_shoes.owned == false>>
						<div class="notOwnedOverlay"></div>
						<<imageWithTooltip `$wardrobe.itemImage(_outfitData.shoes)`>>
							You no longer have this in your possession.
						<</imageWithTooltip>>
					<<else>>
						<<image `$wardrobe.itemImage(_outfitData.shoes)`>>
					<</if>>
				</div>
				<div class="itemPreview bra">
					<<if _wearable_bra.owned == false>>
						<div class="notOwnedOverlay"></div>
						<<imageWithTooltip `$wardrobe.itemImage(_outfitData.bra)`>>
							You no longer have this in your possession.
						<</imageWithTooltip>>
					<<else>>
						<<image `$wardrobe.itemImage(_outfitData.bra)`>>
					<</if>>
				</div>
				<div class="itemPreview panties">
					<<if _wearable_panties.owned == false>>
						<div class="notOwnedOverlay"></div>
						<<imageWithTooltip `$wardrobe.itemImage(_outfitData.panties)`>>
							You no longer have this in your possession.
						<</imageWithTooltip>>
					<<else>>
						<<image `$wardrobe.itemImage(_outfitData.panties)`>>
					<</if>>
				</div>

				<label class="sportsOutfitRadio buttonRadio">
					<<radiobutton "$wardrobe.outfitSports" _outfitKey autocheck>>
					<span>Sport</span>
				</label>
				<label class="schoolOutfitRadio buttonRadio">
					<<radiobutton "$wardrobe.outfitSchool" _outfitKey autocheck>>
					<span>School</span>
				</label>

				<div @id='"outfitManagement_"+_outfitKey' class="outfitManagement">
					<label class="sportsOutfitRadio buttonRadio">
						<<radiobutton "$wardrobe.outfitSports" _outfitKey autocheck>>
						<span>Sport</span>
					</label>
					<span class="description">Mark this as your default outfit for doing sports.</span>
					<label class="schoolOutfitRadio buttonRadio">
						<<radiobutton "$wardrobe.outfitSchool" _outfitKey autocheck>>
						<span>School</span>
					</label>
					<span class="description">Mark this as your default outfit for going to school.</span>

					<div class="overwriteOption button">
						<<link 'Overwrite'>>
							<<run $wardrobe.outfitAdd(_outfitKey)>>
							<<gt 'wardrobe'>>
						<</link>>
					</div>
					<span class="description">Overwrite the outfit with what you are currently wearing.</span>
					<div class="deleteOption button">
						<<linkreplace 'Delete'>>
							<<link "Confirm">>
								<<run $wardrobe.deleteOutfit(_outfitKey)>>
								<<gt 'wardrobe'>>
							<</link>>
						<</linkreplace>>
					</div>
					<span class="description">Deletes this outfit. The clothes remain in your wardrobe.</span>
				</div>
			</div>
			<</capture>>
		<</for>>
		<div id="addOutfitField">
			<h4>Add outfit</h4>
			<span class="description">Add what you are currently wearing as a new outfit. If you type in an existing name, the existing outfit will be replaced instead.<br/>Name: </span>
			<<textbox "_newOutfitName" "OutfitSetName">>
			<div class="button">
				<<link "Save">>
					<<run $wardrobe.outfitAdd(_newOutfitName)>>
					<<gt 'wardrobe'>>
				<</link>>
			</div>
		</div>
	</div>
