Skip to content

Commit

Permalink
Display pronouns in /whois, if selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Goodlyay committed Apr 7, 2024
1 parent 1bf0f7a commit 225c17f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions MCGalaxy/Database/Stats/OnlineStat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public static void CoreLine(Player p, Player who) {
internal static void CommonCoreLine(Player p, string fullName, string name, Group grp, int messages) {
p.Message("{0} &S({1}) has:", fullName, name);
p.Message(" Rank of {0}&S, wrote &a{1} &Smessages", grp.ColoredName, messages);

Pronouns pro = Pronouns.GetFor(name);
if (pro == Pronouns.Default) { return; }
p.Message(" Pronouns: &a{0}", pro.Name);
}

public static void MiscLine(Player p, string name, int deaths, int money) {
Expand Down
3 changes: 1 addition & 2 deletions MCGalaxy/Player/Pronouns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class Pronouns {
/// <summary>
/// Called once to initialize the defaults and write/read the config file as necessary.
/// </summary>
/// <param name="task"></param>
public static void Init(SchedulerTask task) {

if (!Directory.Exists(PLAYER_PATH)) {
Expand Down Expand Up @@ -221,7 +220,7 @@ public void SaveFor(Player p) {
string path = PlayerPath(p.name);
try {
//Reduce clutter by simply erasing the file if it's default
if (this.Name == Default.Name) { File.Delete(path); return; }
if (this == Default) { File.Delete(path); return; }

File.WriteAllText(path, Name);
} catch (Exception e) {
Expand Down

0 comments on commit 225c17f

Please sign in to comment.