Enable context menu integration by default
This commit is contained in:
parent
e419653744
commit
404d513054
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0-windows</TargetFramework>
|
||||
<Version>4.3</Version>
|
||||
<Version>4.4</Version>
|
||||
<LangVersion>11.0</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
|
@ -50,6 +50,7 @@ public class AutoDiscardPlogon : IDalamudPlugin
|
||||
|
||||
_pluginInterface = pluginInterface;
|
||||
_configuration = (Configuration?)_pluginInterface.GetPluginConfig() ?? new Configuration();
|
||||
MigrateConfiguration(_configuration);
|
||||
_chatGui = chatGui;
|
||||
_clientState = clientState;
|
||||
_pluginLog = pluginLog;
|
||||
@ -99,6 +100,17 @@ public class AutoDiscardPlogon : IDalamudPlugin
|
||||
_autoRetainerApi.OnCharacterReadyToPostProcess += DoCharacterPostProcess;
|
||||
}
|
||||
|
||||
private void MigrateConfiguration(Configuration configuration)
|
||||
{
|
||||
if (configuration.Version == 1)
|
||||
{
|
||||
configuration.ContextMenu.Enabled = true;
|
||||
configuration.ContextMenu.OnlyWhenConfigIsOpen = false;
|
||||
configuration.Version = 2;
|
||||
_pluginInterface.SavePluginConfig(configuration);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckRetainerPostProcess(string retainerName) =>
|
||||
CheckPostProcessInternal(PostProcessType.Retainer, retainerName, _configuration.RunAfterVenture);
|
||||
|
||||
|
@ -5,7 +5,7 @@ namespace ARDiscard;
|
||||
|
||||
internal sealed class Configuration : IPluginConfiguration
|
||||
{
|
||||
public int Version { get; set; } = 1;
|
||||
public int Version { get; set; } = 2;
|
||||
public bool RunAfterVenture { get; set; }
|
||||
public bool RunBeforeLogout { get; set; }
|
||||
public List<uint> DiscardingItems { get; set; } = new();
|
||||
@ -34,8 +34,8 @@ internal sealed class Configuration : IPluginConfiguration
|
||||
|
||||
public sealed class ContextMenuConfiguration
|
||||
{
|
||||
public bool Enabled { get; set; } = false;
|
||||
public bool OnlyWhenConfigIsOpen { get; set; } = true;
|
||||
public bool Enabled { get; set; } = true;
|
||||
public bool OnlyWhenConfigIsOpen { get; set; } = false;
|
||||
}
|
||||
|
||||
public sealed class PreviewConfiguration
|
||||
|
Loading…
Reference in New Issue
Block a user