BetterPartyFinder/BetterPartyFinder/Plugin.cs

62 lines
1.9 KiB
C#
Raw Normal View History

2023-09-28 05:57:00 +00:00
using Dalamud.IoC;
2021-08-24 18:00:42 +00:00
using Dalamud.Plugin;
2023-09-28 05:57:00 +00:00
using Dalamud.Plugin.Services;
using XivCommon;
2021-01-14 04:06:35 +00:00
namespace BetterPartyFinder {
// ReSharper disable once ClassNeverInstantiated.Global
2021-01-14 04:06:35 +00:00
public class Plugin : IDalamudPlugin {
2023-09-28 05:57:00 +00:00
internal static string Name => "Better Party Finder";
2021-01-14 04:06:35 +00:00
2021-08-24 18:00:42 +00:00
[PluginService]
internal DalamudPluginInterface Interface { get; init; } = null!;
2021-01-14 04:06:35 +00:00
2021-08-24 18:00:42 +00:00
[PluginService]
2023-09-28 05:57:00 +00:00
internal IChatGui ChatGui { get; init; } = null!;
2021-01-14 04:06:35 +00:00
2021-08-24 18:00:42 +00:00
[PluginService]
2023-09-28 05:57:00 +00:00
internal IClientState ClientState { get; init; } = null!;
2021-08-24 18:00:42 +00:00
[PluginService]
2023-09-28 05:57:00 +00:00
internal ICommandManager CommandManager { get; init; } = null!;
2021-08-24 18:00:42 +00:00
[PluginService]
2023-09-28 05:57:00 +00:00
internal IDataManager DataManager { get; init; } = null!;
2021-08-24 18:00:42 +00:00
[PluginService]
2023-09-28 05:57:00 +00:00
internal IGameGui GameGui { get; init; } = null!;
2021-08-24 18:00:42 +00:00
[PluginService]
2023-09-28 05:57:00 +00:00
internal IPartyFinderGui PartyFinderGui { get; init; } = null!;
2021-08-24 18:00:42 +00:00
internal Configuration Config { get; }
private Filter Filter { get; }
internal PluginUi Ui { get; }
private Commands Commands { get; }
internal XivCommonBase Common { get; }
private JoinHandler JoinHandler { get; }
public Plugin() {
2021-01-14 22:12:30 +00:00
this.Config = Configuration.Load(this) ?? new Configuration();
2021-01-14 04:06:35 +00:00
this.Config.Initialise(this);
2023-10-03 21:37:18 +00:00
this.Common = new XivCommonBase(this.Interface, Hooks.PartyFinder);
2021-01-14 04:06:35 +00:00
this.Filter = new Filter(this);
this.JoinHandler = new JoinHandler(this);
2021-01-14 04:06:35 +00:00
this.Ui = new PluginUi(this);
this.Commands = new Commands(this);
2021-01-14 04:06:35 +00:00
// start task to determine maximum item level (based on max chestpiece)
2021-08-24 18:00:42 +00:00
Util.CalculateMaxItemLevel(this.DataManager);
2021-01-14 04:06:35 +00:00
}
public void Dispose() {
this.Commands.Dispose();
2021-01-14 04:06:35 +00:00
this.Ui.Dispose();
this.JoinHandler.Dispose();
2021-01-14 04:06:35 +00:00
this.Filter.Dispose();
this.Common.Dispose();
2021-01-14 04:06:35 +00:00
}
}
}