Skip to content

Commit

Permalink
feat: add overload for explicit commands
Browse files Browse the repository at this point in the history
  • Loading branch information
xCykrix committed Jul 18, 2024
1 parent a29d49a commit 2818b49
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Module/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,26 @@ namespace DalamudSystem.Module;
public abstract class IModule : Window, IDisposable
{
public readonly string ModuleName;
public readonly string ModuleCommand;
public readonly Every Every = new Every();

public IModule(string ModuleName, ImGuiWindowFlags ImGuiFlags) : base(ModuleName, ImGuiFlags)
{
this.ModuleName = ModuleName;
this.ModuleCommand = ModuleName.ToLower();
}

public IModule(string ModuleName, string ModuleCommand, ImGuiWindowFlags ImGuiFlags) : base(ModuleName, ImGuiFlags)
{
this.ModuleName = ModuleName;
this.ModuleCommand = ModuleCommand.ToLower();
}

internal void Load()
{
SetWindowOptions();
ICoreManager.WindowManager.AddWindow(this);
ICoreManager.Commands.AddHandler($"/{ModuleName.ToLower()}", new CommandInfo(
ICoreManager.Commands.AddHandler($"/{ModuleCommand.ToLower()}", new CommandInfo(
(command, args) =>
{
Toggle();
Expand Down

0 comments on commit 2818b49

Please sign in to comment.