mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 07:43:00 +08:00
Fix styling issues and move StorageManager to Configuration Folder
This commit is contained in:
parent
ba5a747ac9
commit
f01a86f5b1
@ -20,7 +20,6 @@ namespace osu.Game.Tournament.Configuration
|
||||
base.InitialiseDefaults();
|
||||
Set(StorageConfig.CurrentTournament, string.Empty);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum StorageConfig
|
@ -19,8 +19,6 @@ using osu.Framework.Platform;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Tournament.Configuration;
|
||||
using osu.Game.Tournament.IPC;
|
||||
using osu.Game.Tournament.Models;
|
||||
using osu.Game.Users;
|
||||
@ -62,7 +60,7 @@ namespace osu.Game.Tournament
|
||||
|
||||
Textures.AddStore(new TextureLoaderStore(tournamentStorage.VideoStorage));
|
||||
|
||||
this.storage = tournamentStorage;
|
||||
storage = tournamentStorage;
|
||||
|
||||
windowSize = frameworkConfig.GetBindable<Size>(FrameworkSetting.WindowedSize);
|
||||
windowSize.BindValueChanged(size => ScheduleAfterChildren(() =>
|
||||
|
@ -45,7 +45,7 @@ namespace osu.Game.Tournament
|
||||
else
|
||||
{
|
||||
// Migrating old storage format to the new one.
|
||||
Migrate();
|
||||
migrate();
|
||||
Logger.Log("Migrating files from old storage to new.");
|
||||
}
|
||||
|
||||
@ -53,16 +53,16 @@ namespace osu.Game.Tournament
|
||||
Logger.Log("Using tournament storage: " + GetFullPath(string.Empty));
|
||||
}
|
||||
|
||||
private void Migrate()
|
||||
private void migrate()
|
||||
{
|
||||
var defaultPath = "tournaments/default";
|
||||
const string default_path = "tournaments/default";
|
||||
var source = new DirectoryInfo(GetFullPath("tournament"));
|
||||
var destination = new DirectoryInfo(GetFullPath(defaultPath));
|
||||
var destination = new DirectoryInfo(GetFullPath(default_path));
|
||||
|
||||
Directory.CreateDirectory(destination.FullName);
|
||||
|
||||
|
||||
if (host.Storage.Exists("bracket.json"))
|
||||
{
|
||||
{
|
||||
Logger.Log("Migrating bracket to default tournament storage.");
|
||||
var bracketFile = new System.IO.FileInfo(GetFullPath(string.Empty) + Path.DirectorySeparatorChar + GetFiles(string.Empty, "bracket.json").First());
|
||||
attemptOperation(() => bracketFile.CopyTo(Path.Combine(destination.FullName, bracketFile.Name), true));
|
||||
@ -70,8 +70,8 @@ namespace osu.Game.Tournament
|
||||
|
||||
Logger.Log("Migrating other assets to default tournament storage.");
|
||||
copyRecursive(source, destination);
|
||||
ChangeTargetStorage(UnderlyingStorage.GetStorageForDirectory(defaultPath));
|
||||
storageConfig.Set<string>(StorageConfig.CurrentTournament, defaultPath);
|
||||
ChangeTargetStorage(UnderlyingStorage.GetStorageForDirectory(default_path));
|
||||
storageConfig.Set(StorageConfig.CurrentTournament, default_path);
|
||||
storageConfig.Save();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user