2021-02-23 01:22:40 +00:00
|
|
|
|
using Dalamud.Game.Command;
|
|
|
|
|
using Dalamud.Plugin;
|
2021-02-18 20:20:40 +00:00
|
|
|
|
|
|
|
|
|
namespace ExpandedSearchInfo {
|
2021-02-23 01:22:40 +00:00
|
|
|
|
// ReSharper disable once ClassNeverInstantiated.Global
|
2021-02-18 20:20:40 +00:00
|
|
|
|
public class Plugin : IDalamudPlugin {
|
|
|
|
|
public string Name => "Expanded Search Info";
|
|
|
|
|
|
2021-02-23 01:22:40 +00:00
|
|
|
|
internal PluginConfiguration Config { get; private set; } = null!;
|
2021-02-18 20:20:40 +00:00
|
|
|
|
internal DalamudPluginInterface Interface { get; private set; } = null!;
|
|
|
|
|
internal GameFunctions Functions { get; private set; } = null!;
|
|
|
|
|
internal SearchInfoRepository Repository { get; private set; } = null!;
|
|
|
|
|
private PluginUi Ui { get; set; } = null!;
|
|
|
|
|
|
|
|
|
|
public void Initialize(DalamudPluginInterface pluginInterface) {
|
|
|
|
|
this.Interface = pluginInterface;
|
|
|
|
|
|
2021-02-23 01:22:40 +00:00
|
|
|
|
this.Config = (PluginConfiguration?) this.Interface.GetPluginConfig() ?? new PluginConfiguration();
|
|
|
|
|
this.Config.Initialise(this);
|
|
|
|
|
|
2021-02-18 20:20:40 +00:00
|
|
|
|
this.Functions = new GameFunctions(this);
|
|
|
|
|
this.Repository = new SearchInfoRepository(this);
|
|
|
|
|
this.Ui = new PluginUi(this);
|
2021-02-23 01:22:40 +00:00
|
|
|
|
|
|
|
|
|
this.Interface.CommandManager.AddHandler("/esi", new CommandInfo(this.OnCommand) {
|
|
|
|
|
HelpMessage = "Toggles Expanded Search Info's configuration window",
|
|
|
|
|
});
|
2021-02-18 20:20:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Dispose() {
|
2021-02-23 01:22:40 +00:00
|
|
|
|
this.Interface.CommandManager.RemoveHandler("/esi");
|
2021-02-18 20:20:40 +00:00
|
|
|
|
this.Ui.Dispose();
|
|
|
|
|
this.Repository.Dispose();
|
|
|
|
|
this.Functions.Dispose();
|
|
|
|
|
}
|
2021-02-23 01:22:40 +00:00
|
|
|
|
|
|
|
|
|
private void OnCommand(string command, string arguments) {
|
|
|
|
|
this.Ui.ConfigVisible = !this.Ui.ConfigVisible;
|
|
|
|
|
}
|
2021-02-18 20:20:40 +00:00
|
|
|
|
}
|
|
|
|
|
}
|