refactor: rework the command system

This commit is contained in:
Anna
2022-02-15 16:57:15 -05:00
parent cbaa3fef4f
commit 1409da708d
4 changed files with 121 additions and 11 deletions
+6
View File
@@ -59,6 +59,7 @@ public sealed class Plugin : IDalamudPlugin {
internal TargetManager TargetManager { get; init; }
internal Configuration Config { get; }
internal Commands Commands { get; }
internal XivCommonBase Common { get; }
internal TextureCache TextureCache { get; }
internal GameFunctions.GameFunctions Functions { get; }
@@ -78,12 +79,16 @@ public sealed class Plugin : IDalamudPlugin {
this.LanguageChanged(this.Interface.UiLanguage);
this.Commands = new Commands(this);
this.Common = new XivCommonBase();
this.TextureCache = new TextureCache(this.DataManager!);
this.Functions = new GameFunctions.GameFunctions(this);
this.Store = new Store(this);
this.Ui = new PluginUi(this);
// let all the other components register, then initialise commands
this.Commands.Initialise();
if (this.Interface.Reason is not PluginLoadReason.Boot) {
this.Store.FilterAllTabs(false);
}
@@ -103,6 +108,7 @@ public sealed class Plugin : IDalamudPlugin {
this.Functions.Dispose();
this.TextureCache.Dispose();
this.Common.Dispose();
this.Commands.Dispose();
}
internal void SaveConfig() {