mirror of
https://github.com/ppy/osu
synced 2024-12-27 17:32:56 +00:00
Move stable_config declaration, rename testscene
This commit is contained in:
parent
6e8a964c45
commit
3731e76b10
@ -39,7 +39,8 @@ namespace osu.Game.Tournament.IPC
|
||||
|
||||
[Resolved]
|
||||
private StableInfo stableInfo { get; set; }
|
||||
private const string STABLE_CONFIG = "tournament/stable.json";
|
||||
|
||||
public const string STABLE_CONFIG = "tournament/stable.json";
|
||||
|
||||
public Storage IPCStorage { get; private set; }
|
||||
|
||||
@ -166,6 +167,7 @@ namespace osu.Game.Tournament.IPC
|
||||
return stableInfo.StablePath.Value;
|
||||
|
||||
string stableInstallPath = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
List<Func<string>> stableFindMethods = new List<Func<string>>
|
||||
@ -195,7 +197,6 @@ namespace osu.Game.Tournament.IPC
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void saveStableConfig(string path)
|
||||
{
|
||||
stableInfo.StablePath.Value = path;
|
||||
|
@ -2,7 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Framework.Bindables;
|
||||
|
||||
namespace osu.Game.Tournament.Models
|
||||
@ -14,6 +13,5 @@ namespace osu.Game.Tournament.Models
|
||||
public class StableInfo
|
||||
{
|
||||
public Bindable<string> StablePath = new Bindable<string>(string.Empty);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ namespace osu.Game.Tournament.Screens
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(Storage storage, OsuColour colours)
|
||||
{
|
||||
var initialPath = new DirectoryInfo(storage.GetFullPath(stableInfo.StablePath.Value ?? string.Empty)).Parent?.FullName;
|
||||
var initialPath = new DirectoryInfo(storage.GetFullPath(stableInfo.StablePath.Value ?? string.Empty)).Parent?.FullName;
|
||||
|
||||
AddRangeInternal(new Drawable[]
|
||||
{
|
||||
|
@ -148,9 +148,9 @@ namespace osu.Game.Tournament
|
||||
if (stableInfo == null)
|
||||
stableInfo = new StableInfo();
|
||||
|
||||
if (storage.Exists(StableInfo.STABLE_CONFIG))
|
||||
if (storage.Exists(FileBasedIPC.STABLE_CONFIG))
|
||||
{
|
||||
using (Stream stream = storage.GetStream(StableInfo.STABLE_CONFIG, FileAccess.Read, FileMode.Open))
|
||||
using (Stream stream = storage.GetStream(FileBasedIPC.STABLE_CONFIG, FileAccess.Read, FileMode.Open))
|
||||
using (var sr = new StreamReader(stream))
|
||||
{
|
||||
stableInfo = JsonConvert.DeserializeObject<StableInfo>(sr.ReadToEnd());
|
||||
|
Loading…
Reference in New Issue
Block a user