CommandReference/SamplePlugin/Configuration.cs
2024-02-06 23:58:16 -08:00

28 lines
689 B
C#

using System;
using Dalamud.Configuration;
using Dalamud.Plugin;
namespace SamplePlugin
{
[Serializable]
public class Configuration : IPluginConfiguration
{
public int Version { get; set; }
public bool SomePropertyToBeSavedAndWithADefault { get; set; } = true;
// the below exist just to make saving less cumbersome
[NonSerialized]
private DalamudPluginInterface? pluginInterface;
public void Initialize(DalamudPluginInterface pluginInterface)
{
this.pluginInterface = pluginInterface;
}
public void Save()
{
pluginInterface!.SavePluginConfig(this);
}
}
}