mirror of
https://github.com/osukey/osukey.git
synced 2025-06-30 07:38:04 +09:00
Make IPC error dialog reusable
and inspectcode fixes
This commit is contained in:
parent
a97100216c
commit
59b006f9ac
@ -6,14 +6,13 @@ using osu.Game.Overlays.Dialog;
|
|||||||
|
|
||||||
namespace osu.Game.Tournament.Components
|
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.SadTear;
|
||||||
|
HeaderText = headerText;
|
||||||
Icon = FontAwesome.Regular.Angry;
|
BodyText = bodyText;
|
||||||
HeaderText = @"This is an invalid IPC Directory!";
|
|
||||||
Buttons = new PopupDialogButton[]
|
Buttons = new PopupDialogButton[]
|
||||||
{
|
{
|
||||||
new PopupDialogOkButton
|
new PopupDialogOkButton
|
@ -233,6 +233,7 @@ namespace osu.Game.Tournament.IPC
|
|||||||
private string findFromJsonConfig()
|
private string findFromJsonConfig()
|
||||||
{
|
{
|
||||||
Logger.Log("Trying to find stable through the json config");
|
Logger.Log("Trying to find stable through the json config");
|
||||||
|
|
||||||
if (tournamentStorage.Exists(stable_config))
|
if (tournamentStorage.Exists(stable_config))
|
||||||
{
|
{
|
||||||
using (Stream stream = tournamentStorage.GetStream(stable_config, FileAccess.Read, FileMode.Open))
|
using (Stream stream = tournamentStorage.GetStream(stable_config, FileAccess.Read, FileMode.Open))
|
||||||
|
@ -171,7 +171,7 @@ namespace osu.Game.Tournament.Screens
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
overlay = new DialogOverlay();
|
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);
|
AddInternal(overlay);
|
||||||
Logger.Log("Folder is not an osu! stable CE directory");
|
Logger.Log("Folder is not an osu! stable CE directory");
|
||||||
// Return an error in the picker that the directory does not contain ipc.txt
|
// 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;
|
var fileBasedIpc = ipc as FileBasedIPC;
|
||||||
fileBasedIpc?.LocateStableStorage();
|
fileBasedIpc?.LocateStableStorage();
|
||||||
|
|
||||||
if (fileBasedIpc?.IPCStorage == null)
|
if (fileBasedIpc?.IPCStorage == null)
|
||||||
{
|
{
|
||||||
// Could not auto detect
|
// Could not auto detect
|
||||||
overlay = new DialogOverlay();
|
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);
|
AddInternal(overlay);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user