mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-14 20:54:17 +01:00
.
This commit is contained in:
parent
7710cfadfa
commit
2d6fd6015d
88 changed files with 2304 additions and 383 deletions
36
GlamourerOld/Services/CommandService.cs
Normal file
36
GlamourerOld/Services/CommandService.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using Dalamud.Game.Command;
|
||||
using Glamourer.Gui;
|
||||
|
||||
namespace Glamourer.Services;
|
||||
|
||||
public class CommandService : IDisposable
|
||||
{
|
||||
private const string HelpString = "[Copy|Apply|Save],[Name or PlaceHolder],<Name for Save>";
|
||||
private const string MainCommandString = "/glamourer";
|
||||
private const string ApplyCommandString = "/glamour";
|
||||
|
||||
private readonly CommandManager _commands;
|
||||
private readonly Interface _interface;
|
||||
|
||||
public CommandService(CommandManager commands, Interface ui)
|
||||
{
|
||||
_commands = commands;
|
||||
_interface = ui;
|
||||
|
||||
_commands.AddHandler(MainCommandString, new CommandInfo(OnGlamourer) { HelpMessage = "Open or close the Glamourer window." });
|
||||
_commands.AddHandler(ApplyCommandString, new CommandInfo(OnGlamour) { HelpMessage = $"Use Glamourer Functions: {HelpString}" });
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_commands.RemoveHandler(MainCommandString);
|
||||
_commands.RemoveHandler(ApplyCommandString);
|
||||
}
|
||||
|
||||
private void OnGlamourer(string command, string arguments)
|
||||
=> _interface.Toggle();
|
||||
|
||||
private void OnGlamour(string command, string arguments)
|
||||
{ }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue