1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Update OsuConfigManager in line with ConfigManager logging changes

This commit is contained in:
Dean Herbert 2022-08-22 17:03:20 +09:00
parent 3fb3a18e68
commit c86a75aa5f

View File

@ -4,10 +4,8 @@
#nullable disable
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using osu.Framework.Configuration;
using osu.Framework.Configuration.Tracking;
using osu.Framework.Extensions;
@ -31,6 +29,12 @@ namespace osu.Game.Configuration
[ExcludeFromDynamicCompile]
public class OsuConfigManager : IniConfigManager<OsuSetting>
{
public OsuConfigManager(Storage storage)
: base(storage)
{
Migrate();
}
protected override void InitialiseDefaults()
{
// UI/selection defaults
@ -172,12 +176,9 @@ namespace osu.Game.Configuration
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
}
public IDictionary<OsuSetting, string> GetLoggableState() =>
new Dictionary<OsuSetting, string>(ConfigStore.Where(kvp => !keyContainsPrivateInformation(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToString()));
private static bool keyContainsPrivateInformation(OsuSetting argKey)
protected override bool CheckLookupContainsPrivateInformation(OsuSetting lookup)
{
switch (argKey)
switch (lookup)
{
case OsuSetting.Token:
return true;
@ -186,12 +187,6 @@ namespace osu.Game.Configuration
return false;
}
public OsuConfigManager(Storage storage)
: base(storage)
{
Migrate();
}
public void Migrate()
{
// arrives as 2020.123.0