Skip to content

Commit

Permalink
1.0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
paissaheavyindustries committed Jul 9, 2024
1 parent 4c6f766 commit 597b4c4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions WheresMouse/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ public sealed class Plugin : IDalamudPlugin

public string Name => "Where's Mouse";

private DalamudPluginInterface _pi { get; init; }
private IDalamudPluginInterface _pi { get; init; }
private ICommandManager _cm { get; init; }
private IClientState _cs { get; init; }
private ICondition _cd { get; init; }
private IPluginLog _lo { get; init; }

private Wherenator _where = new Wherenator();
private Config _cfg;
Expand All @@ -37,20 +38,23 @@ public sealed class Plugin : IDalamudPlugin
private List<Maustrale> maustrales = new List<Maustrale>();

public Plugin(
[RequiredVersion("1.0")] DalamudPluginInterface pluginInterface,
[RequiredVersion("1.0")] ICommandManager commandManager,
[RequiredVersion("1.0")] IClientState clientState,
[RequiredVersion("1.0")] IFramework framework,
[RequiredVersion("1.0")] IGameGui gameGui,
[RequiredVersion("1.0")] ICondition condition
IDalamudPluginInterface pluginInterface,
ICommandManager commandManager,
IClientState clientState,
IFramework framework,
IGameGui gameGui,
ICondition condition,
IPluginLog log
)
{
_pi = pluginInterface;
_cm = commandManager;
_cs = clientState;
_cd = condition;
_lo = log;
_cfg = _pi.GetPluginConfig() as Config ?? new Config();
_pi.UiBuilder.Draw += DrawUI;
_pi.UiBuilder.OpenMainUi += DrawConfigUI;
_pi.UiBuilder.OpenConfigUi += DrawConfigUI;
_cm.AddHandler("/wheremouse", new CommandInfo(OnCommand)
{
Expand All @@ -61,14 +65,15 @@ public Plugin(
public void Dispose()
{
_pi.UiBuilder.Draw -= DrawUI;
_pi.UiBuilder.OpenMainUi -= DrawConfigUI;
_pi.UiBuilder.OpenConfigUi -= DrawConfigUI;
SaveConfig();
_cm.RemoveHandler("/wheremouse");
}

public void SaveConfig()
{
PluginLog.Debug("Saving config");
_lo.Debug("Saving config");
_pi.SavePluginConfig(_cfg);
}

Expand Down
2 changes: 1 addition & 1 deletion WheresMouse/Where's Mouse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Platforms>x64</Platforms>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down

0 comments on commit 597b4c4

Please sign in to comment.