-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add *experimental* support for Penumbra IPC
- Allows loading in icons from Penumbra (for Material UI users) - Add experimental (default-off) checkbox for above feature. - Partial rewrite of IconManager to handle this new case, as well as clarity
- Loading branch information
Showing
6 changed files
with
87 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Dalamud.Logging; | ||
using Dalamud.Plugin.Ipc; | ||
using XIVDeck.FFXIVPlugin.Base; | ||
|
||
namespace XIVDeck.FFXIVPlugin.IPC; | ||
|
||
public class PenumbraIPC { | ||
public static bool PenumbraEnabled { get; private set; } = false; | ||
private static ICallGateSubscriber<int>? _penumbraApiVersionSubscriber; | ||
private static ICallGateSubscriber<string, string>? _penumbraResolveDefaultSubscriber; | ||
|
||
public static int PenumbraApiVersion => _penumbraApiVersionSubscriber?.InvokeFunc() ?? 0; | ||
|
||
public static void Initialize() { | ||
_penumbraApiVersionSubscriber = Injections.PluginInterface.GetIpcSubscriber<int>("Penumbra.ApiVersion"); | ||
|
||
if (PenumbraApiVersion == 3) { | ||
_penumbraResolveDefaultSubscriber = Injections.PluginInterface.GetIpcSubscriber<string, string>("Penumbra.ResolveDefaultPath"); | ||
PenumbraEnabled = true; | ||
PluginLog.Information("Enabled Penumbra IPC connection!"); | ||
} | ||
} | ||
|
||
public static string ResolvePenumbraPath(string path) { | ||
return _penumbraResolveDefaultSubscriber?.InvokeFunc(path) ?? path; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters