diff --git a/!Dist/latest.zip b/!Dist/latest.zip index 6a9935e..31e40e4 100644 Binary files a/!Dist/latest.zip and b/!Dist/latest.zip differ diff --git a/Puppets/Puppets.csproj b/Puppets/Puppets.csproj index e9e33d9..a27f3c8 100644 --- a/Puppets/Puppets.csproj +++ b/Puppets/Puppets.csproj @@ -10,7 +10,7 @@ - net7.0-windows + net8.0-windows x64 enable latest diff --git a/Puppets/Puppets.json b/Puppets/Puppets.json index cf82c4f..2912524 100644 --- a/Puppets/Puppets.json +++ b/Puppets/Puppets.json @@ -5,8 +5,8 @@ "Punchline": "Simple emote syncing!", "Tags": [ "Emote", "Syncing" ], "InternalName": "Puppets", - "AssemblyVersion": "1.2.1.2", - "TestingAssemblyVersion": "1.2.1.2", + "AssemblyVersion": "1.2.1.3", + "TestingAssemblyVersion": "1.2.1.3", "IconUrl": "https://raw.githubusercontent.com/ribbon-studios/Puppets/main/images/icon.png", "RepoUrl": "https://github.com/ribbon-studios/Puppets", "ApplicableVersion": "any", diff --git a/Puppets/PuppetsPlugin.cs b/Puppets/PuppetsPlugin.cs index 1dc51c5..4762512 100644 --- a/Puppets/PuppetsPlugin.cs +++ b/Puppets/PuppetsPlugin.cs @@ -6,8 +6,11 @@ using Dalamud.Game.Gui; using Dalamud.Game.Text; using Dalamud.Game.Text.SeStringHandling; +using Dalamud.Interface.ImGuiNotification; +using Dalamud.Interface.Internal.Notifications; using Dalamud.IoC; using Dalamud.Plugin; +using Dalamud.Plugin.Services; using Puppets.Constants; using Puppets.Models; using Puppets.SeFunctions; @@ -27,13 +30,15 @@ public sealed class PuppetsPlugin : IDalamudPlugin private const string PuppetMasterCommand = "/pm"; #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. - [PluginService] public static DataManager Data { get; private set; } - [PluginService] public static ClientState ClientState { get; private set; } - [PluginService] public static PartyList PartyList { get; private set; } + [PluginService] public static IDataManager Data { get; private set; } + [PluginService] public static IClientState ClientState { get; private set; } + [PluginService] public static IPartyList PartyList { get; private set; } [PluginService] public static DalamudPluginInterface PluginInterface { get; private set; } - [PluginService] public static CommandManager CommandManager { get; private set; } - [PluginService] public static ChatGui ChatGui { get; private set; } + [PluginService] public static ICommandManager CommandManager { get; private set; } + [PluginService] public static IChatGui ChatGui { get; private set; } [PluginService] public static SigScanner TargetScanner { get; private set; } + [PluginService] public static IPluginLog PluginLog { get; private set; } + [PluginService] public static INotificationManager NotificationManager { get; private set; } #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. private static Configuration? _configuration; @@ -54,7 +59,7 @@ public static Configuration Configuration public PuppetsPlugin() { - this.Common = new XivCommonBase(Hooks.None); + this.Common = new XivCommonBase(PluginInterface, Hooks.None); // you might normally want to embed resources and load them from the manifest stream this.PluginUi = new PluginUI(); @@ -123,19 +128,35 @@ private void OnPuppetMasterCommand(string command, string args) if (Configuration.GetDebugMode() is not DebugMode.Echo and not DebugMode.EchoNoEmote && CharacterUtils.IsNotOwner) { - PuppetsPlugin.PluginInterface.UiBuilder.AddNotification("Only a puppet master may execute emotes!", "Puppets", Dalamud.Interface.Internal.Notifications.NotificationType.Warning); + NotificationManager.AddNotification(new Notification { + Title = "Puppets", + Content = "Only a puppet master may execute emotes!", + Type = NotificationType.Warning + }); } else if (Emotes.isInvalidEmote(emote)) { - PuppetsPlugin.PluginInterface.UiBuilder.AddNotification("The provided emote does not exist (" + emote + ")", "Puppets", Dalamud.Interface.Internal.Notifications.NotificationType.Error); + NotificationManager.AddNotification(new Notification { + Title = "Puppets", + Content = $"The provided emote does not exist ({emote})", + Type = NotificationType.Error + }); } else if (Emotes.isNotUnlockedEmote(emote)) { - PuppetsPlugin.PluginInterface.UiBuilder.AddNotification("The provided emote is not unlocked (" + emote + ")", "Puppets", Dalamud.Interface.Internal.Notifications.NotificationType.Warning); + NotificationManager.AddNotification(new Notification { + Title = "Puppets", + Content = $"The provided emote is not unlocked ({emote})", + Type = NotificationType.Warning + }); } else if (Configuration.GetDebugMode() is not DebugMode.Echo and not DebugMode.EchoNoEmote && CharacterUtils.NotInParty) { - PuppetsPlugin.PluginInterface.UiBuilder.AddNotification("You must be in a party to use puppets!", "Puppets", Dalamud.Interface.Internal.Notifications.NotificationType.Warning); + NotificationManager.AddNotification(new Notification { + Title = "Puppets", + Content = "You must be in a party to use puppets!", + Type = NotificationType.Warning + }); } else { diff --git a/Puppets/Utils/Emotes.cs b/Puppets/Utils/Emotes.cs index 5e9ebb5..d5965b8 100644 --- a/Puppets/Utils/Emotes.cs +++ b/Puppets/Utils/Emotes.cs @@ -22,7 +22,7 @@ private static IsEmoteUnlockedDelegate? _isEmoteUnlocked { if (PuppetsPlugin.TargetScanner.TryScanText("E8 ?? ?? ?? ?? 84 C0 74 A4", out var emoteUnlockedPtr)) { - PluginLog.Information($"emoteUnlockedPtr: {emoteUnlockedPtr:X}"); + PuppetsPlugin.PluginLog.Information($"emoteUnlockedPtr: {emoteUnlockedPtr:X}"); Emotes.__isEmoteUnlocked = Marshal.GetDelegateForFunctionPointer(emoteUnlockedPtr); } } diff --git a/repo.json b/repo.json index cd024b6..08c1efa 100644 --- a/repo.json +++ b/repo.json @@ -6,8 +6,8 @@ "Punchline": "Simple emote syncing!", "Tags": [ "Emote", "Syncing" ], "InternalName": "Puppets", - "AssemblyVersion": "1.2.1.2", - "TestingAssemblyVersion": "1.2.1.2", + "AssemblyVersion": "1.2.1.3", + "TestingAssemblyVersion": "1.2.1.3", "IconUrl": "https://raw.githubusercontent.com/ribbon-studios/Puppets/main/images/icon.png", "RepoUrl": "https://github.com/ribbon-studios/Puppets", "ApplicableVersion": "any", diff --git a/shell.nix b/shell.nix index a2e394c..c4a27c9 100644 --- a/shell.nix +++ b/shell.nix @@ -5,7 +5,7 @@ default = pkgs.mkShell { nativeBuildInputs = with pkgs.buildPackages; [ nodejs_18 - dotnet-sdk_7 + dotnet-sdk_8 ]; }; }