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;
|
|
|
|
|
|
2023-03-30 20:01:43 +00:00
|
|
|
|
namespace Pal.Client.DependencyInjection;
|
2023-02-17 14:51:45 +00:00
|
|
|
|
|
2023-03-30 20:01:43 +00:00
|
|
|
|
internal sealed class Chat
|
|
|
|
|
{
|
|
|
|
|
private readonly ChatGui _chatGui;
|
2023-02-17 14:51:45 +00:00
|
|
|
|
|
2023-03-30 20:01:43 +00:00
|
|
|
|
public Chat(ChatGui chatGui)
|
|
|
|
|
{
|
|
|
|
|
_chatGui = chatGui;
|
|
|
|
|
}
|
2023-02-16 09:46:19 +00:00
|
|
|
|
|
2023-03-30 20:01:43 +00:00
|
|
|
|
public void Error(string e)
|
|
|
|
|
{
|
|
|
|
|
_chatGui.PrintChat(new XivChatEntry
|
2023-02-16 09:46:19 +00:00
|
|
|
|
{
|
2023-03-30 20:01:43 +00:00
|
|
|
|
Message = new SeStringBuilder()
|
|
|
|
|
.AddUiForeground($"[{Localization.Palace_Pal}] ", 16)
|
|
|
|
|
.AddText(e).Build(),
|
|
|
|
|
Type = XivChatType.Urgent
|
|
|
|
|
});
|
|
|
|
|
}
|
2023-02-17 14:51:45 +00:00
|
|
|
|
|
2023-03-30 20:01:43 +00:00
|
|
|
|
public void Message(string message)
|
|
|
|
|
{
|
|
|
|
|
_chatGui.Print(new SeStringBuilder()
|
|
|
|
|
.AddUiForeground($"[{Localization.Palace_Pal}] ", 57)
|
|
|
|
|
.AddText(message).Build());
|
2023-02-11 20:10:45 +00:00
|
|
|
|
}
|
2023-03-30 20:01:43 +00:00
|
|
|
|
|
|
|
|
|
public void UnformattedMessage(string message)
|
|
|
|
|
=> _chatGui.Print(message);
|
2023-02-10 19:48:14 +00:00
|
|
|
|
}
|