aboutsummaryrefslogtreecommitdiffstats
path: root/SamplePlugin/Plugin.cs
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2024-08-27 22:21:18 -0700
committerPinapelz <yukais@pinapelz.com>2024-08-27 22:21:18 -0700
commit72f85fd952c8e53230c968ef9a433644dae90254 (patch)
treea93b73e9d045243cdc4ee467376ef8573f297d2c /SamplePlugin/Plugin.cs
parentb8c43fbe717d794284c6c4578c9c00ae8e26d711 (diff)
Initial Version 1.0.0.0
Diffstat (limited to 'SamplePlugin/Plugin.cs')
-rw-r--r--SamplePlugin/Plugin.cs73
1 files changed, 0 insertions, 73 deletions
diff --git a/SamplePlugin/Plugin.cs b/SamplePlugin/Plugin.cs
deleted file mode 100644
index b8e859b..0000000
--- a/SamplePlugin/Plugin.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-using Dalamud.Game.Command;
-using Dalamud.IoC;
-using Dalamud.Plugin;
-using System.IO;
-using Dalamud.Interface.Windowing;
-using Dalamud.Plugin.Services;
-using SamplePlugin.Windows;
-
-namespace SamplePlugin;
-
-public sealed class Plugin : IDalamudPlugin
-{
- [PluginService] internal static IDalamudPluginInterface PluginInterface { get; private set; } = null!;
- [PluginService] internal static ITextureProvider TextureProvider { get; private set; } = null!;
- [PluginService] internal static ICommandManager CommandManager { get; private set; } = null!;
-
- private const string CommandName = "/pmycommand";
-
- public Configuration Configuration { get; init; }
-
- public readonly WindowSystem WindowSystem = new("SamplePlugin");
- private ConfigWindow ConfigWindow { get; init; }
- private MainWindow MainWindow { get; init; }
-
- public Plugin()
- {
- Configuration = PluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
-
- // you might normally want to embed resources and load them from the manifest stream
- var goatImagePath = Path.Combine(PluginInterface.AssemblyLocation.Directory?.FullName!, "goat.png");
-
- ConfigWindow = new ConfigWindow(this);
- MainWindow = new MainWindow(this, goatImagePath);
-
- WindowSystem.AddWindow(ConfigWindow);
- WindowSystem.AddWindow(MainWindow);
-
- CommandManager.AddHandler(CommandName, new CommandInfo(OnCommand)
- {
- HelpMessage = "A useful message to display in /xlhelp"
- });
-
- PluginInterface.UiBuilder.Draw += DrawUI;
-
- // This adds a button to the plugin installer entry of this plugin which allows
- // to toggle the display status of the configuration ui
- PluginInterface.UiBuilder.OpenConfigUi += ToggleConfigUI;
-
- // Adds another button that is doing the same but for the main ui of the plugin
- PluginInterface.UiBuilder.OpenMainUi += ToggleMainUI;
- }
-
- public void Dispose()
- {
- WindowSystem.RemoveAllWindows();
-
- ConfigWindow.Dispose();
- MainWindow.Dispose();
-
- CommandManager.RemoveHandler(CommandName);
- }
-
- private void OnCommand(string command, string args)
- {
- // in response to the slash command, just toggle the display status of our main ui
- ToggleMainUI();
- }
-
- private void DrawUI() => WindowSystem.Draw();
-
- public void ToggleConfigUI() => ConfigWindow.Toggle();
- public void ToggleMainUI() => MainWindow.Toggle();
-}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage