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:
parent
49ca8fcd1a
commit
6411e71cee
4 changed files with 25 additions and 1 deletions
|
|
@ -105,7 +105,16 @@ namespace TShockAPI
|
|||
{
|
||||
for (int i = 0; i < Main.player.Length; i++)
|
||||
{
|
||||
SendMessage(i, msg, red, green, blue);
|
||||
SendMessage(i, msg, Tools.Clamp(red, 255, 0), Tools.Clamp(green, 255, 0), Tools.Clamp(blue, 255, 0));
|
||||
}
|
||||
Log.Info(string.Format("Broadcast: {0}", msg));
|
||||
}
|
||||
|
||||
public static void Broadcast(string msg, float[] colors)
|
||||
{
|
||||
for (int i = 0; i < Main.player.Length; i++)
|
||||
{
|
||||
SendMessage(i, msg, Tools.Clamp(colors[0], 255, 0), Tools.Clamp(colors[1], 255, 0), Tools.Clamp(colors[2], 255, 0));
|
||||
}
|
||||
Log.Info(string.Format("Broadcast: {0}", msg));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue