-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtChat.cs
30 lines (27 loc) · 800 Bytes
/
tChat.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Chat;
using Terraria.Localization;
using static Viberaria.ViberariaConfig;
namespace Viberaria;
public static class tChat
{
private static NetworkText LiteralText(string msg)
{
return NetworkText.FromLiteral(msg);
}
public static void LogToPlayer(string msg, Color color)
{
if (!Main.dedServ)
{
if (Instance.DebugChatMessages)
{
string time = DateTime.Now.Minute + ":" +
(DateTime.Now.Second + DateTime.Now.Millisecond * 0.001f).ToString("0.00");
msg = time + "| " + msg;
}
ChatHelper.SendChatMessageToClient(LiteralText(msg), color, Main.myPlayer);
}
}
}