mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -04:00
Make default pronouns distinct from they/them
This allows plugins to determine if a user has intentionally set them or not
This commit is contained in:
parent
02b48ec827
commit
82ac48db61
@ -27,7 +27,7 @@ namespace MCGalaxy.Commands.Chatting {
|
|||||||
if (pro == null) { HelpList(p); return; }
|
if (pro == null) { HelpList(p); return; }
|
||||||
|
|
||||||
p.pronouns = pro;
|
p.pronouns = pro;
|
||||||
p.Message("Your pronouns were changed to: &H{0}", pro.Name);
|
p.Message("Your pronouns were changed to: &T{0}", pro.Name);
|
||||||
pro.SaveFor(p);
|
pro.SaveFor(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,11 +43,11 @@ namespace MCGalaxy {
|
|||||||
Directory.CreateDirectory(PLAYER_PATH);
|
Directory.CreateDirectory(PLAYER_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
Default = new Pronouns("they/them", "they", "their", "themselves", true);
|
Default = new Pronouns("default", "they", "their", "themselves", true);
|
||||||
|
|
||||||
if (!File.Exists(CONFIG_FILE)) {
|
if (!File.Exists(CONFIG_FILE)) {
|
||||||
|
|
||||||
Loaded.Add(Default);
|
Loaded.Add(new Pronouns("they/them", "they", "their", "themselves", true));
|
||||||
Loaded.Add(new Pronouns("he/him", "he", "his", "himself", false));
|
Loaded.Add(new Pronouns("he/him", "he", "his", "himself", false));
|
||||||
Loaded.Add(new Pronouns("she/her", "she", "her", "herself", false));
|
Loaded.Add(new Pronouns("she/her", "she", "her", "herself", false));
|
||||||
|
|
||||||
@ -70,6 +70,8 @@ namespace MCGalaxy {
|
|||||||
static void OnConfigUpdated() {
|
static void OnConfigUpdated() {
|
||||||
lock (locker) {
|
lock (locker) {
|
||||||
Loaded.Clear();
|
Loaded.Clear();
|
||||||
|
Loaded.Add(Default);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
using (StreamReader r = new StreamReader(CONFIG_FILE)) {
|
using (StreamReader r = new StreamReader(CONFIG_FILE)) {
|
||||||
while (!r.EndOfStream) {
|
while (!r.EndOfStream) {
|
||||||
@ -81,11 +83,6 @@ namespace MCGalaxy {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.LogError(e);
|
Logger.LogError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure the default is always in the loaded set (so it is visible/useable in user-side listings)
|
|
||||||
if (FindExact(Default.Name) == null) {
|
|
||||||
Loaded.Add(Default);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//In case any were deleted or changed
|
//In case any were deleted or changed
|
||||||
@ -104,10 +101,13 @@ namespace MCGalaxy {
|
|||||||
if (words[4].CaselessEq("singular")) { plural = false; }
|
if (words[4].CaselessEq("singular")) { plural = false; }
|
||||||
else if (words[4].CaselessEq("plural")) { plural = true; }
|
else if (words[4].CaselessEq("plural")) { plural = true; }
|
||||||
else {
|
else {
|
||||||
Logger.Log(LogType.Warning, "Failed to load the pronoun \"{0}\" because the 5th argument was not \"singular\" or \"plural\"", words[0]);
|
Logger.Log(LogType.Warning, "Failed to load the pronouns \"{0}\" because the 5th argument was not \"singular\" or \"plural\"", words[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (FindExact(words[0]) != null) {
|
||||||
|
Logger.Log(LogType.Warning, "Cannot load pronouns \"{0}\" because it is already defined.", words[0]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Loaded.Add(new Pronouns(words[0], words[1], words[2], words[3], plural));
|
Loaded.Add(new Pronouns(words[0], words[1], words[2], words[3], plural));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user