From b10f872ea9c31f235d67f6199911a182a9fb25c8 Mon Sep 17 00:00:00 2001 From: Anna Clemens Date: Fri, 1 Jul 2022 10:17:29 -0400 Subject: [PATCH] fix: use new extrachat ipc --- ChatTwo/Ipc/ExtraChat.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ChatTwo/Ipc/ExtraChat.cs b/ChatTwo/Ipc/ExtraChat.cs index cce00e6..e2a5eef 100644 --- a/ChatTwo/Ipc/ExtraChat.cs +++ b/ChatTwo/Ipc/ExtraChat.cs @@ -3,16 +3,22 @@ using Dalamud.Plugin.Ipc; namespace ChatTwo.Ipc; internal sealed class ExtraChat : IDisposable { + private struct OverrideInfo { + internal string? Channel; + internal ushort UiColour; + internal uint Rgba; + } + private Plugin Plugin { get; } - private ICallGateSubscriber<(string, ushort, uint)?, object> OverrideChannelGate { get; } + private ICallGateSubscriber OverrideChannelGate { get; } internal (string, uint)? ChannelOverride { get; set; } internal ExtraChat(Plugin plugin) { this.Plugin = plugin; - this.OverrideChannelGate = this.Plugin.Interface.GetIpcSubscriber<(string, ushort, uint)?, object>("ExtraChat.OverrideChannelColour"); + this.OverrideChannelGate = this.Plugin.Interface.GetIpcSubscriber("ExtraChat.OverrideChannelColour"); this.OverrideChannelGate.Subscribe(this.OnOverrideChannel); } @@ -21,12 +27,12 @@ internal sealed class ExtraChat : IDisposable { this.OverrideChannelGate.Unsubscribe(this.OnOverrideChannel); } - private void OnOverrideChannel((string, ushort, uint)? info) { - if (info == null) { + private void OnOverrideChannel(OverrideInfo info) { + if (info.Channel == null) { this.ChannelOverride = null; return; } - this.ChannelOverride = (info.Value.Item1, info.Value.Item3); + this.ChannelOverride = (info.Channel, info.Rgba); } }