improve logging/error display for lack of penumbra or glamourer

This commit is contained in:
Stanley Dimant
2024-07-19 10:46:29 +02:00
parent 0c47bf8ccd
commit c67add20d6
7 changed files with 60 additions and 10 deletions

View File

@@ -10,7 +10,7 @@ using Microsoft.Extensions.Logging;
namespace MareSynchronos.Interop.Ipc;
public sealed class IpcCallerGlamourer : IIpcCaller
public sealed class IpcCallerGlamourer : DisposableMediatorSubscriberBase, IIpcCaller
{
private readonly ILogger<IpcCallerGlamourer> _logger;
private readonly IDalamudPluginInterface _pi;
@@ -31,7 +31,7 @@ public sealed class IpcCallerGlamourer : IIpcCaller
private readonly uint LockCode = 0x6D617265;
public IpcCallerGlamourer(ILogger<IpcCallerGlamourer> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil, MareMediator mareMediator,
RedrawManager redrawManager)
RedrawManager redrawManager) : base(logger, mareMediator)
{
_glamourerApiVersions = new ApiVersion(pi);
_glamourerGetAllCustomization = new GetStateBase64(pi);
@@ -50,6 +50,15 @@ public sealed class IpcCallerGlamourer : IIpcCaller
_glamourerStateChanged = StateChanged.Subscriber(pi, GlamourerChanged);
_glamourerStateChanged.Enable();
Mediator.Subscribe<DalamudLoginMessage>(this, s => _shownGlamourerUnavailable = false);
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
_redrawManager.Cancel();
}
public bool APIAvailable { get; private set; }

View File

@@ -90,6 +90,8 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
{
_penumbraRedraw.Invoke(msg.Character.ObjectIndex, RedrawType.AfterGPose);
});
Mediator.Subscribe<DalamudLoginMessage>(this, (msg) => _shownPenumbraUnavailable = false);
}
public bool APIAvailable { get; private set; } = false;