Merge branch 'net5' of github.com:goatcorp/Dalamud

This commit is contained in:
goat 2022-08-18 21:21:31 +02:00
commit f2c677bf97
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
7 changed files with 133 additions and 12 deletions

View file

@ -14,7 +14,7 @@ namespace Dalamud.Game.ClientState.GamePad
/// Will block game's gamepad input if <see cref="ImGuiConfigFlags.NavEnableGamepad"/> is set.
/// </summary>
[PluginInterface]
[InterfaceVersion("1.0.0")]
[InterfaceVersion("1.0")]
[ServiceManager.BlockingEarlyLoadedService]
public unsafe class GamepadState : IDisposable, IServiceType
{

View file

@ -2631,9 +2631,9 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller
public static string PluginContext_HidePlugin => Loc.Localize("InstallerHidePlugin", "Hide from installer");
public static string PluginContext_DeletePluginConfig => Loc.Localize("InstallerDeletePluginConfig", "Reset plugin");
public static string PluginContext_DeletePluginConfig => Loc.Localize("InstallerDeletePluginConfig", "Reset plugin configuration");
public static string PluginContext_DeletePluginConfigReload => Loc.Localize("InstallerDeletePluginConfigReload", "Reset plugin settings & reload");
public static string PluginContext_DeletePluginConfigReload => Loc.Localize("InstallerDeletePluginConfigReload", "Reset plugin configuration and reload");
#endregion

View file

@ -1128,17 +1128,18 @@ internal partial class PluginManager : IDisposable, IServiceType
}
/// <summary>
/// Unload the plugin, delete its configuration, and reload it.
/// Delete the plugin configuration, unload/reload it if loaded.
/// </summary>
/// <param name="plugin">The plugin.</param>
/// <exception cref="Exception">Throws if the plugin is still loading/unloading.</exception>
/// <returns>The task.</returns>
public async Task DeleteConfigurationAsync(LocalPlugin plugin)
{
if (plugin.State == PluginState.Loading || plugin.State == PluginState.Unloaded)
if (plugin.State is PluginState.Loading or PluginState.Unloading)
throw new Exception("Cannot delete configuration for a loading/unloading plugin");
if (plugin.IsLoaded)
var isReloading = plugin.IsLoaded;
if (isReloading)
await plugin.UnloadAsync();
for (var waitUntil = Environment.TickCount64 + 1000; Environment.TickCount64 < waitUntil;)
@ -1154,8 +1155,11 @@ internal partial class PluginManager : IDisposable, IServiceType
}
}
// Let's indicate "installer" here since this is supposed to be a fresh install
await plugin.LoadAsync(PluginLoadReason.Installer);
if (isReloading)
{
// Let's indicate "installer" here since this is supposed to be a fresh install
await plugin.LoadAsync(PluginLoadReason.Installer);
}
}
/// <summary>