mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
fix: untangle devplugin StartOnBoot behaviour
This commit is contained in:
parent
ecbb5325d7
commit
2e1ace6afd
1 changed files with 23 additions and 2 deletions
|
|
@ -1273,17 +1273,38 @@ internal partial class PluginManager : IDisposable, IServiceType
|
||||||
{
|
{
|
||||||
Log.Information($"Loading dev plugin {name}");
|
Log.Information($"Loading dev plugin {name}");
|
||||||
var devPlugin = new LocalDevPlugin(dllFile, manifest);
|
var devPlugin = new LocalDevPlugin(dllFile, manifest);
|
||||||
loadPlugin &= !isBoot || devPlugin.StartOnBoot;
|
loadPlugin &= !isBoot;
|
||||||
|
|
||||||
var probablyInternalNameForThisPurpose = manifest?.InternalName ?? dllFile.Name;
|
var probablyInternalNameForThisPurpose = manifest?.InternalName ?? dllFile.Name;
|
||||||
|
|
||||||
var wantsInDefaultProfile =
|
var wantsInDefaultProfile =
|
||||||
this.profileManager.DefaultProfile.WantsPlugin(probablyInternalNameForThisPurpose);
|
this.profileManager.DefaultProfile.WantsPlugin(probablyInternalNameForThisPurpose);
|
||||||
if (wantsInDefaultProfile == false && devPlugin.StartOnBoot)
|
var wantsInAnyProfile = this.profileManager.GetWantState(probablyInternalNameForThisPurpose, false, false);
|
||||||
|
if (wantsInDefaultProfile == null)
|
||||||
{
|
{
|
||||||
|
// We don't know about this plugin, so we don't want to do anything here.
|
||||||
|
// The code below will take care of it and add it with the default value.
|
||||||
|
if (!wantsInAnyProfile)
|
||||||
|
loadPlugin = false;
|
||||||
|
}
|
||||||
|
else if (wantsInDefaultProfile == false && devPlugin.StartOnBoot)
|
||||||
|
{
|
||||||
|
// We didn't want this plugin, and StartOnBoot is on. That means we don't want it and it should stay off until manually enabled.
|
||||||
|
this.profileManager.DefaultProfile.AddOrUpdate(probablyInternalNameForThisPurpose, false, false);
|
||||||
|
}
|
||||||
|
else if (wantsInDefaultProfile == true && devPlugin.StartOnBoot)
|
||||||
|
{
|
||||||
|
// We wanted this plugin, and StartOnBoot is on. That means we actually do want it.
|
||||||
this.profileManager.DefaultProfile.AddOrUpdate(probablyInternalNameForThisPurpose, true, false);
|
this.profileManager.DefaultProfile.AddOrUpdate(probablyInternalNameForThisPurpose, true, false);
|
||||||
}
|
}
|
||||||
else if (wantsInDefaultProfile == true && !devPlugin.StartOnBoot)
|
else if (wantsInDefaultProfile == true && !devPlugin.StartOnBoot)
|
||||||
{
|
{
|
||||||
|
// We wanted this plugin, but StartOnBoot is off. This means we don't want it anymore.
|
||||||
|
this.profileManager.DefaultProfile.AddOrUpdate(probablyInternalNameForThisPurpose, false, false);
|
||||||
|
}
|
||||||
|
else if (wantsInDefaultProfile == false && !devPlugin.StartOnBoot)
|
||||||
|
{
|
||||||
|
// We didn't want this plugin, and StartOnBoot is off. We don't want it.
|
||||||
this.profileManager.DefaultProfile.AddOrUpdate(probablyInternalNameForThisPurpose, false, false);
|
this.profileManager.DefaultProfile.AddOrUpdate(probablyInternalNameForThisPurpose, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue