mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
use a map to track ftue levels per-feature instead
This commit is contained in:
parent
ef72ebc72c
commit
08a411728c
2 changed files with 13 additions and 11 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
|
||||
|
|
@ -78,8 +79,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
|
|||
|
||||
private AutoUpdateBehavior? chosenAutoUpdateBehavior;
|
||||
|
||||
private int currentFtueLevel;
|
||||
private int updatedFtueLevel;
|
||||
private Dictionary<string, int> currentFtueLevels = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ChangelogWindow"/> class.
|
||||
|
|
@ -152,7 +152,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
|
|||
|
||||
this.chosenAutoUpdateBehavior = null;
|
||||
|
||||
this.currentFtueLevel = Service<DalamudConfiguration>.Get().SeenFtueLevel;
|
||||
this.currentFtueLevels = Service<DalamudConfiguration>.Get().SeenFtueLevels;
|
||||
|
||||
base.OnOpen();
|
||||
}
|
||||
|
|
@ -172,7 +172,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
|
|||
configuration.AutoUpdateBehavior = this.chosenAutoUpdateBehavior.Value;
|
||||
}
|
||||
|
||||
configuration.SeenFtueLevel = this.updatedFtueLevel;
|
||||
configuration.SeenFtueLevels = this.currentFtueLevels;
|
||||
configuration.QueueSave();
|
||||
}
|
||||
|
||||
|
|
@ -360,11 +360,11 @@ internal sealed class ChangelogWindow : Window, IDisposable
|
|||
this.apiBumpExplainerTexture.Value.ImGuiHandle,
|
||||
this.apiBumpExplainerTexture.Value.Size);
|
||||
|
||||
if (this.currentFtueLevel < FtueLevels.AutoUpdateBehavior)
|
||||
if (!this.currentFtueLevels.TryGetValue(FtueLevels.AutoUpdate.Name, out var autoUpdateLevel) || autoUpdateLevel < FtueLevels.AutoUpdate.AutoUpdateInitial)
|
||||
{
|
||||
if (DrawNextButton(State.AskAutoUpdate))
|
||||
{
|
||||
this.updatedFtueLevel = this.currentFtueLevel = FtueLevels.AutoUpdateBehavior;
|
||||
this.currentFtueLevels[FtueLevels.AutoUpdate.Name] = FtueLevels.AutoUpdate.AutoUpdateInitial;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -520,7 +520,10 @@ internal sealed class ChangelogWindow : Window, IDisposable
|
|||
|
||||
private static class FtueLevels
|
||||
{
|
||||
public const int Default = 1;
|
||||
public const int AutoUpdateBehavior = 2;
|
||||
public static class AutoUpdate
|
||||
{
|
||||
public const string Name = "AutoUpdate";
|
||||
public const int AutoUpdateInitial = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue