mirror of
https://github.com/ppy/osu
synced 2025-03-02 01:21:19 +00:00
Update OsuConfigManager
in line with ConfigManager
logging changes
This commit is contained in:
parent
3fb3a18e68
commit
c86a75aa5f
@ -4,10 +4,8 @@
|
|||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Configuration.Tracking;
|
using osu.Framework.Configuration.Tracking;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
@ -31,6 +29,12 @@ namespace osu.Game.Configuration
|
|||||||
[ExcludeFromDynamicCompile]
|
[ExcludeFromDynamicCompile]
|
||||||
public class OsuConfigManager : IniConfigManager<OsuSetting>
|
public class OsuConfigManager : IniConfigManager<OsuSetting>
|
||||||
{
|
{
|
||||||
|
public OsuConfigManager(Storage storage)
|
||||||
|
: base(storage)
|
||||||
|
{
|
||||||
|
Migrate();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void InitialiseDefaults()
|
protected override void InitialiseDefaults()
|
||||||
{
|
{
|
||||||
// UI/selection defaults
|
// UI/selection defaults
|
||||||
@ -172,12 +176,9 @@ namespace osu.Game.Configuration
|
|||||||
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
|
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IDictionary<OsuSetting, string> GetLoggableState() =>
|
protected override bool CheckLookupContainsPrivateInformation(OsuSetting lookup)
|
||||||
new Dictionary<OsuSetting, string>(ConfigStore.Where(kvp => !keyContainsPrivateInformation(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToString()));
|
|
||||||
|
|
||||||
private static bool keyContainsPrivateInformation(OsuSetting argKey)
|
|
||||||
{
|
{
|
||||||
switch (argKey)
|
switch (lookup)
|
||||||
{
|
{
|
||||||
case OsuSetting.Token:
|
case OsuSetting.Token:
|
||||||
return true;
|
return true;
|
||||||
@ -186,12 +187,6 @@ namespace osu.Game.Configuration
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OsuConfigManager(Storage storage)
|
|
||||||
: base(storage)
|
|
||||||
{
|
|
||||||
Migrate();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Migrate()
|
public void Migrate()
|
||||||
{
|
{
|
||||||
// arrives as 2020.123.0
|
// arrives as 2020.123.0
|
||||||
|
Loading…
Reference in New Issue
Block a user