mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-19 06:17:43 +01:00
Merge remote-tracking branch 'origin/master' into apiX-rollup
This commit is contained in:
commit
263610c9e7
28 changed files with 1526 additions and 311 deletions
42
Dalamud/Configuration/Internal/AutoUpdatePreference.cs
Normal file
42
Dalamud/Configuration/Internal/AutoUpdatePreference.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
namespace Dalamud.Configuration.Internal;
|
||||
|
||||
/// <summary>
|
||||
/// Class representing a plugin that has opted in to auto-updating.
|
||||
/// </summary>
|
||||
internal class AutoUpdatePreference
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AutoUpdatePreference"/> class.
|
||||
/// </summary>
|
||||
/// <param name="pluginId">The unique ID representing the plugin.</param>
|
||||
public AutoUpdatePreference(Guid pluginId)
|
||||
{
|
||||
this.WorkingPluginId = pluginId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The kind of opt-in.
|
||||
/// </summary>
|
||||
public enum OptKind
|
||||
{
|
||||
/// <summary>
|
||||
/// Never auto-update this plugin.
|
||||
/// </summary>
|
||||
NeverUpdate,
|
||||
|
||||
/// <summary>
|
||||
/// Always auto-update this plugin, regardless of the user's settings.
|
||||
/// </summary>
|
||||
AlwaysUpdate,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the unique ID representing the plugin.
|
||||
/// </summary>
|
||||
public Guid WorkingPluginId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of opt-in.
|
||||
/// </summary>
|
||||
public OptKind Kind { get; set; } = OptKind.AlwaysUpdate;
|
||||
}
|
||||
|
|
@ -8,9 +8,9 @@ using System.Runtime.InteropServices;
|
|||
using Dalamud.Game.Text;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.FontIdentifier;
|
||||
using Dalamud.Interface.Internal.Windows.PluginInstaller;
|
||||
using Dalamud.Interface.Style;
|
||||
using Dalamud.IoC.Internal;
|
||||
using Dalamud.Plugin.Internal.AutoUpdate;
|
||||
using Dalamud.Plugin.Internal.Profiles;
|
||||
using Dalamud.Storage;
|
||||
using Dalamud.Utility;
|
||||
|
|
@ -80,10 +80,9 @@ internal sealed class DalamudConfiguration : IInternalDisposableService
|
|||
public string? LastVersion { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating the last seen FTUE version.
|
||||
/// Unused for now, added to prevent existing users from seeing level 0 FTUE.
|
||||
/// Gets or sets a dictionary of seen FTUE levels.
|
||||
/// </summary>
|
||||
public int SeenFtueLevel { get; set; } = 1;
|
||||
public Dictionary<string, int> SeenFtueLevels { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the last loaded Dalamud version.
|
||||
|
|
@ -196,6 +195,7 @@ internal sealed class DalamudConfiguration : IInternalDisposableService
|
|||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not plugins should be auto-updated.
|
||||
/// </summary>
|
||||
[Obsolete("Use AutoUpdateBehavior instead.")]
|
||||
public bool AutoUpdatePlugins { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -228,6 +228,11 @@ internal sealed class DalamudConfiguration : IInternalDisposableService
|
|||
/// </summary>
|
||||
public int LogLinesLimit { get; set; } = 10000;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list representing the command history for the Dalamud Console.
|
||||
/// </summary>
|
||||
public List<string> LogCommandHistory { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not the dev bar should open at startup.
|
||||
/// </summary>
|
||||
|
|
@ -429,7 +434,12 @@ internal sealed class DalamudConfiguration : IInternalDisposableService
|
|||
/// <summary>
|
||||
/// Gets or sets a list of plugins that testing builds should be downloaded for.
|
||||
/// </summary>
|
||||
public List<PluginTestingOptIn>? PluginTestingOptIns { get; set; }
|
||||
public List<PluginTestingOptIn> PluginTestingOptIns { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list of plugins that have opted into or out of auto-updating.
|
||||
/// </summary>
|
||||
public List<AutoUpdatePreference> PluginAutoUpdatePreferences { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the FFXIV window should be toggled to immersive mode.
|
||||
|
|
@ -464,6 +474,16 @@ internal sealed class DalamudConfiguration : IInternalDisposableService
|
|||
/// </summary>
|
||||
public PluginInstallerOpenKind PluginInstallerOpen { get; set; } = PluginInstallerOpenKind.AllPlugins;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating how auto-updating should behave.
|
||||
/// </summary>
|
||||
public AutoUpdateBehavior? AutoUpdateBehavior { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not users should be notified regularly about pending updates.
|
||||
/// </summary>
|
||||
public bool CheckPeriodicallyForUpdates { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Load a configuration from the provided path.
|
||||
/// </summary>
|
||||
|
|
@ -549,6 +569,7 @@ internal sealed class DalamudConfiguration : IInternalDisposableService
|
|||
|
||||
private void SetDefaults()
|
||||
{
|
||||
#pragma warning disable CS0618
|
||||
// "Reduced motion"
|
||||
if (!this.ReduceMotions.HasValue)
|
||||
{
|
||||
|
|
@ -570,6 +591,12 @@ internal sealed class DalamudConfiguration : IInternalDisposableService
|
|||
this.ReduceMotions = winAnimEnabled == 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Migrate old auto-update setting to new auto-update behavior
|
||||
this.AutoUpdateBehavior ??= this.AutoUpdatePlugins
|
||||
? Plugin.Internal.AutoUpdate.AutoUpdateBehavior.UpdateAll
|
||||
: Plugin.Internal.AutoUpdate.AutoUpdateBehavior.OnlyNotify;
|
||||
#pragma warning restore CS0618
|
||||
}
|
||||
|
||||
private void Save()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue