ui(client): recent profile selector

This commit is contained in:
Pascal
2025-11-20 06:49:21 +01:00
parent c0f013a6c5
commit e7aa79db64
7 changed files with 174 additions and 68 deletions

View File

@@ -7,19 +7,22 @@ public class AppConfig : ISettingsNode, ISettingsIdentifier
{
public static string Identifier => "pilz.appconfig";
public string? LastMinecraftProfilePath { get; set; }
public List<string> RecentMinecraftProfilePaths { get; } = [];
[JsonIgnore, Obsolete]
public string? ConfigFilePath { get; private set; }
[JsonProperty("ConfigFilePath"), Obsolete]
private string ConfigFilePathLegacy
[JsonProperty, Obsolete]
private string? LastMinecraftProfilePath
{
set => ConfigFilePath = value;
get => RecentMinecraftProfilePaths.FirstOrDefault();
set
{
if (!string.IsNullOrWhiteSpace(value))
RecentMinecraftProfilePaths.Insert(0, value);
}
}
public void Reset()
{
LastMinecraftProfilePath = null;
RecentMinecraftProfilePaths.Clear();
}
public static AppConfig Instance => Program.Settings.Get<AppConfig>();