cleanup SetPrefix

This commit is contained in:
UnknownShadow200 2018-07-10 18:03:09 +10:00
parent 342584335a
commit 6fcbf97f0b
2 changed files with 8 additions and 6 deletions

View File

@ -44,7 +44,7 @@ namespace MCGalaxy.DB {
}; };
static void OnlineCoreLine(Player p, Player who) { static void OnlineCoreLine(Player p, Player who) {
string prefix = who.title.Length == 0 ? "" : who.color + "[" + who.titlecolor + who.title + who.color + "] "; string prefix = who.title.Length == 0 ? "" : who.MakeTitle(who.title, who.titlecolor);
string fullName = prefix + who.ColoredName; string fullName = prefix + who.ColoredName;
CoreLine(p, fullName, who.name, who.group, who.TotalMessagesSent); CoreLine(p, fullName, who.name, who.group, who.TotalMessagesSent);
} }

View File

@ -129,11 +129,13 @@ namespace MCGalaxy {
bool isMod = Server.Mods.CaselessContains(truename); bool isMod = Server.Mods.CaselessContains(truename);
bool devPrefix = ServerConfig.SoftwareStaffPrefixes; bool devPrefix = ServerConfig.SoftwareStaffPrefixes;
string viptitle = if (devPrefix && isMod) prefix += MakeTitle("Info", "&a");
(devPrefix && isMod) ? string.Format("{0}[&aInfo{0}] ", color) : if (devPrefix && isDev) prefix += MakeTitle("Dev", "&9");
(devPrefix && isDev) ? string.Format("{0}[&9Dev{0}] ", color) : ""; if (title.Length > 0) prefix += MakeTitle(title, titlecolor);
prefix += viptitle; }
prefix = (title.Length == 0) ? prefix : prefix + color + "[" + titlecolor + title + color + "] ";
internal string MakeTitle(string title, string titleCol) {
return color + "[" + titleCol + title + color + "] ";
} }
public bool CheckIfInsideBlock() { public bool CheckIfInsideBlock() {