From ec66cf8c464917709cd10365fe98b0fa0a36d91a Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Fri, 16 Apr 2021 21:13:41 -0400
Subject: [PATCH] add pronouns to RA

---
 devTools/types/FC/RA.d.ts       |  1 +
 src/js/DefaultRules.js          |  7 +++++++
 src/js/rulesAssistant.js        |  1 +
 src/js/rulesAssistantOptions.js | 13 +++++++++++++
 4 files changed, 22 insertions(+)

diff --git a/devTools/types/FC/RA.d.ts b/devTools/types/FC/RA.d.ts
index f837d13e769..82fbd9698dd 100644
--- a/devTools/types/FC/RA.d.ts
+++ b/devTools/types/FC/RA.d.ts
@@ -192,6 +192,7 @@ declare namespace FC {
 			hornColor: string;
 			labelTagsClear: boolean;
 			choosesOwnClothes: 0|1;
+			pronoun: number;
 		}
 
 		interface Rule {
diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js
index 844cffd0532..88ce09565e0 100644
--- a/src/js/DefaultRules.js
+++ b/src/js/DefaultRules.js
@@ -98,6 +98,7 @@ globalThis.DefaultRules = (function() {
 		ProcessPornFeedEnabled(slave, rule);
 		ProcessPorn(slave, rule);
 		ProcessLabel(slave, rule);
+		ProcessOther(slave, rule);
 		return r;
 	}
 
@@ -3102,6 +3103,12 @@ globalThis.DefaultRules = (function() {
 		}
 	}
 
+	function ProcessOther(slave, rule) {
+		if (!isNaN(rule.pronoun) && slave.pronoun !== rule.pronoun) {
+			slave.pronoun = rule.pronoun;
+		}
+	}
+
 	return DefaultRules;
 })();
 
diff --git a/src/js/rulesAssistant.js b/src/js/rulesAssistant.js
index e5b20fa7fd3..826982329b3 100644
--- a/src/js/rulesAssistant.js
+++ b/src/js/rulesAssistant.js
@@ -334,6 +334,7 @@ App.RA.newRule = function() {
 			skinColor: null,
 			inflationType: null,
 			labelTagsClear: null,
+			pronoun: null,
 		};
 	}
 
diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js
index ae53c51905a..b284aff0800 100644
--- a/src/js/rulesAssistantOptions.js
+++ b/src/js/rulesAssistantOptions.js
@@ -1801,6 +1801,7 @@ App.RA.options = (function() {
 			this.appendChild(new ClearLabelSwitch());
 			this.appendChild(new LabelList());
 			this.appendChild(new LabelRemoveList());
+			this.appendChild(new PronounList());
 		}
 	}
 
@@ -1812,6 +1813,18 @@ App.RA.options = (function() {
 		}
 	}
 
+	class PronounList extends ListSelector {
+		constructor() {
+			const pairs = [];
+			for (const pronoun in App.Data.Pronouns.Kind) {
+				pairs.push([pronoun, App.Data.Pronouns.Kind[pronoun]]);
+			}
+			super("Pronoun to use", pairs);
+			this.setValue(current_rule.set.pronoun);
+			this.onchange = (value) => current_rule.set.pronoun = value;
+		}
+	}
+
 	class CosmeticTab extends Tab {
 		constructor(tabButtons) {
 			super("cosmetic", "Cosmetic", tabButtons);
-- 
GitLab