Added AdminChatPrefix configuration option.

Added AdminChatRGB configuration option.
Tweaked how broadcast works, now clamps RGB values to prevent overflows.
Added a new permission, "adminchat," that defines who is affected by the AdminChatPrefix and the new AdminChatRGB (which is a rgb color spectrum for the chat color of admin's text).
Closes #72
This commit is contained in:
Shank 2011-06-14 02:56:04 -06:00
parent 49ca8fcd1a
commit 6411e71cee
4 changed files with 25 additions and 1 deletions

View file

@ -52,6 +52,8 @@ namespace TShockAPI
public static int maxSlots = 8;
public static bool spamChecks = false;
public static bool disableBuild = false;
public static float[] adminChatRGB = {255, 0, 0};
public static string adminChatPrefix = "(Admin) ";
public enum NPCList
{
@ -90,6 +92,8 @@ namespace TShockAPI
disableBuild = cfg.DisableBuild;
NPC.maxSpawns = defaultMaxSpawns;
NPC.defaultSpawnRate = defaultSpawnRate;
adminChatRGB = cfg.AdminChatRGB;
adminChatPrefix = cfg.AdminChatPrefix;
}
public static void WriteJsonConfiguration()
@ -121,6 +125,8 @@ namespace TShockAPI
cfg.RangeChecks = rangeChecks;
cfg.SpamChecks = spamChecks;
cfg.DisableBuild = disableBuild;
cfg.AdminChatRGB = adminChatRGB;
cfg.AdminChatPrefix = adminChatPrefix;
string json = JsonConvert.SerializeObject(cfg, Formatting.Indented);
TextWriter tr = new StreamWriter(FileTools.SaveDir + "config.json");
tr.Write(json);