QuestMap/Quest Map/Plugin.cs

62 lines
1.8 KiB
C#
Raw Normal View History

2021-08-23 17:20:39 +00:00
using System.Threading.Channels;
using Dalamud.Data;
using Dalamud.Game.ClientState;
using Dalamud.Game.Command;
using Dalamud.Game.Gui;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.IoC;
2021-07-21 06:11:01 +00:00
using Dalamud.Plugin;
using XivCommon;
namespace QuestMap {
2021-08-23 17:20:39 +00:00
// ReSharper disable once ClassNeverInstantiated.Global
internal class Plugin : IDalamudPlugin {
public string Name => "Quest Map";
[PluginService]
internal DalamudPluginInterface Interface { get; init; } = null!;
[PluginService]
internal ClientState ClientState { get; init; } = null!;
[PluginService]
internal CommandManager CommandManager { get; init; } = null!;
[PluginService]
internal DataManager DataManager { get; init; } = null!;
[PluginService]
internal GameGui GameGui { get; init; } = null!;
[PluginService]
internal SeStringManager SeStringManager { get; init; } = null!;
2021-07-21 06:11:01 +00:00
internal XivCommonBase Common { get; }
internal Configuration Config { get; }
internal Quests Quests { get; }
internal PluginUi Ui { get; }
private Commands Commands { get; }
2021-08-23 17:20:39 +00:00
public Plugin() {
this.Common = new XivCommonBase();
2021-07-21 06:11:01 +00:00
this.Config = this.Interface.GetPluginConfig() as Configuration ?? new Configuration();
var graphChannel = Channel.CreateUnbounded<GraphInfo>();
this.Quests = new Quests(this, graphChannel.Writer);
this.Ui = new PluginUi(this, graphChannel.Reader);
this.Commands = new Commands(this);
}
public void Dispose() {
this.Commands.Dispose();
this.Ui.Dispose();
this.Common.Dispose();
}
internal void SaveConfig() {
this.Interface.SavePluginConfig(this.Config);
}
}
}