mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Run command registration on framework.
This commit is contained in:
parent
348da38879
commit
c958935f40
2 changed files with 12 additions and 9 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Dalamud.Game;
|
||||
using Dalamud.Game.Command;
|
||||
using Dalamud.Game.Text.SeStringHandling;
|
||||
using ImGuiNET;
|
||||
|
|
@ -66,7 +67,8 @@ public class CommandHandler : IDisposable
|
|||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
|
||||
public CommandHandler( CommandManager commandManager, ObjectReloader objectReloader, Configuration config, Penumbra penumbra, ConfigWindow configWindow, Mod.Manager modManager,
|
||||
public CommandHandler( Framework framework, CommandManager commandManager, ObjectReloader objectReloader, Configuration config, Penumbra penumbra, ConfigWindow configWindow,
|
||||
Mod.Manager modManager,
|
||||
ModCollection.Manager collectionManager, ActorManager actors )
|
||||
{
|
||||
_commandManager = commandManager;
|
||||
|
|
@ -77,17 +79,18 @@ public class CommandHandler : IDisposable
|
|||
_modManager = modManager;
|
||||
_collectionManager = collectionManager;
|
||||
_actors = actors;
|
||||
framework.RunOnFrameworkThread( () =>
|
||||
{
|
||||
_commandManager.AddHandler( CommandName, new CommandInfo( OnCommand )
|
||||
{
|
||||
HelpMessage = "Without arguments, toggles the main window. Use /penumbra help to get further command help.",
|
||||
ShowInHelp = true,
|
||||
} );
|
||||
} );
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_commandManager.RemoveHandler( CommandName );
|
||||
}
|
||||
=> _commandManager.RemoveHandler( CommandName );
|
||||
|
||||
private void OnCommand( string command, string arguments )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ public class Penumbra : IDalamudPlugin
|
|||
};
|
||||
var btn = new LaunchButton( cfg );
|
||||
var system = new WindowSystem( Name );
|
||||
var cmd = new CommandHandler( Dalamud.Commands, ObjectReloader, Config, this, cfg, ModManager, CollectionManager, Actors );
|
||||
var cmd = new CommandHandler( Dalamud.Framework, Dalamud.Commands, ObjectReloader, Config, this, cfg, ModManager, CollectionManager, Actors );
|
||||
system.AddWindow( cfg );
|
||||
system.AddWindow( cfg.ModEditPopup );
|
||||
system.AddWindow( changelog );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue