mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Remove unnecessary comments, simplify initialPath and clarified TestScene name
This commit is contained in:
parent
c6345ba6c9
commit
4c3900cfc8
@ -6,14 +6,14 @@ using osu.Framework.Platform;
|
|||||||
|
|
||||||
namespace osu.Game.Tournament.Tests.Screens
|
namespace osu.Game.Tournament.Tests.Screens
|
||||||
{
|
{
|
||||||
public class TestSceneStablePathSelectScreens : TournamentTestScene
|
public class TestSceneStablePathSelectScreen : TournamentTestScene
|
||||||
{
|
{
|
||||||
public TestSceneStablePathSelectScreens()
|
public TestSceneStablePathSelectScreen()
|
||||||
{
|
{
|
||||||
AddStep("Add screen", () => Add(new TestSceneStablePathSelectScreen()));
|
AddStep("Add screen", () => Add(new StablePathSelectTestScreen()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestSceneStablePathSelectScreen : StablePathSelectScreen
|
private class StablePathSelectTestScreen : StablePathSelectScreen
|
||||||
{
|
{
|
||||||
protected override void ChangePath(Storage storage)
|
protected override void ChangePath(Storage storage)
|
||||||
{
|
{
|
||||||
|
@ -38,14 +38,7 @@ namespace osu.Game.Tournament.Screens
|
|||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(Storage storage, OsuColour colours)
|
private void load(Storage storage, OsuColour colours)
|
||||||
{
|
{
|
||||||
// begin selection in the parent directory of the current storage location
|
var initialPath = new DirectoryInfo(storage.GetFullPath(stableInfo.StablePath.Value ?? string.Empty)).Parent?.FullName;
|
||||||
var initialPath = new DirectoryInfo(storage.GetFullPath(string.Empty)).Parent?.FullName;
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(stableInfo.StablePath.Value))
|
|
||||||
{
|
|
||||||
// If the original path info for osu! stable is not empty, set it to the parent directory of that location
|
|
||||||
initialPath = new DirectoryInfo(stableInfo.StablePath.Value).Parent?.FullName;
|
|
||||||
}
|
|
||||||
|
|
||||||
AddRangeInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
@ -148,7 +141,6 @@ namespace osu.Game.Tournament.Screens
|
|||||||
AddInternal(overlay);
|
AddInternal(overlay);
|
||||||
Logger.Log("Folder is not an osu! stable CE directory");
|
Logger.Log("Folder is not an osu! stable CE directory");
|
||||||
return;
|
return;
|
||||||
// Return an error in the picker that the directory does not contain ipc.txt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileBasedIpc = ipc as FileBasedIPC;
|
var fileBasedIpc = ipc as FileBasedIPC;
|
||||||
@ -163,7 +155,6 @@ namespace osu.Game.Tournament.Screens
|
|||||||
|
|
||||||
if (fileBasedIpc?.IPCStorage == null)
|
if (fileBasedIpc?.IPCStorage == null)
|
||||||
{
|
{
|
||||||
// Could not auto detect
|
|
||||||
overlay = new DialogOverlay();
|
overlay = new DialogOverlay();
|
||||||
overlay.Push(new IPCErrorDialog("Failed to auto detect", "An osu! stable cutting-edge installation could not be auto detected.\nPlease try and manually point to the directory."));
|
overlay.Push(new IPCErrorDialog("Failed to auto detect", "An osu! stable cutting-edge installation could not be auto detected.\nPlease try and manually point to the directory."));
|
||||||
AddInternal(overlay);
|
AddInternal(overlay);
|
||||||
|
Loading…
Reference in New Issue
Block a user