From 242895eb51e647e07a71b3376c79e71c20fc3d8c Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Sun, 20 Dec 2020 23:38:11 -0500
Subject: [PATCH] finish clothing

---
 src/interaction/siWardrobe.js | 90 ++++++++++++++++++++++-------------
 1 file changed, 57 insertions(+), 33 deletions(-)

diff --git a/src/interaction/siWardrobe.js b/src/interaction/siWardrobe.js
index 88ac8a7d09c..92d3f9baa05 100644
--- a/src/interaction/siWardrobe.js
+++ b/src/interaction/siWardrobe.js
@@ -64,6 +64,35 @@ App.UI.SlaveInteract.wardrobe = function(slave) {
 		function filtersDOM() {
 			const el = new DocumentFragment();
 			el.append("Filter clothing: ");
+
+			const niceFilters = new Map([
+				[false, "Nice"],
+				[true, "Harsh"],
+			]);
+			let linkArray = [];
+			for (const [bool, string] of niceFilters) {
+				if (filters.harsh === bool) {
+					linkArray.push(
+						App.UI.DOM.disabledLink(
+							string,
+							["Currently selected"]
+						)
+					);
+				} else {
+					linkArray.push(
+						App.UI.DOM.link(
+							string,
+							() => {
+								filters.harsh = bool;
+								refresh();
+							}
+						)
+					);
+				}
+			}
+			App.UI.DOM.appendNewElement("span", el, App.UI.DOM.generateLinksStrip(linkArray));
+
+			el.append(" / ");
 			const exposureFilters = new Map([
 				[0, "Modest"],
 				[1, "Normal"],
@@ -71,44 +100,35 @@ App.UI.SlaveInteract.wardrobe = function(slave) {
 				[3, "Humiliating"],
 				[4, "Practically nude"],
 			]);
-			let linkArray = [];
-			for (const [num, string] of exposureFilters) {
-				linkArray.push(
-					App.UI.DOM.link(
-						string,
-						() => {
-							filters.exposure = num;
-							jQuery("#clothing-selection").empty().append(clothingSelection());
-						}
-					)
-				);
-			}
-			App.UI.DOM.appendNewElement("div", el, App.UI.DOM.generateLinksStrip(linkArray));
-
-			const niceFilters = new Map([
-				[false, "Nice"],
-				[true, "Harsh"],
-			]);
 			linkArray = [];
-			for (const [bool, string] of niceFilters) {
-				linkArray.push(
-					App.UI.DOM.link(
-						string,
-						() => {
-							filters.harsh = bool;
-							jQuery("#clothing-selection").empty().append(clothingSelection());
-						}
-					)
-				);
+			for (const [num, string] of exposureFilters) {
+				if (filters.exposure === num) {
+					linkArray.push(
+						App.UI.DOM.disabledLink(
+							string,
+							["Currently selected"]
+						)
+					);
+				} else {
+					linkArray.push(
+						App.UI.DOM.link(
+							string,
+							() => {
+								filters.exposure = num;
+								refresh();
+							}
+						)
+					);
+				}
 			}
-			App.UI.DOM.appendNewElement("div", el, App.UI.DOM.generateLinksStrip(linkArray));
+			App.UI.DOM.appendNewElement("span", el, App.UI.DOM.generateLinksStrip(linkArray));
+			el.append(" / ");
 
-			App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link(
+			App.UI.DOM.appendNewElement("span", el, App.UI.DOM.link(
 				"Reset Filters",
 				() => {
 					filters = {};
-					jQuery("#filters").empty().append(filtersDOM());
-					jQuery("#clothing-selection").empty().append(clothingSelection());
+					refresh();
 				}
 			)); // clear filters
 			return el;
@@ -140,7 +160,7 @@ App.UI.SlaveInteract.wardrobe = function(slave) {
 			// Sort
 			array = array.sort((a, b) => (a.text > b.text) ? 1 : -1);
 			if (array.length > 0) {
-				el.append("Clothing options: ");
+				el.append("Choose clothing: ");
 				el.appendChild(generateRows(array, "clothes", true));
 			} else {
 				el.append("Clothing options: ");
@@ -148,6 +168,10 @@ App.UI.SlaveInteract.wardrobe = function(slave) {
 			}
 			return el;
 		}
+		function refresh() {
+			jQuery("#filters").empty().append(filtersDOM());
+			jQuery("#clothing-selection").empty().append(clothingSelection());
+		}
 	}
 
 	function collar() {
-- 
GitLab