mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 21:24:16 +01:00
Add option to auto-update disabled plugins
This commit is contained in:
parent
b1c874c123
commit
b4e62571a6
3 changed files with 10 additions and 1 deletions
|
|
@ -498,6 +498,11 @@ internal sealed class DalamudConfiguration : IInternalDisposableService
|
|||
/// </summary>
|
||||
public bool SendUpdateNotificationToChat { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether disabled plugins should be auto-updated.
|
||||
/// </summary>
|
||||
public bool UpdateDisabledPlugins { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating where notifications are anchored to on the screen.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ namespace Dalamud.Interface.Internal.Windows.Settings.Tabs;
|
|||
public class SettingsTabAutoUpdates : SettingsTab
|
||||
{
|
||||
private AutoUpdateBehavior behavior;
|
||||
private bool updateDisabledPlugins;
|
||||
private bool checkPeriodically;
|
||||
private bool chatNotification;
|
||||
private string pickerSearch = string.Empty;
|
||||
|
|
@ -66,6 +67,7 @@ public class SettingsTabAutoUpdates : SettingsTab
|
|||
|
||||
ImGuiHelpers.ScaledDummy(8);
|
||||
|
||||
ImGui.Checkbox(Loc.Localize("DalamudSettingsAutoUpdateDisabledPlugins", "Auto-Update plugins that are currently disabled"), ref this.updateDisabledPlugins);
|
||||
ImGui.Checkbox(Loc.Localize("DalamudSettingsAutoUpdateChatMessage", "Show notification about updates available in chat"), ref this.chatNotification);
|
||||
ImGui.Checkbox(Loc.Localize("DalamudSettingsAutoUpdatePeriodically", "Periodically check for new updates while playing"), ref this.checkPeriodically);
|
||||
ImGuiHelpers.SafeTextColoredWrapped(ImGuiColors.DalamudGrey, Loc.Localize("DalamudSettingsAutoUpdatePeriodicallyHint",
|
||||
|
|
@ -237,6 +239,7 @@ public class SettingsTabAutoUpdates : SettingsTab
|
|||
var configuration = Service<DalamudConfiguration>.Get();
|
||||
|
||||
this.behavior = configuration.AutoUpdateBehavior ?? AutoUpdateBehavior.None;
|
||||
this.updateDisabledPlugins = configuration.UpdateDisabledPlugins;
|
||||
this.chatNotification = configuration.SendUpdateNotificationToChat;
|
||||
this.checkPeriodically = configuration.CheckPeriodicallyForUpdates;
|
||||
this.autoUpdatePreferences = configuration.PluginAutoUpdatePreferences;
|
||||
|
|
@ -249,6 +252,7 @@ public class SettingsTabAutoUpdates : SettingsTab
|
|||
var configuration = Service<DalamudConfiguration>.Get();
|
||||
|
||||
configuration.AutoUpdateBehavior = this.behavior;
|
||||
configuration.UpdateDisabledPlugins = this.updateDisabledPlugins;
|
||||
configuration.SendUpdateNotificationToChat = this.chatNotification;
|
||||
configuration.CheckPeriodicallyForUpdates = this.checkPeriodically;
|
||||
configuration.PluginAutoUpdatePreferences = this.autoUpdatePreferences;
|
||||
|
|
|
|||
|
|
@ -460,7 +460,7 @@ internal class AutoUpdateManager : IServiceType
|
|||
.Where(
|
||||
p =>
|
||||
!p.InstalledPlugin.IsDev && // Never update dev-plugins
|
||||
p.InstalledPlugin.IsWantedByAnyProfile && // Never update plugins that are not wanted by any profile(not enabled)
|
||||
(p.InstalledPlugin.IsWantedByAnyProfile || this.config.UpdateDisabledPlugins) && // Never update plugins that are not wanted by any profile(not enabled)
|
||||
!p.InstalledPlugin.Manifest.ScheduledForDeletion); // Never update plugins that we want to get rid of
|
||||
|
||||
return updateablePlugins.Where(FilterPlugin).ToList();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue