fix: use new extrachat ipc
This commit is contained in:
parent
4bd9d82b26
commit
1ecd45eff2
|
@ -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<OverrideInfo, object> 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<OverrideInfo, object>("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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue