diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs index 560c1e61a..b2dfe445e 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs @@ -2581,26 +2581,32 @@ internal class PluginInstallerWindow : Window, IDisposable if (localPlugin is LocalDevPlugin plugin) { + var isInDefaultProfile = + Service.Get().IsInDefaultProfile(localPlugin.Manifest.InternalName); + // https://colorswall.com/palette/2868/ var greenColor = new Vector4(0x5C, 0xB8, 0x5C, 0xFF) / 0xFF; var redColor = new Vector4(0xD9, 0x53, 0x4F, 0xFF) / 0xFF; // Load on boot - ImGui.PushStyleColor(ImGuiCol.Button, plugin.StartOnBoot ? greenColor : redColor); - ImGui.PushStyleColor(ImGuiCol.ButtonHovered, plugin.StartOnBoot ? greenColor : redColor); - - ImGui.SameLine(); - if (ImGuiComponents.IconButton(FontAwesomeIcon.PowerOff)) + using (ImRaii.Disabled(!isInDefaultProfile)) { - plugin.StartOnBoot ^= true; - configuration.QueueSave(); - } + ImGui.PushStyleColor(ImGuiCol.Button, plugin.StartOnBoot ? greenColor : redColor); + ImGui.PushStyleColor(ImGuiCol.ButtonHovered, plugin.StartOnBoot ? greenColor : redColor); - ImGui.PopStyleColor(2); + ImGui.SameLine(); + if (ImGuiComponents.IconButton(FontAwesomeIcon.PowerOff)) + { + plugin.StartOnBoot ^= true; + configuration.QueueSave(); + } - if (ImGui.IsItemHovered()) - { - ImGui.SetTooltip(Locs.PluginButtonToolTip_StartOnBoot); + ImGui.PopStyleColor(2); + + if (ImGui.IsItemHovered()) + { + ImGui.SetTooltip(isInDefaultProfile ? Locs.PluginButtonToolTip_StartOnBoot : Locs.PluginButtonToolTip_NeedsToBeInDefault); + } } // Automatic reload diff --git a/Dalamud/Plugin/Internal/PluginManager.cs b/Dalamud/Plugin/Internal/PluginManager.cs index c382ce3d8..781732776 100644 --- a/Dalamud/Plugin/Internal/PluginManager.cs +++ b/Dalamud/Plugin/Internal/PluginManager.cs @@ -862,10 +862,17 @@ Thanks and have fun!"; var devPlugin = new LocalDevPlugin(dllFile, manifest); loadPlugin &= !isBoot || devPlugin.StartOnBoot; - // If we're not loading it, make sure it's disabled - // NOTE: Should be taken care of below by the profile code - // if (!loadPlugin && !devPlugin.IsDisabled) - // devPlugin.Disable(); + var probablyInternalNameForThisPurpose = manifest?.InternalName ?? dllFile.Name; + var wantsInDefaultProfile = + this.profileManager.DefaultProfile.WantsPlugin(probablyInternalNameForThisPurpose); + if (wantsInDefaultProfile == false && devPlugin.StartOnBoot) + { + this.profileManager.DefaultProfile.AddOrUpdate(probablyInternalNameForThisPurpose, true, false); + } + else if (wantsInDefaultProfile == true && !devPlugin.StartOnBoot) + { + this.profileManager.DefaultProfile.AddOrUpdate(probablyInternalNameForThisPurpose, false, false); + } plugin = devPlugin; }