mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Use the oldest user config file available when there happens to be multiple config files available.
This commit is contained in:
parent
383c40b992
commit
f6d08f54e6
@ -35,7 +35,11 @@ namespace osu.Game.IO
|
||||
{
|
||||
var songsDirectoryPath = Path.Combine(BasePath, stable_default_songs_path);
|
||||
|
||||
var configFile = GetFiles(".", "osu!.*.cfg").SingleOrDefault();
|
||||
// enumerate the user config files available in case the user migrated their files from another pc / operating system.
|
||||
var foundConfigFiles = GetFiles(".", "osu!.*.cfg");
|
||||
|
||||
// if more than one config file is found, let's use the oldest one (where the username in the filename doesn't match the local username).
|
||||
var configFile = foundConfigFiles.Count() > 1 ? foundConfigFiles.FirstOrDefault(filename => !filename[5..^4].Contains(Environment.UserName, StringComparison.Ordinal)) : foundConfigFiles.FirstOrDefault();
|
||||
|
||||
if (configFile == null)
|
||||
return songsDirectoryPath;
|
||||
|
Loading…
Reference in New Issue
Block a user