-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad4ac9a
commit be720ab
Showing
11 changed files
with
79 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.vs/ | ||
obj/ | ||
bin/ | ||
*.user | ||
*.user | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
using Dalamud.Game; | ||
using Dalamud.Game.Command; | ||
using Dalamud.Interface.Windowing; | ||
using Dalamud.IoC; | ||
using Dalamud.Plugin; | ||
using Dalamud.Plugin.Services; | ||
|
||
namespace MoveFurniture; | ||
namespace TargetFurniture; | ||
|
||
public class Service | ||
public class Service | ||
{ | ||
public static void Initialize(DalamudPluginInterface pluginInterface) | ||
=> pluginInterface.Create<Service>(); | ||
public static void Initialize(DalamudPluginInterface pluginInterface) => pluginInterface.Create<Service>(); | ||
|
||
public const string PluginName = "Target Furniture"; | ||
|
||
[PluginService] public static DalamudPluginInterface PluginInterface { get; set; } = null!; | ||
[PluginService] public static SigScanner SigScanner { get; set; } = null!; | ||
[PluginService] public static CommandManager Commands { get; private set; } = null!; | ||
[PluginService] public static DalamudPluginInterface PluginInterface { get; private set; } = null!; | ||
[PluginService] public static ISigScanner SigScanner { get; private set; } = null!; | ||
[PluginService] public static ICommandManager Commands { get; private set; } = null!; | ||
|
||
public static PluginMemory Memory { get; set; } = null!; | ||
public static Configuration Configuration { get; set; } = null!; | ||
public static WindowSystem WindowSystem { get; } = new WindowSystem(PluginName); | ||
public static WindowSystem WindowSystem { get; } = new(PluginName); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,61 @@ | ||
using Dalamud.Game.Command; | ||
using Dalamud.Plugin; | ||
using TargetFurniture; | ||
|
||
namespace MoveFurniture; | ||
namespace TargetFurniture; | ||
public class TargetFurniture : IDalamudPlugin | ||
{ | ||
public string Name => "Target Furniture"; | ||
//public static string Name => "Target Furniture"; | ||
|
||
private const string cmdConfig = "/targetfurniture"; | ||
private const string cmdConfigShort = "/tfcfg"; | ||
private const string CmdConfig = "/targetfurniture"; | ||
private const string CmdConfigShort = "/tfcfg"; | ||
|
||
public ContextMenuHousing PluginContextMenu; | ||
private readonly ContextMenuHousing _pluginContextMenu; | ||
|
||
private static PluginUI PluginUI = null!; | ||
private static PluginUi _pluginUi = null!; | ||
|
||
public TargetFurniture(DalamudPluginInterface pluginInterface) | ||
{ | ||
|
||
Service.Initialize(pluginInterface); | ||
Service.Configuration = Configuration.Load(); | ||
Service.PluginInterface!.UiBuilder.Draw += Service.WindowSystem.Draw; | ||
Service.PluginInterface!.UiBuilder.OpenConfigUi += OnOpenConfigUi; | ||
Service.PluginInterface.UiBuilder.Draw += Service.WindowSystem.Draw; | ||
Service.PluginInterface.UiBuilder.OpenConfigUi += OnOpenConfigUi; | ||
|
||
Service.Memory = new(); | ||
Service.Memory = new PluginMemory(); | ||
|
||
PluginUI = new PluginUI(); | ||
_pluginUi = new PluginUi(); | ||
|
||
PluginContextMenu = new(); | ||
PluginContextMenu.Toggle(); | ||
_pluginContextMenu = new ContextMenuHousing(); | ||
_pluginContextMenu.Toggle(); | ||
|
||
Service.Commands.AddHandler(cmdConfig, new CommandInfo(OnCommand) | ||
Service.Commands.AddHandler(CmdConfig, new CommandInfo(OnCommand) | ||
{ | ||
HelpMessage = "Open Config Window" | ||
}); | ||
|
||
Service.Commands.AddHandler(cmdConfigShort, new CommandInfo(OnCommand) | ||
Service.Commands.AddHandler(CmdConfigShort, new CommandInfo(OnCommand) | ||
{ | ||
HelpMessage = "Short Command for the Config Window " | ||
}); | ||
} | ||
|
||
private void OnCommand(string command, string args) | ||
private static void OnCommand(string command, string args) | ||
{ | ||
OnOpenConfigUi(); | ||
} | ||
|
||
private void OnOpenConfigUi() | ||
=> PluginUI.Toggle(); | ||
private static void OnOpenConfigUi() | ||
=> _pluginUi.Toggle(); | ||
|
||
public void Dispose() | ||
{ | ||
Service.Configuration.Save(); | ||
|
||
PluginContextMenu.Dispose(); | ||
PluginUI.Dispose(); | ||
_pluginContextMenu.Dispose(); | ||
_pluginUi.Dispose(); | ||
|
||
Service.Commands.RemoveHandler(cmdConfig); | ||
Service.Commands.RemoveHandler(cmdConfigShort); | ||
Service.PluginInterface!.UiBuilder.Draw -= Service.WindowSystem.Draw; | ||
Service.Commands.RemoveHandler(CmdConfig); | ||
Service.Commands.RemoveHandler(CmdConfigShort); | ||
Service.PluginInterface.UiBuilder.Draw -= Service.WindowSystem.Draw; | ||
Service.PluginInterface.UiBuilder.OpenConfigUi -= OnOpenConfigUi; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters