- Replace all possible hooks with CS

- Mark ones that can be replaced soon
- Use Dalamuds ConfigOption for chat color parsing
This commit is contained in:
Infi
2024-05-25 16:50:37 +02:00
parent 8aaaa684a2
commit 0c19772b18
10 changed files with 104 additions and 109 deletions
+1
View File
@@ -1,3 +1,4 @@
using Dalamud.Game.Config;
using LiteDB;
namespace ChatTwo.Code;
+2
View File
@@ -1,3 +1,5 @@
using Dalamud.Game.Config;
namespace ChatTwo.Code;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1028:Enum Storage should be Int32")]
+31 -1
View File
@@ -1,5 +1,6 @@
using ChatTwo.Resources;
using ChatTwo.Util;
using Dalamud.Game.Config;
namespace ChatTwo.Code;
@@ -187,7 +188,7 @@ internal static class ChatTypeExt
};
}
internal static uint? DefaultColour(this ChatType type)
internal static uint? DefaultColor(this ChatType type)
{
switch (type)
{
@@ -370,6 +371,35 @@ internal static class ChatTypeExt
_ => false,
};
public static UiConfigOption ToConfigEntry(this ChatType type) => type switch
{
ChatType.Say => UiConfigOption.ColorSay,
ChatType.Shout => UiConfigOption.ColorShout,
ChatType.TellOutgoing => UiConfigOption.ColorTell,
ChatType.Party => UiConfigOption.ColorParty,
ChatType.Linkshell1 => UiConfigOption.ColorLS1,
ChatType.Linkshell2 => UiConfigOption.ColorLS2,
ChatType.Linkshell3 => UiConfigOption.ColorLS3,
ChatType.Linkshell4 => UiConfigOption.ColorLS4,
ChatType.Linkshell5 => UiConfigOption.ColorLS5,
ChatType.Linkshell6 => UiConfigOption.ColorLS6,
ChatType.Linkshell7 => UiConfigOption.ColorLS7,
ChatType.Linkshell8 => UiConfigOption.ColorLS8,
ChatType.FreeCompany => UiConfigOption.ColorFCompany,
ChatType.NoviceNetwork => UiConfigOption.ColorBeginner,
ChatType.CustomEmote => UiConfigOption.ColorEmoteUser,
ChatType.StandardEmote => UiConfigOption.ColorEmote,
ChatType.Yell => UiConfigOption.ColorYell,
ChatType.GainBuff => UiConfigOption.ColorBuffGive,
ChatType.GainDebuff => UiConfigOption.ColorDebuffGive,
ChatType.System => UiConfigOption.ColorSysMsg,
ChatType.NpcDialogue => UiConfigOption.ColorNpcSay,
ChatType.LootRoll => UiConfigOption.ColorLoot,
ChatType.FreeCompanyAnnouncement => UiConfigOption.ColorFCAnnounce,
ChatType.PvpTeamAnnouncement => UiConfigOption.ColorPvPGroupAnnounce,
_ => UiConfigOption.ColorSay,
};
internal static bool HasSource(this ChatType type) => type switch
{
// Battle