mirror of
https://github.com/ppy/osu.git
synced 2025-02-10 08:13:19 +08:00
Move drawings.ini out of config subfolder
This commit is contained in:
parent
eec1e9ef4d
commit
08759da3a7
@ -136,7 +136,7 @@ namespace osu.Game.Tournament.Tests.NonVisual
|
|||||||
Assert.True(storage.Exists("drawings.txt"));
|
Assert.True(storage.Exists("drawings.txt"));
|
||||||
Assert.True(storage.Exists("drawings_results.txt"));
|
Assert.True(storage.Exists("drawings_results.txt"));
|
||||||
|
|
||||||
Assert.True(storage.ConfigurationStorage.Exists("drawings.ini"));
|
Assert.True(storage.Exists("drawings.ini"));
|
||||||
|
|
||||||
Assert.True(storage.Exists(videoFile));
|
Assert.True(storage.Exists(videoFile));
|
||||||
Assert.True(storage.Exists(modFile));
|
Assert.True(storage.Exists(modFile));
|
||||||
|
@ -15,9 +15,7 @@ namespace osu.Game.Tournament.IO
|
|||||||
{
|
{
|
||||||
private readonly Storage storage;
|
private readonly Storage storage;
|
||||||
internal readonly TournamentVideoResourceStore VideoStore;
|
internal readonly TournamentVideoResourceStore VideoStore;
|
||||||
internal readonly Storage ConfigurationStorage;
|
|
||||||
private const string default_tournament = "default";
|
private const string default_tournament = "default";
|
||||||
private const string config_directory = "config";
|
|
||||||
|
|
||||||
public TournamentStorage(Storage storage)
|
public TournamentStorage(Storage storage)
|
||||||
: base(storage.GetStorageForDirectory("tournaments"), string.Empty)
|
: base(storage.GetStorageForDirectory("tournaments"), string.Empty)
|
||||||
@ -40,8 +38,6 @@ namespace osu.Game.Tournament.IO
|
|||||||
ChangeTargetStorage(UnderlyingStorage.GetStorageForDirectory(default_tournament));
|
ChangeTargetStorage(UnderlyingStorage.GetStorageForDirectory(default_tournament));
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigurationStorage = UnderlyingStorage.GetStorageForDirectory(config_directory);
|
|
||||||
|
|
||||||
VideoStore = new TournamentVideoResourceStore(this);
|
VideoStore = new TournamentVideoResourceStore(this);
|
||||||
Logger.Log("Using tournament storage: " + GetFullPath(string.Empty));
|
Logger.Log("Using tournament storage: " + GetFullPath(string.Empty));
|
||||||
}
|
}
|
||||||
@ -50,7 +46,6 @@ namespace osu.Game.Tournament.IO
|
|||||||
{
|
{
|
||||||
var source = new DirectoryInfo(storage.GetFullPath("tournament"));
|
var source = new DirectoryInfo(storage.GetFullPath("tournament"));
|
||||||
var destination = new DirectoryInfo(GetFullPath(default_tournament));
|
var destination = new DirectoryInfo(GetFullPath(default_tournament));
|
||||||
var cfgDestination = new DirectoryInfo(GetFullPath(default_tournament + Path.DirectorySeparatorChar + config_directory));
|
|
||||||
|
|
||||||
if (source.Exists)
|
if (source.Exists)
|
||||||
{
|
{
|
||||||
@ -59,13 +54,11 @@ namespace osu.Game.Tournament.IO
|
|||||||
deleteRecursive(source);
|
deleteRecursive(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cfgDestination.Exists)
|
|
||||||
destination.CreateSubdirectory(config_directory);
|
|
||||||
|
|
||||||
moveFileIfExists("bracket.json", destination);
|
moveFileIfExists("bracket.json", destination);
|
||||||
moveFileIfExists("drawings.txt", destination);
|
moveFileIfExists("drawings.txt", destination);
|
||||||
moveFileIfExists("drawings_results.txt", destination);
|
moveFileIfExists("drawings_results.txt", destination);
|
||||||
moveFileIfExists("drawings.ini", cfgDestination);
|
moveFileIfExists("drawings.ini", destination);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void moveFileIfExists(string file, DirectoryInfo destination)
|
private void moveFileIfExists(string file, DirectoryInfo destination)
|
||||||
|
@ -54,7 +54,7 @@ namespace osu.Game.Tournament.Screens.Drawings
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawingsConfig = new DrawingsConfigManager(storage.ConfigurationStorage);
|
drawingsConfig = new DrawingsConfigManager(storage);
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user