Merge pull request #1198 from Caraxi/installedplugins

Add `<DalamudPluginInterface>.InstalledPlugins`
This commit is contained in:
goat 2023-05-13 15:46:07 +02:00 committed by GitHub
commit fa73ccd3ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -193,13 +193,20 @@ public sealed class DalamudPluginInterface : IDisposable
/// <summary>
/// Gets a list of installed plugin names.
/// </summary>
[Obsolete($"This property is obsolete. Use {nameof(InstalledPlugins)} instead.")]
public List<string> PluginNames => Service<PluginManager>.Get().InstalledPlugins.Select(p => p.Manifest.Name).ToList();
/// <summary>
/// Gets a list of installed plugin internal names.
/// </summary>
[Obsolete($"This property is obsolete. Use {nameof(InstalledPlugins)} instead.")]
public List<string> PluginInternalNames => Service<PluginManager>.Get().InstalledPlugins.Select(p => p.Manifest.InternalName).ToList();
/// <summary>
/// Gets a list of installed plugins along with their current state.
/// </summary>
public IEnumerable<InstalledPluginState> InstalledPlugins => Service<PluginManager>.Get().InstalledPlugins.Select(p => new InstalledPluginState(p.Name, p.Manifest.InternalName, p.IsLoaded, p.Manifest.EffectiveVersion));
/// <summary>
/// Opens the <see cref="PluginInstallerWindow"/> with the plugin name set as search target.
/// </summary>

View file

@ -0,0 +1,5 @@
using System;
namespace Dalamud.Plugin;
public record InstalledPluginState(string Name, string InternalName, bool IsLoaded, Version Version);