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) {
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;
CoreLine(p, fullName, who.name, who.group, who.TotalMessagesSent);
}

View File

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