swap to embeddedresource
This commit is contained in:
parent
001a9f0191
commit
1dc1cef637
@ -3,6 +3,7 @@ using Dalamud.Plugin;
|
|||||||
using Dalamud.Plugin.Ipc;
|
using Dalamud.Plugin.Ipc;
|
||||||
using Dalamud.Plugin.Ipc.Exceptions;
|
using Dalamud.Plugin.Ipc.Exceptions;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
|
using Json.Schema;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Questionable.Model;
|
using Questionable.Model;
|
||||||
using System;
|
using System;
|
||||||
@ -22,6 +23,7 @@ internal sealed class BossModModule(ILogger<BossModModule> logger, MovementContr
|
|||||||
private readonly ICallGateSubscriber<string, bool> _setPreset = pluginInterface.GetIpcSubscriber<string, bool>($"{Name}.Presets.SetActive");
|
private readonly ICallGateSubscriber<string, bool> _setPreset = pluginInterface.GetIpcSubscriber<string, bool>($"{Name}.Presets.SetActive");
|
||||||
private readonly ICallGateSubscriber<bool> _clearPreset = pluginInterface.GetIpcSubscriber<bool>($"{Name}.Presets.ClearActive");
|
private readonly ICallGateSubscriber<bool> _clearPreset = pluginInterface.GetIpcSubscriber<bool>($"{Name}.Presets.ClearActive");
|
||||||
|
|
||||||
|
private static Stream Preset => typeof(BossModModule).Assembly.GetManifestResourceStream("Questionable.Controller.CombatModules.BossModPreset")!;
|
||||||
private DateTime _lastDistanceCheck = DateTime.MinValue;
|
private DateTime _lastDistanceCheck = DateTime.MinValue;
|
||||||
|
|
||||||
public bool CanHandleFight(CombatController.CombatData combatData)
|
public bool CanHandleFight(CombatController.CombatData combatData)
|
||||||
@ -40,10 +42,11 @@ internal sealed class BossModModule(ILogger<BossModModule> logger, MovementContr
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Starting {Name}", Name);
|
|
||||||
var path = Path.Combine(pluginInterface.AssemblyLocation.DirectoryName!, @"Controller\CombatModules\BossModPreset.json");
|
|
||||||
if (_getPreset.InvokeFunc("Questionable") == null)
|
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");
|
_setPreset.InvokeFunc("Questionable");
|
||||||
_lastDistanceCheck = DateTime.Now;
|
_lastDistanceCheck = DateTime.Now;
|
||||||
return true;
|
return true;
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Controller\CombatModules\BossModPreset.json" />
|
<None Remove="Controller\CombatModules\BossModPreset.json" />
|
||||||
<Content Include="Controller\CombatModules\BossModPreset.json">
|
<EmbeddedResource Include="Controller\CombatModules\BossModPreset.json">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<LogicalName>Questionable.Controller.CombatModules.BossModPreset</LogicalName>
|
||||||
</Content>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
Loading…
Reference in New Issue
Block a user