diff --git a/PluginConfiguration.cs b/Configuration.cs similarity index 90% rename from PluginConfiguration.cs rename to Configuration.cs index cade983..aa25aa6 100644 --- a/PluginConfiguration.cs +++ b/Configuration.cs @@ -4,7 +4,7 @@ namespace DalamudPluginProjectTemplate { - public class PluginConfiguration : IPluginConfiguration + public class Configuration : IPluginConfiguration { public int Version { get; set; } diff --git a/Plugin.cs b/Plugin.cs index c068542..348ebf4 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -8,7 +8,7 @@ public class Plugin : IDalamudPlugin { private DalamudPluginInterface pluginInterface; private PluginCommandManager commandManager; - private PluginConfiguration config; + private Configuration config; private PluginUI ui; public string Name => "Your Plugin's Display Name"; @@ -17,11 +17,9 @@ public void Initialize(DalamudPluginInterface pluginInterface) { this.pluginInterface = pluginInterface; - // If your plugin doesn't need a configuration, you can safely remove all references to this variable and class. - this.config = (PluginConfiguration)this.pluginInterface.GetPluginConfig() ?? new PluginConfiguration(); + this.config = (Configuration)this.pluginInterface.GetPluginConfig() ?? new Configuration(); this.config.Initialize(this.pluginInterface); - // Likewise here. this.ui = new PluginUI(); this.pluginInterface.UiBuilder.OnBuildUi += this.ui.Draw; @@ -43,17 +41,15 @@ public void ExampleCommand1(string command, string args) #region IDisposable Support protected virtual void Dispose(bool disposing) { - if (disposing) - { - this.commandManager.Dispose(); + if (!disposing) return; - // You may not want to save a configuration until after you're done tweaking the class layout. - //this.pluginInterface.SavePluginConfig(this.config); + this.commandManager.Dispose(); - this.pluginInterface.UiBuilder.OnBuildUi -= this.ui.Draw; + this.pluginInterface.SavePluginConfig(this.config); - this.pluginInterface.Dispose(); - } + this.pluginInterface.UiBuilder.OnBuildUi -= this.ui.Draw; + + this.pluginInterface.Dispose(); } public void Dispose()