From ba23847dded4fb026a97bffec6f8c9a461540ebd Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Fri, 25 Dec 2020 10:15:48 -0500
Subject: [PATCH] Move long plugs onto their own row in wardrobe; twaks

---
 js/003-data/slaveWearData.js    |  2 +-
 src/interaction/siWardrobe.js   | 17 ++++++++++-------
 src/js/itemAvailability.js      |  2 +-
 src/js/rulesAssistantOptions.js |  4 ++--
 4 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/js/003-data/slaveWearData.js b/js/003-data/slaveWearData.js
index d08af84c883..acce98a8329 100644
--- a/js/003-data/slaveWearData.js
+++ b/js/003-data/slaveWearData.js
@@ -1249,7 +1249,7 @@ App.Data.buttplugs = new Map([
 		{
 			name: "Huge plug",
 			width: 3,
-			length: 2
+			length: 1
 		}
 	],
 	["long, huge plug",
diff --git a/src/interaction/siWardrobe.js b/src/interaction/siWardrobe.js
index 5d4f914ce1e..6db2efd28da 100644
--- a/src/interaction/siWardrobe.js
+++ b/src/interaction/siWardrobe.js
@@ -492,9 +492,10 @@ App.UI.SlaveInteract.wardrobe = function(slave) {
 		}
 		el.appendChild(label);
 
-		let optionsArray = [];
+		let normalArray = [];
+		let longArray = [];
 
-		for (const [key, object] of App.Data.slaveWear.buttplugs) {
+		for (const [key, object] of App.Data.buttplugs) {
 			if (key === "none") {
 				// skip none in set, we set the link elsewhere.
 				continue;
@@ -504,17 +505,19 @@ App.UI.SlaveInteract.wardrobe = function(slave) {
 				updateSlave: {buttplug: key},
 				FS: object.fs,
 			};
-			optionsArray.push(reshapedItem);
+			if (object.length > 1) {
+				longArray.push(reshapedItem);
+			} else {
+				normalArray.push(reshapedItem);
+			}
 		}
 
 		// 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(generateRows(optionsArray, "buttplug", true));
-		el.appendChild(links);
+		App.UI.DOM.appendNewElement("div", el, generateRows(normalArray, "buttplug", true), "choices");
+		App.UI.DOM.appendNewElement("div", el, generateRows(longArray, "buttplug", true), "choices");
 
 		return el;
 	}
diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js
index c5a1940e325..3721d2bf853 100644
--- a/src/js/itemAvailability.js
+++ b/src/js/itemAvailability.js
@@ -28,7 +28,7 @@ globalThis.isItemAccessible = (function() {
 				selectedDB = App.Data.slaveWear.bellyAccessories;
 				break;
 			case "buttplug":
-				selectedDB = App.Data.slaveWear.buttplugs;
+				selectedDB = App.Data.buttplugs;
 				break;
 			case "buttplugAttachment":
 				selectedDB = App.Data.slaveWear.buttplugAttachments;
diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js
index 7bf0077d522..294b86564f3 100644
--- a/src/js/rulesAssistantOptions.js
+++ b/src/js/rulesAssistantOptions.js
@@ -2000,7 +2000,7 @@ App.RA.options = (function() {
 
 	class ButtplugsVirginsList extends ListSelector {
 		constructor() {
-			super("Buttplugs for anal virgins", isItemAccessible.array(App.Data.slaveWear.buttplugs));
+			super("Buttplugs for anal virgins", isItemAccessible.array(App.Data.buttplugs));
 			this.setValue(current_rule.set.aVirginButtplug);
 			this.onchange = (value) => current_rule.set.aVirginButtplug = value;
 		}
@@ -2008,7 +2008,7 @@ App.RA.options = (function() {
 
 	class ButtplugsOtherList extends ListSelector {
 		constructor() {
-			super("Buttplugs for other slaves", isItemAccessible.array(App.Data.slaveWear.buttplugs));
+			super("Buttplugs for other slaves", isItemAccessible.array(App.Data.buttplugs));
 			this.setValue(current_rule.set.buttplug);
 			this.onchange = (value) => current_rule.set.buttplug = value;
 		}
-- 
GitLab