Fix command hiding, add new chat properties to TorchChatMessage
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Sandbox.Engine.Multiplayer;
|
||||
using Sandbox.Game.Gui;
|
||||
using Sandbox.Game.Multiplayer;
|
||||
using VRage.Game;
|
||||
using VRage.Network;
|
||||
@@ -28,6 +29,8 @@ namespace Torch.API.Managers
|
||||
AuthorSteamId = null;
|
||||
Author = author;
|
||||
Message = message;
|
||||
Channel = ChatChannel.Global;
|
||||
Target = 0;
|
||||
Font = font;
|
||||
}
|
||||
|
||||
@@ -38,12 +41,14 @@ namespace Torch.API.Managers
|
||||
/// <param name="authorSteamId">Author's steam ID</param>
|
||||
/// <param name="message">Message</param>
|
||||
/// <param name="font">Font</param>
|
||||
public TorchChatMessage(string author, ulong authorSteamId, string message, string font = MyFontEnum.Blue)
|
||||
public TorchChatMessage(string author, ulong authorSteamId, string message, ChatChannel channel, long target, string font = MyFontEnum.Blue)
|
||||
{
|
||||
Timestamp = DateTime.Now;
|
||||
AuthorSteamId = authorSteamId;
|
||||
Author = author;
|
||||
Message = message;
|
||||
Channel = channel;
|
||||
Target = target;
|
||||
Font = font;
|
||||
}
|
||||
|
||||
@@ -59,6 +64,8 @@ namespace Torch.API.Managers
|
||||
AuthorSteamId = authorSteamId;
|
||||
Author = MyMultiplayer.Static?.GetMemberName(authorSteamId) ?? "Player";
|
||||
Message = message;
|
||||
Channel = ChatChannel.Global;
|
||||
Target = 0;
|
||||
Font = font;
|
||||
}
|
||||
|
||||
@@ -79,6 +86,14 @@ namespace Torch.API.Managers
|
||||
/// </summary>
|
||||
public readonly string Message;
|
||||
/// <summary>
|
||||
/// The chat channel the message is part of.
|
||||
/// </summary>
|
||||
public readonly ChatChannel Channel;
|
||||
/// <summary>
|
||||
/// The intended recipient of the message.
|
||||
/// </summary>
|
||||
public readonly long Target;
|
||||
/// <summary>
|
||||
/// The font, or null if default.
|
||||
/// </summary>
|
||||
public readonly string Font;
|
||||
|
Reference in New Issue
Block a user