refactor: use DI Attribute
This commit is contained in:
parent
6525cd9da3
commit
c54fa76ae1
@ -18,7 +18,7 @@ namespace Tourist {
|
|||||||
this.Plugin = plugin;
|
this.Plugin = plugin;
|
||||||
|
|
||||||
this.Plugin.ClientState.TerritoryChanged += this.OnTerritoryChange;
|
this.Plugin.ClientState.TerritoryChanged += this.OnTerritoryChange;
|
||||||
this.Plugin.Framework.OnUpdateEvent += this.OnFrameworkUpdate;
|
this.Plugin.Framework.Update += this.OnFrameworkUpdate;
|
||||||
|
|
||||||
if (this.Plugin.Config.ShowArrVistas) {
|
if (this.Plugin.Config.ShowArrVistas) {
|
||||||
this.SpawnVfxForCurrentZone(this.Plugin.ClientState.TerritoryType);
|
this.SpawnVfxForCurrentZone(this.Plugin.ClientState.TerritoryType);
|
||||||
@ -26,7 +26,7 @@ namespace Tourist {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
this.Plugin.Framework.OnUpdateEvent -= this.OnFrameworkUpdate;
|
this.Plugin.Framework.Update -= this.OnFrameworkUpdate;
|
||||||
this.Plugin.ClientState.TerritoryChanged -= this.OnTerritoryChange;
|
this.Plugin.ClientState.TerritoryChanged -= this.OnTerritoryChange;
|
||||||
this.RemoveAllVfx();
|
this.RemoveAllVfx();
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ using Dalamud.Game.ClientState;
|
|||||||
using Dalamud.Game.Command;
|
using Dalamud.Game.Command;
|
||||||
using Dalamud.Game.Gui;
|
using Dalamud.Game.Gui;
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
|
using Dalamud.IoC;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using FFXIVWeather.Lumina;
|
using FFXIVWeather.Lumina;
|
||||||
|
|
||||||
@ -15,13 +16,27 @@ namespace Tourist {
|
|||||||
public string Name => "Tourist";
|
public string Name => "Tourist";
|
||||||
|
|
||||||
internal DalamudPluginInterface Interface { get; }
|
internal DalamudPluginInterface Interface { get; }
|
||||||
internal ClientState ClientState { get; }
|
|
||||||
internal CommandManager CommandManager { get; }
|
[PluginService]
|
||||||
internal DataManager DataManager { get; }
|
internal ClientState ClientState { get; init; } = null!;
|
||||||
internal Framework Framework { get; }
|
|
||||||
internal GameGui GameGui { get; }
|
[PluginService]
|
||||||
internal SeStringManager SeStringManager { get; }
|
internal CommandManager CommandManager { get; init; } = null!;
|
||||||
internal SigScanner SigScanner { get; }
|
|
||||||
|
[PluginService]
|
||||||
|
internal DataManager DataManager { get; init; } = null!;
|
||||||
|
|
||||||
|
[PluginService]
|
||||||
|
internal Framework Framework { get; init; } = null!;
|
||||||
|
|
||||||
|
[PluginService]
|
||||||
|
internal GameGui GameGui { get; init; } = null!;
|
||||||
|
|
||||||
|
[PluginService]
|
||||||
|
internal SeStringManager SeStringManager { get; init; } = null!;
|
||||||
|
|
||||||
|
[PluginService]
|
||||||
|
internal SigScanner SigScanner { get; init; } = null!;
|
||||||
|
|
||||||
internal Configuration Config { get; }
|
internal Configuration Config { get; }
|
||||||
internal PluginUi Ui { get; }
|
internal PluginUi Ui { get; }
|
||||||
@ -30,24 +45,8 @@ namespace Tourist {
|
|||||||
private Commands Commands { get; }
|
private Commands Commands { get; }
|
||||||
internal Markers Markers { get; }
|
internal Markers Markers { get; }
|
||||||
|
|
||||||
public Plugin(
|
public Plugin(DalamudPluginInterface pluginInterface) {
|
||||||
DalamudPluginInterface pluginInterface,
|
|
||||||
ClientState clientState,
|
|
||||||
CommandManager commandManager,
|
|
||||||
DataManager dataManager,
|
|
||||||
Framework framework,
|
|
||||||
GameGui gameGui,
|
|
||||||
SeStringManager seStringManager,
|
|
||||||
SigScanner sigScanner
|
|
||||||
) {
|
|
||||||
this.Interface = pluginInterface;
|
this.Interface = pluginInterface;
|
||||||
this.ClientState = clientState;
|
|
||||||
this.CommandManager = commandManager;
|
|
||||||
this.DataManager = dataManager;
|
|
||||||
this.Framework = framework;
|
|
||||||
this.GameGui = gameGui;
|
|
||||||
this.SeStringManager = seStringManager;
|
|
||||||
this.SigScanner = sigScanner;
|
|
||||||
|
|
||||||
this.Config = this.Interface.GetPluginConfig() as Configuration ?? new Configuration();
|
this.Config = this.Interface.GetPluginConfig() as Configuration ?? new Configuration();
|
||||||
this.Config.Initialise(this);
|
this.Config.Initialise(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user