mirror of
https://github.com/ppy/osu.git
synced 2025-03-25 08:47:20 +08:00
Make IPC error dialog reusable
and inspectcode fixes
This commit is contained in:
parent
a97100216c
commit
59b006f9ac
osu.Game.Tournament
@ -6,14 +6,13 @@ using osu.Game.Overlays.Dialog;
|
||||
|
||||
namespace osu.Game.Tournament.Components
|
||||
{
|
||||
public class IPCNotFoundDialog : PopupDialog
|
||||
public class IPCErrorDialog : PopupDialog
|
||||
{
|
||||
public IPCNotFoundDialog()
|
||||
public IPCErrorDialog(string headerText, string bodyText)
|
||||
{
|
||||
BodyText = "Select a directory that contains an osu! Cutting Edge installation";
|
||||
|
||||
Icon = FontAwesome.Regular.Angry;
|
||||
HeaderText = @"This is an invalid IPC Directory!";
|
||||
Icon = FontAwesome.Regular.SadTear;
|
||||
HeaderText = headerText;
|
||||
BodyText = bodyText;
|
||||
Buttons = new PopupDialogButton[]
|
||||
{
|
||||
new PopupDialogOkButton
|
@ -233,6 +233,7 @@ namespace osu.Game.Tournament.IPC
|
||||
private string findFromJsonConfig()
|
||||
{
|
||||
Logger.Log("Trying to find stable through the json config");
|
||||
|
||||
if (tournamentStorage.Exists(stable_config))
|
||||
{
|
||||
using (Stream stream = tournamentStorage.GetStream(stable_config, FileAccess.Read, FileMode.Open))
|
||||
@ -242,7 +243,7 @@ namespace osu.Game.Tournament.IPC
|
||||
return stableInfo.StablePath.Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ namespace osu.Game.Tournament.Screens
|
||||
ButtonText = "Refresh",
|
||||
Action = () =>
|
||||
{
|
||||
stableInfo.StablePath.BindValueChanged(_ =>
|
||||
stableInfo.StablePath.BindValueChanged(_ =>
|
||||
{
|
||||
fileBasedIpc?.LocateStableStorage();
|
||||
Schedule(reload);
|
||||
|
@ -171,7 +171,7 @@ namespace osu.Game.Tournament.Screens
|
||||
else
|
||||
{
|
||||
overlay = new DialogOverlay();
|
||||
overlay.Push(new IPCNotFoundDialog());
|
||||
overlay.Push(new IPCErrorDialog("This is an invalid IPC Directory", "Select a directory that contains an osu! stable cutting edge installation and make sure it has an empty ipc.txt file in it."));
|
||||
AddInternal(overlay);
|
||||
Logger.Log("Folder is not an osu! stable CE directory");
|
||||
// Return an error in the picker that the directory does not contain ipc.txt
|
||||
@ -182,11 +182,12 @@ namespace osu.Game.Tournament.Screens
|
||||
{
|
||||
var fileBasedIpc = ipc as FileBasedIPC;
|
||||
fileBasedIpc?.LocateStableStorage();
|
||||
|
||||
if (fileBasedIpc?.IPCStorage == null)
|
||||
{
|
||||
// Could not auto detect
|
||||
overlay = new DialogOverlay();
|
||||
overlay.Push(new IPCNotFoundDialog());
|
||||
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);
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user