ui(client): recent profile selector
This commit is contained in:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user