30 lines
765 B
C#
30 lines
765 B
C#
using Dalamud.Game.Command;
|
|
|
|
namespace Screenie;
|
|
|
|
internal class Command : IDisposable {
|
|
private Plugin Plugin { get; }
|
|
private const string CommandName = "/screenie";
|
|
|
|
internal Command(Plugin plugin) {
|
|
this.Plugin = plugin;
|
|
|
|
this.Plugin.CommandManager.AddHandler(CommandName, new CommandInfo(this.OnCommand));
|
|
}
|
|
|
|
public void Dispose() {
|
|
this.Plugin.CommandManager.RemoveHandler(CommandName);
|
|
}
|
|
|
|
private void OnCommand(string command, string arguments) {
|
|
// TODO: eventually be able to do like /screenie --no-ui --format png
|
|
// etc.
|
|
if (arguments == "config") {
|
|
this.Plugin.Ui.Visible ^= true;
|
|
return;
|
|
}
|
|
|
|
this.Plugin.SaveScreenshot();
|
|
}
|
|
}
|