mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
perf: show whether plugin toggle is enable or disable (#2189)
This commit is contained in:
parent
8939cac80f
commit
9815cf1d88
1 changed files with 7 additions and 10 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
|
@ -216,7 +216,12 @@ internal class PluginManagementCommandHandler : IInternalDisposableService
|
|||
|
||||
this.chat.Print(onSuccess);
|
||||
}
|
||||
|
||||
|
||||
if (operation == PluginCommandOperation.Toggle)
|
||||
{
|
||||
operation = plugin.State == PluginState.Loaded ? PluginCommandOperation.Disable : PluginCommandOperation.Enable;
|
||||
}
|
||||
|
||||
switch (operation)
|
||||
{
|
||||
case PluginCommandOperation.Enable:
|
||||
|
|
@ -235,14 +240,6 @@ internal class PluginManagementCommandHandler : IInternalDisposableService
|
|||
Loc.Localize("PluginCommandsDisableFailed", "Failed to disable plugin \"{0}\". Please check the console for errors.").Format(plugin.Name)))
|
||||
.ConfigureAwait(false);
|
||||
break;
|
||||
case PluginCommandOperation.Toggle:
|
||||
this.chat.Print(Loc.Localize("PluginCommandsToggling", "Toggling plugin \"{0}\"...").Format(plugin.Name));
|
||||
Task.Run(() => plugin.State == PluginState.Loaded ? plugin.UnloadAsync() : plugin.LoadAsync(PluginLoadReason.Installer))
|
||||
.ContinueWith(t => Continuation(t,
|
||||
Loc.Localize("PluginCommandsToggleSuccess", "Plugin \"{0}\" toggled.").Format(plugin.Name),
|
||||
Loc.Localize("PluginCommandsToggleFailed", "Failed to toggle plugin \"{0}\". Please check the console for errors.").Format(plugin.Name)))
|
||||
.ConfigureAwait(false);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(operation), operation, null);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue