fix: use new extrachat ipc
This commit is contained in:
@@ -3,16 +3,22 @@ using Dalamud.Plugin.Ipc;
|
|||||||
namespace ChatTwo.Ipc;
|
namespace ChatTwo.Ipc;
|
||||||
|
|
||||||
internal sealed class ExtraChat : IDisposable {
|
internal sealed class ExtraChat : IDisposable {
|
||||||
|
private struct OverrideInfo {
|
||||||
|
internal string? Channel;
|
||||||
|
internal ushort UiColour;
|
||||||
|
internal uint Rgba;
|
||||||
|
}
|
||||||
|
|
||||||
private Plugin Plugin { get; }
|
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 (string, uint)? ChannelOverride { get; set; }
|
||||||
|
|
||||||
internal ExtraChat(Plugin plugin) {
|
internal ExtraChat(Plugin plugin) {
|
||||||
this.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);
|
this.OverrideChannelGate.Subscribe(this.OnOverrideChannel);
|
||||||
}
|
}
|
||||||
@@ -21,12 +27,12 @@ internal sealed class ExtraChat : IDisposable {
|
|||||||
this.OverrideChannelGate.Unsubscribe(this.OnOverrideChannel);
|
this.OverrideChannelGate.Unsubscribe(this.OnOverrideChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnOverrideChannel((string, ushort, uint)? info) {
|
private void OnOverrideChannel(OverrideInfo info) {
|
||||||
if (info == null) {
|
if (info.Channel == null) {
|
||||||
this.ChannelOverride = null;
|
this.ChannelOverride = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ChannelOverride = (info.Value.Item1, info.Value.Item3);
|
this.ChannelOverride = (info.Channel, info.Rgba);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user