diff --git a/Questionable/Controller/CombatModules/BossModModule.cs b/Questionable/Controller/CombatModules/BossModModule.cs index 0d04cce1..a26d1c74 100644 --- a/Questionable/Controller/CombatModules/BossModModule.cs +++ b/Questionable/Controller/CombatModules/BossModModule.cs @@ -3,6 +3,7 @@ using Dalamud.Plugin; using Dalamud.Plugin.Ipc; using Dalamud.Plugin.Ipc.Exceptions; using Dalamud.Plugin.Services; +using Json.Schema; using Microsoft.Extensions.Logging; using Questionable.Model; using System; @@ -22,6 +23,7 @@ internal sealed class BossModModule(ILogger logger, MovementContr private readonly ICallGateSubscriber _setPreset = pluginInterface.GetIpcSubscriber($"{Name}.Presets.SetActive"); private readonly ICallGateSubscriber _clearPreset = pluginInterface.GetIpcSubscriber($"{Name}.Presets.ClearActive"); + private static Stream Preset => typeof(BossModModule).Assembly.GetManifestResourceStream("Questionable.Controller.CombatModules.BossModPreset")!; private DateTime _lastDistanceCheck = DateTime.MinValue; public bool CanHandleFight(CombatController.CombatData combatData) @@ -40,10 +42,11 @@ internal sealed class BossModModule(ILogger logger, MovementContr { try { - _logger.LogInformation("Starting {Name}", Name); - var path = Path.Combine(pluginInterface.AssemblyLocation.DirectoryName!, @"Controller\CombatModules\BossModPreset.json"); if (_getPreset.InvokeFunc("Questionable") == null) - _logger.LogInformation("Loading Questionable BossMod Preset: {LoadedState}", _createPreset.InvokeFunc(File.ReadAllText(path), true)); + { + using var reader = new StreamReader(Preset); + _logger.LogInformation("Loading Questionable BossMod Preset: {LoadedState}", _createPreset.InvokeFunc(reader.ReadToEnd(), true)); + } _setPreset.InvokeFunc("Questionable"); _lastDistanceCheck = DateTime.Now; return true; diff --git a/Questionable/Questionable.csproj b/Questionable/Questionable.csproj index eb91f928..544ba74e 100644 --- a/Questionable/Questionable.csproj +++ b/Questionable/Questionable.csproj @@ -26,8 +26,8 @@ - - PreserveNewest - + + Questionable.Controller.CombatModules.BossModPreset +