From 65cb8c5b511c0e556943e52bb0b7267669c7d417 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Sun, 29 Nov 2020 18:32:40 -0500
Subject: [PATCH] compress name choice

---
 src/events/intro/introSummary.js | 13 +------------
 src/events/intro/pcAppearance.js | 16 ++++++++++++++++
 src/events/intro/pcBodyIntro.js  | 15 +--------------
 3 files changed, 18 insertions(+), 26 deletions(-)

diff --git a/src/events/intro/introSummary.js b/src/events/intro/introSummary.js
index cc7962813c9..8a091bfd4e8 100644
--- a/src/events/intro/introSummary.js
+++ b/src/events/intro/introSummary.js
@@ -616,18 +616,7 @@ App.Intro.summary = function() {
 			options.addOption("You are a", "title", V.PC)
 				.addValue("Masculine Master", 1, () => V.PC.genes = "XY").addValue("Feminine Mistress", 0, () => V.PC.genes = "XX");
 
-			options.addOption(`Everyone calls you <b>${PlayerName()}.</b>`);
-			options.addOption("Your given name is", "slaveName", V.PC).showTextBox();
-
-			if (V.PC.slaveSurname === 0) {
-				option = options.addOption("And no surname", "slaveSurname", V.PC)
-					.addValue("Add a surname", "Anon")
-					.addComment("Surnames cannot be changed during the game outside of special circumstances.");
-			} else {
-				option = options.addOption("And your surname is", "slaveSurname", V.PC).showTextBox()
-					.addValue("Go by a single name", 0)
-					.addComment("Surnames cannot be changed during the game outside of special circumstances.");
-			}
+			App.Intro.PCNames(options);
 
 			V.PC.physicalAge = V.PC.actualAge;
 			V.PC.visualAge = V.PC.actualAge;
diff --git a/src/events/intro/pcAppearance.js b/src/events/intro/pcAppearance.js
index a0a821ec0fd..74f7d86f279 100644
--- a/src/events/intro/pcAppearance.js
+++ b/src/events/intro/pcAppearance.js
@@ -41,3 +41,19 @@ App.Intro.refreshmentChoice = function(options) {
 	}
 	option.addComment(comment);
 };
+
+App.Intro.PCNames = function(options) {
+	let option;
+	options.addOption(`Everyone calls you <b>${PlayerName()}.</b>`);
+	options.addOption("Your given name is", "slaveName", V.PC).showTextBox();
+
+	if (V.PC.slaveSurname === 0) {
+		option = options.addOption("And no surname", "slaveSurname", V.PC)
+			.addValue("Add a surname", "Anon")
+			.addComment("Surnames cannot be changed during the game outside of special circumstances.");
+	} else {
+		option = options.addOption("And your surname is", "slaveSurname", V.PC).showTextBox()
+			.addValue("Go by a single name", 0)
+			.addComment("Surnames cannot be changed during the game outside of special circumstances.");
+	}
+};
diff --git a/src/events/intro/pcBodyIntro.js b/src/events/intro/pcBodyIntro.js
index 3037e70ebac..9be66507771 100644
--- a/src/events/intro/pcBodyIntro.js
+++ b/src/events/intro/pcBodyIntro.js
@@ -150,20 +150,7 @@ App.Intro.PCBodyIntro = function() {
 
 		App.UI.DOM.appendNewElement("div", el, `What is your name and alternate indulgence?`, ["intro", "question"]);
 
-		options.addOption(`Name your character: `, "slaveName", V.PC).showTextBox().addComment(`As with all text boxes in FC, press the enter key to commit your changes.`);
-		options.addOption(`Surname: `, "slaveSurname", V.PC).showTextBox().addComment("Optional");
-
-		if (V.PC.slaveSurname) {
-			options.addOption("Go by a single name")
-				.customButton(
-					"Apply",
-					() => {
-						V.PC.slaveSurname = 0;
-						V.PC.birthSurname = "";
-					},
-					"PC Body Intro"
-				);
-		}
+		App.Intro.PCNames(options);
 		App.Intro.refreshmentChoice(options);
 
 		el.append(options.render());
-- 
GitLab