PalacePal/Pal.Client/DependencyInjection/Chat.cs

39 lines
1009 B
C#
Raw Normal View History

2023-02-10 19:48:14 +00:00
using Dalamud.Game.Gui;
2023-02-16 09:46:19 +00:00
using Dalamud.Game.Text;
using Dalamud.Game.Text.SeStringHandling;
2023-02-10 19:48:14 +00:00
using Pal.Client.Properties;
namespace Pal.Client.DependencyInjection
2023-02-10 19:48:14 +00:00
{
internal sealed class Chat
2023-02-11 20:10:45 +00:00
{
private readonly ChatGui _chatGui;
public Chat(ChatGui chatGui)
2023-02-16 09:46:19 +00:00
{
_chatGui = chatGui;
}
public void Error(string e)
{
_chatGui.PrintChat(new XivChatEntry
2023-02-16 09:46:19 +00:00
{
Message = new SeStringBuilder()
.AddUiForeground($"[{Localization.Palace_Pal}] ", 16)
.AddText(e).Build(),
Type = XivChatType.Urgent
});
}
public void Message(string message)
2023-02-16 09:46:19 +00:00
{
_chatGui.Print(new SeStringBuilder()
2023-02-16 09:46:19 +00:00
.AddUiForeground($"[{Localization.Palace_Pal}] ", 57)
.AddText(message).Build());
}
public void UnformattedMessage(string message)
=> _chatGui.Print(message);
2023-02-11 20:10:45 +00:00
}
2023-02-10 19:48:14 +00:00
}