TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ Reply()

void Terraria.ModLoader.ChatCommandCaller.Reply ( string text,
Color color = default(Color) )
inline

Use this to respond to the Player that invoked this command. This method handles writing to the console, writing to chat, or sending messages over the network for you depending on the CommandType used. Avoid using Main.NewText, Console.WriteLine, or NetMessage.SendChatMessageToClient directly because the logic would change depending on CommandType.

Parameters
text
color

Implements Terraria.ModLoader.CommandCaller.

Definition at line 11 of file ChatCommandCaller.cs.

12 {
13 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
14 //IL_0003: Unknown result type (might be due to invalid IL or missing references)
15 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
16 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
17 //IL_0016: Unknown result type (might be due to invalid IL or missing references)
18 if (color == default(Color))
19 {
20 color = Color.White;
21 }
22 string[] array = text.Split('\n');
23 for (int i = 0; i < array.Length; i++)
24 {
25 Main.NewText(array[i], ((Color)(ref color)).R, ((Color)(ref color)).G, ((Color)(ref color)).B);
26 }
27 }

References Terraria.Main.NewText().

+ Here is the call graph for this function: