Exemple #1
0
 /// <summary>
 /// Message payload sent to subscribers when a game message has been received.
 /// </summary>
 /// <param name="player">Id of player in respect to Main.Player[i], where i is the index of the player.</param>
 /// <param name="color">Color to display the text.</param>
 ///
 /// <param name="msg">Text content of the message</param>
 public TerrariaChatEventArgs(TCRPlayer player, TCRColor color, string msg)
 {
     Player  = player;
     Color   = color;
     Message = msg;
 }
Exemple #2
0
 /// <summary>
 /// Emits a message to all subscribers that a game message has been received.
 /// </summary>
 /// <param name="sender">Object that is emitting this event.</param>
 /// <param name="playerId">Id of player in respect to Main.Player[i], where i is the index of the player.</param>
 /// <param name="color">Color to display the text.</param>
 /// <param name="msg">Text content of the message</param>
 public static void RaiseTerrariaMessageReceived(object sender, TCRPlayer player, TCRColor color, string msg)
 => OnGameMessageReceived?.Invoke(sender, new TerrariaChatEventArgs(player, color, msg));