From 5a6f94e72956b970c4a1eec5959bfe6405974843 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Thu, 18 Feb 2021 22:53:47 -0500
Subject: [PATCH] finish up

---
 src/events/reNickname.js | 39 ++++++++++++++++++++++++++++++++++-----
 1 file changed, 34 insertions(+), 5 deletions(-)

diff --git a/src/events/reNickname.js b/src/events/reNickname.js
index 5e5bb5bd97e..ad1478653a0 100644
--- a/src/events/reNickname.js
+++ b/src/events/reNickname.js
@@ -1,6 +1,6 @@
 App.Events.RENickname = function() {
 	const el = new DocumentFragment();
-	const intro = App.UI.DOM.appendNewElement("p", el);
+	const intro = App.UI.DOM.makeElement("p");
 	let seed;
 	let _nicknameArray = [];
 	let nickname;
@@ -296,6 +296,7 @@ App.Events.RENickname = function() {
 		data();
 
 		App.Events.drawEventArt(el, slave);
+		el.append(intro);
 		intro.append(introPassage());
 
 		const result = App.UI.DOM.appendNewElement("p", el);
@@ -313,7 +314,7 @@ App.Events.RENickname = function() {
 						r.push(`the first time ${he} hears you`);
 					}
 					r.push(` refer to ${him} that way. <span class="hotpink">${He} has become more submissive to you.</span> ${slave.slaveName}${_applyDesc}`);
-					App.Events.addNode(result, r);
+					App.Events.addNode(text, r);
 					jQuery(result).empty().append(text);
 					slave.devotion += 4;
 					slave.slaveName = (nickname + " " + slave.slaveName);
@@ -346,7 +347,13 @@ App.Events.RENickname = function() {
 		}
 		r.push(App.UI.DOM.slaveDescriptionDialog(slave));
 		r.push(`${_situationDesc} You begin to overhear your other slaves refer to ${him} as `);
-		r.push(App.UI.DOM.makeElement("span", `${nickname} ${slave.slaveName}.`, "pink"));
+		if (V.cheatMode) {
+			r.push(App.UI.DOM.makeElement("span", selectNickname(), "pink"));
+			r.push(App.UI.DOM.makeElement("span", `${slave.slaveName}.`, "pink"));
+		} else {
+			r.push(App.UI.DOM.makeElement("span", `${nickname} ${slave.slaveName}.`, "pink"));
+		}
+
 		App.Events.addParagraph(el, r);
 		return el;
 		function selectCategory() {
@@ -373,6 +380,28 @@ App.Events.RENickname = function() {
 			};
 			return el;
 		}
+
+		function selectNickname() {
+			const el = new DocumentFragment();
+			const select = App.UI.DOM.appendNewElement("select", el);
+			let matchFound = false;
+			for (const category of _nicknameArray) {
+				const option = App.UI.DOM.appendNewElement("option", select, category);
+				option.value = category;
+				if (option.value === nickname) {
+					option.selected = true;
+					matchFound = true;
+				}
+			}
+			if (!matchFound) {
+				select.selectedIndex = -1;
+			}
+			select.onchange = () => {
+				const O = select.options[select.selectedIndex];
+				nickname = O.value;
+			};
+			return el;
+		}
 	}
 
 	function data() {
@@ -1022,7 +1051,7 @@ App.Events.RENickname = function() {
 					default:
 						_nicknameArray = ["'Alien'", "'Hobo'", "'Homeless'", "'Immigrant'", "'International'", "'Nomad'", "'Refugee'", "'Stateless'", "'Wanderer'"];
 				}
-				_situationDesc = `is slave.nationality. The slave trade is truly international, and no nation is unrepresented among the masses of sex slaves passed from hand to hand like the chattel they are. Most of the old nations are struggling, and even those still in great shape often find their citizens emigrating to the Free Cities. Some of these émigrés do well, and others become human livestock.`;
+				_situationDesc = `is ${slave.nationality}. The slave trade is truly international, and no nation is unrepresented among the masses of sex slaves passed from hand to hand like the chattel they are. Most of the old nations are struggling, and even those still in great shape often find their citizens emigrating to the Free Cities. Some of these émigrés do well, and others become human livestock.`;
 				_applyDesc = `is a little proud of ${his} national nickname, as a reminder of who ${he} was and a mark that ${he} still has an identity.`;
 				_notApplyDesc = `realizes that ${his} new identity is truly stateless. In the Free Cities, it does not matter where a slave is from, so long as that slave has value. All slaves belong to the singular nation of the owned, the subordinated, the fucked.`;
 
@@ -1288,7 +1317,7 @@ App.Events.RENickname = function() {
 				break;
 			case "Matron":
 				_nicknameArray = ["'Amah'", "'Au Pair'", "'Ayah'", "'Baby Farmer'", "'Babysitter'", "'Caretaker'", "'Childminder'", "'Daycare'", "'Governess'", "'Houseparent'", "'Mama'", "'Matron'", "'Mommy'", "'Mother'", "'Nanny'", "'Nursemaid'", "'Nursery'", "'Orphanotrophos'", "'Pacifier'", "'Stork'", "'Supernanny'"];
-				_situationDesc = `has a very important role in ensuring the children in V.arcologies[0].name grow up to be the perfect slaves for you.`;
+				_situationDesc = `has a very important role in ensuring the children in ${V.arcologies[0].name} grow up to be the perfect slaves for you.`;
 				_applyDesc = `is excited and proud when ${he} learns that ${his} position in your arcology is a part of ${his} name now.`;
 				_notApplyDesc = `is a bit sad that ${his} role isn't part of ${his} name, since ${he} likes taking care of the children and now wonders whether ${he}'ll be allowed to keep doing so.`;
 
-- 
GitLab