Skip to content

Commit

Permalink
Add some further safety to FFXIV plugin interaction (OverlayHider)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngld committed Dec 13, 2021
1 parent 3ed6535 commit 45c3b46
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion OverlayPlugin.Core/OverlayHider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ public OverlayHider(TinyIoCContainer container)
container.Resolve<NativeMethods>().ActiveWindowChanged += ActiveWindowChangedHandler;
container.Resolve<NetworkParser>().OnOnlineStatusChanged += OnlineStatusChanged;
container.Resolve<EventSources.EnmityEventSource>().CombatStatusChanged += CombatStatusChanged;
repository.RegisterProcessChangedHandler(UpdateFFXIVProcess);

try
{
repository.RegisterProcessChangedHandler(UpdateFFXIVProcess);
} catch (Exception ex)
{
logger.Log(LogLevel.Error, "Failed to register process watcher for FFXIV; this is only an issue if you're playing FFXIV. As a consequence, OverlayPlugin won't be able to hide overlays if you're not in-game.");
logger.Log(LogLevel.Error, "Details: " + ex.ToString());
}

focusTimer = new Timer();
focusTimer.Tick += (o, e) => ActiveWindowChangedHandler(this, IntPtr.Zero);
Expand Down

0 comments on commit 45c3b46

Please sign in to comment.