Expose the InstalledFromUrl as SourceRepository in the DalamudPluginInterface.

This commit is contained in:
Ottermandias 2022-10-18 15:05:21 +02:00
parent 1c5383a335
commit 722564c19d
2 changed files with 9 additions and 2 deletions

View file

@ -40,7 +40,8 @@ namespace Dalamud.Plugin
/// <param name="assemblyLocation">Location of the assembly.</param>
/// <param name="reason">The reason the plugin was loaded.</param>
/// <param name="isDev">A value indicating whether this is a dev plugin.</param>
internal DalamudPluginInterface(string pluginName, FileInfo assemblyLocation, PluginLoadReason reason, bool isDev)
/// <param name="sourceRepository">The repository from which the plugin is installed.</param>
internal DalamudPluginInterface(string pluginName, FileInfo assemblyLocation, PluginLoadReason reason, bool isDev, string sourceRepository)
{
var configuration = Service<DalamudConfiguration>.Get();
var dataManager = Service<DataManager>.Get();
@ -53,6 +54,7 @@ namespace Dalamud.Plugin
this.configs = Service<PluginManager>.Get().PluginConfigs;
this.Reason = reason;
this.IsDev = isDev;
this.SourceRepository = isDev ? "DevPlugin" : sourceRepository;
this.LoadTime = DateTime.Now;
this.LoadTimeUTC = DateTime.UtcNow;
@ -122,6 +124,11 @@ namespace Dalamud.Plugin
/// </summary>
public FileInfo AssemblyLocation { get; }
/// <summary>
/// Gets the custom repository from which this plugin is installed, the main repo flag or "DevPlugin".
/// </summary>
public string SourceRepository { get; }
/// <summary>
/// Gets the directory your plugin configurations are stored in.
/// </summary>

View file

@ -400,7 +400,7 @@ internal class LocalPlugin : IDisposable
new PluginPatchData(this.DllFile);
this.DalamudInterface =
new DalamudPluginInterface(this.pluginAssembly.GetName().Name!, this.DllFile, reason, this.IsDev);
new DalamudPluginInterface(this.pluginAssembly.GetName().Name!, this.DllFile, reason, this.IsDev, this.Manifest.InstalledFromUrl );
if (this.Manifest.LoadSync && this.Manifest.LoadRequiredState is 0 or 1)
{