From f9d0b0a8c1de73dd0c43efddd27746948c33c72b Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Tue, 16 Feb 2021 02:39:32 -0500
Subject: [PATCH] move slave summary to the same data

---
 js/003-data/slaveSummaryData.js  | 14 ---------
 src/js/slaveSummaryWidgets.js    |  5 +---
 src/npc/infants/infantSummary.js | 50 +-------------------------------
 3 files changed, 2 insertions(+), 67 deletions(-)

diff --git a/js/003-data/slaveSummaryData.js b/js/003-data/slaveSummaryData.js
index 101f6c44f96..61dc7a1bf53 100644
--- a/js/003-data/slaveSummaryData.js
+++ b/js/003-data/slaveSummaryData.js
@@ -502,20 +502,6 @@ App.Data.SlaveSummary = {
 			7: "Milk Based with Cum.",
 			8: "Cum and Milk Based."
 		},
-		race: {
-			"white": "Caucasian",
-			"asian": "Asian",
-			"indo-aryan": "Indo-aryan",
-			"latina": "Latina",
-			"middle eastern": "Middle Eastern",
-			"black": "Black",
-			"pacific islander": "Pacific Islander",
-			"malay": "Malay",
-			"amerindian": "Amerindian",
-			"semitic": "Semitic",
-			"southern european": "Southern European",
-			"mixed race": "Mixed race",
-		},
 		hormoneBalance: { // rating is hormoneBalance value + 500
 			100: "Overwhelmingly masculine",
 			200: "Extremely masculine",
diff --git a/src/js/slaveSummaryWidgets.js b/src/js/slaveSummaryWidgets.js
index 80c2ef83d6e..5d3b69f6b7c 100644
--- a/src/js/slaveSummaryWidgets.js
+++ b/src/js/slaveSummaryWidgets.js
@@ -708,10 +708,7 @@ App.UI.SlaveSummaryRenderers = function() {
 		 * @returns {void}
 		 */
 		race: function(slave, c) {
-			let raceStr = App.Data.SlaveSummary.long.race[slave.race];
-			if (!raceStr) {
-				raceStr = capFirstChar(slave.race);
-			}
+			const raceStr = App.Data.misc.filterRaces.get(slave.race) || capFirstChar(slave.race);
 			helpers.makeSpan(c, raceStr + '.', "tan");
 		},
 
diff --git a/src/npc/infants/infantSummary.js b/src/npc/infants/infantSummary.js
index 5d8ca172322..1f56f377878 100644
--- a/src/npc/infants/infantSummary.js
+++ b/src/npc/infants/infantSummary.js
@@ -108,7 +108,7 @@ App.Facilities.Nursery.InfantSummary = function(child) {
 			if (abbreviate.race === 1) {
 				r += shortRace();
 			} else if (abbreviate.race === 2) {
-				r += longRace();
+				r += App.Data.misc.filterRaces.get(child.race) || `${child.race.charAt(0).toUpperCase() + child.race.slice(1)}. `;
 			}
 			r += `</span> `;
 		}
@@ -303,54 +303,6 @@ App.Facilities.Nursery.InfantSummary = function(child) {
 		return r;
 	}
 
-	function longRace() {
-		let r = ``;
-
-		switch (child.race) {
-			case "white":
-				r += `Caucasian. `;
-				break;
-			case "asian":
-				r += `Asian. `;
-				break;
-			case "indo-aryan":
-				r += `Indo-aryan. `;
-				break;
-			case "latina":
-				r += `Latina. `;
-				break;
-			case "middle eastern":
-				r += `Middle Eastern. `;
-				break;
-			case "black":
-				r += `Black. `;
-				break;
-			case "pacific islander":
-				r += `Pacific Islander. `;
-				break;
-			case "malay":
-				r += `Malay. `;
-				break;
-			case "amerindian":
-				r += `Amerindian. `;
-				break;
-			case "semitic":
-				r += `Semitic. `;
-				break;
-			case "southern european":
-				r += `Southern European. `;
-				break;
-			case "mixed race":
-				r += `Mixed race. `;
-				break;
-			default:
-				r += `${child.race.charAt(0).toUpperCase() + child.race.slice(1)}. `;
-				break;
-		}
-
-		return r;
-	}
-
 	function shortNationality() {
 		let r = `<span class="tan">`;
 
-- 
GitLab