who's ready for minipenumbra
This commit is contained in:
parent
4615cb2b0f
commit
4d6565841e
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Text;
|
||||||
using Dalamud.Game.Command;
|
using Dalamud.Game.Command;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using Lumina.Excel.GeneratedSheets;
|
using Lumina.Excel.GeneratedSheets;
|
||||||
|
@ -5,18 +6,19 @@ using Lumina.Excel.GeneratedSheets;
|
||||||
namespace OrangeGuidanceTomestone;
|
namespace OrangeGuidanceTomestone;
|
||||||
|
|
||||||
internal class Commands : IDisposable {
|
internal class Commands : IDisposable {
|
||||||
|
private const string CommandName = "/ogt";
|
||||||
private Plugin Plugin { get; }
|
private Plugin Plugin { get; }
|
||||||
|
|
||||||
internal Commands(Plugin plugin) {
|
internal Commands(Plugin plugin) {
|
||||||
this.Plugin = plugin;
|
this.Plugin = plugin;
|
||||||
|
|
||||||
this.Plugin.CommandManager.AddHandler("/ogt", new CommandInfo(this.OnCommand) {
|
this.Plugin.CommandManager.AddHandler(CommandName, new CommandInfo(this.OnCommand) {
|
||||||
HelpMessage = "Toggle UI",
|
HelpMessage = $"Toggle UI - try {CommandName} help",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
this.Plugin.CommandManager.RemoveHandler("/ogt");
|
this.Plugin.CommandManager.RemoveHandler(CommandName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCommand(string command, string arguments) {
|
private void OnCommand(string command, string arguments) {
|
||||||
|
@ -65,6 +67,37 @@ internal class Commands : IDisposable {
|
||||||
case "refresh":
|
case "refresh":
|
||||||
this.Plugin.Messages.SpawnVfx();
|
this.Plugin.Messages.SpawnVfx();
|
||||||
break;
|
break;
|
||||||
|
case "viewer":
|
||||||
|
this.Plugin.Ui.Viewer.Visible ^= true;
|
||||||
|
break;
|
||||||
|
case "help": {
|
||||||
|
var sb = new StringBuilder("\n");
|
||||||
|
sb.Append(CommandName);
|
||||||
|
sb.Append(" - open the main interface");
|
||||||
|
|
||||||
|
sb.Append('\n');
|
||||||
|
sb.Append(CommandName);
|
||||||
|
sb.Append(" ban - bans the current zone, hiding messages");
|
||||||
|
|
||||||
|
sb.Append('\n');
|
||||||
|
sb.Append(CommandName);
|
||||||
|
sb.Append(" unban - unbans the current zone, allowing messages to appear");
|
||||||
|
|
||||||
|
sb.Append('\n');
|
||||||
|
sb.Append(CommandName);
|
||||||
|
sb.Append(" refresh - refreshes the messages in the current zone");
|
||||||
|
|
||||||
|
sb.Append('\n');
|
||||||
|
sb.Append(CommandName);
|
||||||
|
sb.Append(" viewer - toggle the message viewer window");
|
||||||
|
|
||||||
|
sb.Append('\n');
|
||||||
|
sb.Append(CommandName);
|
||||||
|
sb.Append(" help - show this help");
|
||||||
|
|
||||||
|
this.Plugin.ChatGui.Print(sb.ToString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
this.Plugin.Ui.MainWindow.Visible ^= true;
|
this.Plugin.Ui.MainWindow.Visible ^= true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -37,9 +37,10 @@ internal class Viewer {
|
||||||
if (nearby.Count == 0) {
|
if (nearby.Count == 0) {
|
||||||
if (this.Plugin.Config.AutoViewer) {
|
if (this.Plugin.Config.AutoViewer) {
|
||||||
this.Visible = false;
|
this.Visible = false;
|
||||||
|
} else {
|
||||||
|
ImGui.TextUnformatted("No nearby messages");
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TextUnformatted("No nearby messages");
|
|
||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user