Finish new prefix and suffix system for groups.

Removed admin chat stuff and will now use prefix/suffix's
This commit is contained in:
Zidonuke 2011-12-22 17:41:47 -05:00
parent 8cf298ad85
commit 33d304a4fa
4 changed files with 8 additions and 21 deletions

View file

@ -55,10 +55,10 @@ namespace TShockAPI
public int TileThreshold = 120; public int TileThreshold = 120;
[Description("#.#.#. = Red/Blue/Green - RGB Colors for the Admin Chat Color. Max value: 255")] [Description("#.#.#. = Red/Blue/Green - RGB Colors for the Admin Chat Color. Max value: 255")]
public float[] SuperAdminChatRGB = { 255, 0, 0 }; public float[] SuperAdminChatRGB = { 255, 0, 0 };
[Description("The Chat Prefix before an admin speaks. eg. *The prefix was set to \"(Admin) \", so.. (Admin) : Hi! Note: If you put a space after the prefix, it will look like this: (Admin) <TerrariaDude): Hi!")] [Description("Super admin group chat prefix")]
public string AdminChatPrefix = "(Admin) "; public string SuperAdminChatPrefix = "(Admin) ";
[Description("")] [Description("Super admin group chat suffix")]
public bool AdminChatEnabled = true; public string SuperAdminChatSuffix = "";
[Description("Backup frequency in minutes. So, a value of 60 = 60 minutes. Backups are stored in the \\tshock\\backups folder.")] [Description("Backup frequency in minutes. So, a value of 60 = 60 minutes. Backups are stored in the \\tshock\\backups folder.")]
public int BackupInterval; public int BackupInterval;
[Description("How long backups are kept in minutes. 2880 = 2 days.")] [Description("How long backups are kept in minutes. 2880 = 2 days.")]
@ -132,9 +132,6 @@ namespace TShockAPI
[Description("Buffers up the packets and sends them out at the end of each frame")] [Description("Buffers up the packets and sends them out at the end of each frame")]
public bool BufferPackets = true; public bool BufferPackets = true;
[Description("Display the users group when they chat.")]
public bool ChatDisplayGroup = false;
[Description("String that is used when kicking people when the server is full.")] [Description("String that is used when kicking people when the server is full.")]
public string ServerFullReason = "Server is full"; public string ServerFullReason = "Server is full";

View file

@ -93,6 +93,9 @@ namespace TShockAPI
R = (byte)TShock.Config.SuperAdminChatRGB[0]; R = (byte)TShock.Config.SuperAdminChatRGB[0];
G = (byte)TShock.Config.SuperAdminChatRGB[1]; G = (byte)TShock.Config.SuperAdminChatRGB[1];
B = (byte)TShock.Config.SuperAdminChatRGB[2]; B = (byte)TShock.Config.SuperAdminChatRGB[2];
Prefix = TShock.Config.SuperAdminChatPrefix;
Suffix = TShock.Config.SuperAdminChatSuffix;
} }
public override bool HasPermission(string permission) public override bool HasPermission(string permission)

View file

@ -38,9 +38,6 @@ namespace TShockAPI
[Description("Specific log messages are sent to users with this permission")] [Description("Specific log messages are sent to users with this permission")]
public static readonly string logs; public static readonly string logs;
[Description("User gets the admin prefix/color in chat")]
public static readonly string adminchat;
[Todo] [Todo]
[Description("Not currently working")] [Description("Not currently working")]
public static readonly string reservedslot; public static readonly string reservedslot;

View file

@ -546,15 +546,6 @@ namespace TShockAPI
return; return;
} }
if (tsplr.Group.HasPermission(Permissions.adminchat) && !text.StartsWith("/") && Config.AdminChatEnabled)
{
TShock.Utils.Broadcast(Config.AdminChatPrefix + "<" + tsplr.Name + "> " + text,
tsplr.Group.R, tsplr.Group.G,
tsplr.Group.B);
e.Handled = true;
return;
}
if (text.StartsWith("/")) if (text.StartsWith("/"))
{ {
try try
@ -569,10 +560,9 @@ namespace TShockAPI
} }
else else
{ {
TShock.Utils.Broadcast("{2}<{0}> {1}".SFormat(tsplr.Name, text, Config.ChatDisplayGroup ? "[{0}] ".SFormat(tsplr.Group.Name) : ""), TShock.Utils.Broadcast("{0}{1}{2}: {3}".SFormat(tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix, text),
tsplr.Group.R, tsplr.Group.G, tsplr.Group.R, tsplr.Group.G,
tsplr.Group.B); tsplr.Group.B);
//Log.Info(string.Format("{0} said: {1}", tsplr.Name, text));
e.Handled = true; e.Handled = true;
} }
} }