2023-01-10 20:07:57 +00:00
|
|
|
|
using CurrencyAlert.Localization;
|
|
|
|
|
using CurrencyAlert.System.cs;
|
|
|
|
|
using CurrencyAlert.Windows;
|
2022-09-14 16:35:53 +00:00
|
|
|
|
using Dalamud.Plugin;
|
2023-01-10 20:07:57 +00:00
|
|
|
|
using KamiLib;
|
2022-09-14 16:35:53 +00:00
|
|
|
|
|
2023-01-10 20:07:57 +00:00
|
|
|
|
namespace CurrencyAlert;
|
|
|
|
|
|
|
|
|
|
public sealed class Plugin : IDalamudPlugin
|
2022-09-14 16:35:53 +00:00
|
|
|
|
{
|
2023-01-10 20:07:57 +00:00
|
|
|
|
public string Name => "CurrencyAlert";
|
|
|
|
|
|
|
|
|
|
public Plugin(DalamudPluginInterface pluginInterface)
|
2022-09-14 16:35:53 +00:00
|
|
|
|
{
|
2023-01-10 20:07:57 +00:00
|
|
|
|
pluginInterface.Create<Service>();
|
|
|
|
|
|
|
|
|
|
KamiCommon.Initialize(pluginInterface, Name, () => Service.Configuration.Save());
|
|
|
|
|
LocalizationManager.Instance.Initialize();
|
|
|
|
|
|
|
|
|
|
Service.Configuration = Service.PluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
|
|
|
|
|
Service.Configuration.Initialize(Service.PluginInterface);
|
|
|
|
|
|
|
|
|
|
KamiCommon.WindowManager.AddConfigurationWindow(new ConfigurationWindow());
|
|
|
|
|
KamiCommon.WindowManager.AddWindow(new OverlayWindow());
|
|
|
|
|
|
|
|
|
|
Service.CurrencyTracker = new CurrencyTracker();
|
|
|
|
|
}
|
2022-09-14 16:35:53 +00:00
|
|
|
|
|
2023-01-10 20:07:57 +00:00
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
KamiCommon.Dispose();
|
|
|
|
|
|
|
|
|
|
Service.CurrencyTracker.Dispose();
|
|
|
|
|
LocalizationManager.Cleanup();
|
2022-09-14 16:35:53 +00:00
|
|
|
|
}
|
2023-01-10 20:07:57 +00:00
|
|
|
|
}
|