mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
fix: ensure that toggle button stays enabled while enabling
This commit is contained in:
parent
3c8e474fe5
commit
4c177d32b4
1 changed files with 8 additions and 0 deletions
|
|
@ -108,7 +108,9 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
|
|
||||||
private OperationStatus installStatus = OperationStatus.Idle;
|
private OperationStatus installStatus = OperationStatus.Idle;
|
||||||
private OperationStatus updateStatus = OperationStatus.Idle;
|
private OperationStatus updateStatus = OperationStatus.Idle;
|
||||||
|
|
||||||
private OperationStatus enableDisableStatus = OperationStatus.Idle;
|
private OperationStatus enableDisableStatus = OperationStatus.Idle;
|
||||||
|
private Guid enableDisableWorkingPluginId = Guid.Empty;
|
||||||
|
|
||||||
private LoadingIndicatorKind loadingIndicatorKind = LoadingIndicatorKind.Unknown;
|
private LoadingIndicatorKind loadingIndicatorKind = LoadingIndicatorKind.Unknown;
|
||||||
|
|
||||||
|
|
@ -2477,6 +2479,10 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
if (ImGui.IsItemHovered())
|
if (ImGui.IsItemHovered())
|
||||||
ImGui.SetTooltip(Locs.PluginButtonToolTip_UnloadFailed);
|
ImGui.SetTooltip(Locs.PluginButtonToolTip_UnloadFailed);
|
||||||
}
|
}
|
||||||
|
else if (this.enableDisableStatus == OperationStatus.InProgress && this.enableDisableWorkingPluginId == plugin.Manifest.WorkingPluginId)
|
||||||
|
{
|
||||||
|
ImGuiComponents.DisabledToggleButton(toggleId, this.loadingIndicatorKind == LoadingIndicatorKind.EnablingSingle);
|
||||||
|
}
|
||||||
else if (disabled || inMultipleProfiles || inSingleNonDefaultProfileWhichIsDisabled)
|
else if (disabled || inMultipleProfiles || inSingleNonDefaultProfileWhichIsDisabled)
|
||||||
{
|
{
|
||||||
ImGuiComponents.DisabledToggleButton(toggleId, isLoadedAndUnloadable);
|
ImGuiComponents.DisabledToggleButton(toggleId, isLoadedAndUnloadable);
|
||||||
|
|
@ -2516,6 +2522,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
{
|
{
|
||||||
this.enableDisableStatus = OperationStatus.InProgress;
|
this.enableDisableStatus = OperationStatus.InProgress;
|
||||||
this.loadingIndicatorKind = LoadingIndicatorKind.DisablingSingle;
|
this.loadingIndicatorKind = LoadingIndicatorKind.DisablingSingle;
|
||||||
|
this.enableDisableWorkingPluginId = plugin.Manifest.WorkingPluginId;
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
|
|
@ -2536,6 +2543,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
{
|
{
|
||||||
this.enableDisableStatus = OperationStatus.InProgress;
|
this.enableDisableStatus = OperationStatus.InProgress;
|
||||||
this.loadingIndicatorKind = LoadingIndicatorKind.EnablingSingle;
|
this.loadingIndicatorKind = LoadingIndicatorKind.EnablingSingle;
|
||||||
|
this.enableDisableWorkingPluginId = plugin.Manifest.WorkingPluginId;
|
||||||
|
|
||||||
await applicableProfile.AddOrUpdateAsync(plugin.Manifest.InternalName, true, false);
|
await applicableProfile.AddOrUpdateAsync(plugin.Manifest.InternalName, true, false);
|
||||||
await plugin.LoadAsync(PluginLoadReason.Installer);
|
await plugin.LoadAsync(PluginLoadReason.Installer);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue