Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void TestBasicGameplayTest()
});
AddUntilStep("save prompt shown", () => DialogOverlay.CurrentDialog is SaveRequiredPopupDialog);

AddStep("save changes", () => DialogOverlay.CurrentDialog!.PerformOkAction());
AddStep("save changes", () => (DialogOverlay.CurrentDialog as SaveRequiredPopupDialog)!.PerformOkAction());
AddUntilStep("player pushed", () => Stack.CurrentScreen is EditorPlayer);
AddUntilStep("wait for return to editor", () => Stack.CurrentScreen is Screens.Edit.Editor);
}
Expand Down
16 changes: 8 additions & 8 deletions osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void TestCreateNewDifficulty([Values] bool sameRuleset)
if (sameRuleset)
{
AddUntilStep("wait for dialog", () => DialogOverlay.CurrentDialog is CreateNewDifficultyDialog);
AddStep("confirm creation with no objects", () => DialogOverlay.CurrentDialog!.PerformOkAction());
AddStep("confirm creation with no objects", () => (DialogOverlay.CurrentDialog as CreateNewDifficultyDialog)!.PerformOkAction());
}

AddUntilStep("wait for created", () =>
Expand Down Expand Up @@ -240,7 +240,7 @@ public void TestCreateNewDifficultyWithScrollSpeed_SameRuleset()
AddStep("create new difficulty", () => Editor.CreateNewDifficulty(new ManiaRuleset().RulesetInfo));

AddUntilStep("wait for dialog", () => DialogOverlay.CurrentDialog is CreateNewDifficultyDialog);
AddStep("confirm creation with no objects", () => DialogOverlay.CurrentDialog!.PerformOkAction());
AddStep("confirm creation with no objects", () => (DialogOverlay.CurrentDialog as CreateNewDifficultyDialog)!.PerformOkAction());

AddUntilStep("wait for created", () =>
{
Expand Down Expand Up @@ -386,7 +386,7 @@ public void TestCopyDifficulty()
AddStep("create new difficulty", () => Editor.CreateNewDifficulty(new OsuRuleset().RulesetInfo));

AddUntilStep("wait for dialog", () => DialogOverlay.CurrentDialog is CreateNewDifficultyDialog);
AddStep("confirm creation as a copy", () => DialogOverlay.CurrentDialog!.Buttons.ElementAt(1).TriggerClick());
AddStep("confirm creation as a copy", () => (DialogOverlay.CurrentDialog as CreateNewDifficultyDialog)!.Buttons.ElementAt(1).TriggerClick());

AddUntilStep("wait for created", () =>
{
Expand Down Expand Up @@ -464,7 +464,7 @@ public void TestCopyDifficultyDoesNotChangeCollections()
AddStep("create new difficulty", () => Editor.CreateNewDifficulty(new OsuRuleset().RulesetInfo));

AddUntilStep("wait for dialog", () => DialogOverlay.CurrentDialog is CreateNewDifficultyDialog);
AddStep("confirm creation as a copy", () => DialogOverlay.CurrentDialog!.Buttons.ElementAt(1).TriggerClick());
AddStep("confirm creation as a copy", () => (DialogOverlay.CurrentDialog as CreateNewDifficultyDialog)!.Buttons.ElementAt(1).TriggerClick());

AddUntilStep("wait for created", () =>
{
Expand Down Expand Up @@ -504,7 +504,7 @@ public void TestCreateMultipleNewDifficultiesSucceeds()

AddStep("try to create new difficulty", () => Editor.CreateNewDifficulty(new OsuRuleset().RulesetInfo));
AddUntilStep("wait for dialog", () => DialogOverlay.CurrentDialog is CreateNewDifficultyDialog);
AddStep("confirm creation with no objects", () => DialogOverlay.CurrentDialog!.PerformOkAction());
AddStep("confirm creation with no objects", () => (DialogOverlay.CurrentDialog as CreateNewDifficultyDialog)!.PerformOkAction());

AddUntilStep("wait for created", () =>
{
Expand Down Expand Up @@ -542,7 +542,7 @@ public void TestSavingBeatmapFailsWithSameNamedDifficulties([Values] bool sameRu
if (sameRuleset)
{
AddUntilStep("wait for dialog", () => DialogOverlay.CurrentDialog is CreateNewDifficultyDialog);
AddStep("confirm creation with no objects", () => DialogOverlay.CurrentDialog!.PerformOkAction());
AddStep("confirm creation with no objects", () => (DialogOverlay.CurrentDialog as CreateNewDifficultyDialog)!.PerformOkAction());
}

AddUntilStep("wait for created", () =>
Expand Down Expand Up @@ -608,7 +608,7 @@ public void TestExitBlockedWhenSavingBeatmapWithSameNamedDifficulties()

AddStep("exit", () => Editor.Exit());
AddUntilStep("wait for dialog", () => DialogOverlay.CurrentDialog is PromptForSaveDialog);
AddStep("attempt to save", () => DialogOverlay.CurrentDialog!.PerformOkAction());
AddStep("attempt to save", () => (DialogOverlay.CurrentDialog as PromptForSaveDialog)!.PerformOkAction());
AddAssert("editor is still current", () => Editor.IsCurrentScreen());
}

Expand Down Expand Up @@ -799,7 +799,7 @@ private void createNewDifficulty()
});

AddUntilStep("wait for dialog", () => DialogOverlay.CurrentDialog is CreateNewDifficultyDialog);
AddStep("confirm creation with no objects", () => DialogOverlay.CurrentDialog!.PerformOkAction());
AddStep("confirm creation with no objects", () => (DialogOverlay.CurrentDialog as CreateNewDifficultyDialog)!.PerformOkAction());

AddUntilStep("wait for created", () =>
{
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Tests/Visual/Editing/TestSceneEditorTestGameplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public void TestCancelGameplayTestWithUnsavedChanges()

AddStep("dismiss prompt", () =>
{
var button = DialogOverlay.CurrentDialog!.Buttons.Last();
var button = (DialogOverlay.CurrentDialog as SaveRequiredPopupDialog)!.Buttons.Last();
InputManager.MoveMouseTo(button);
InputManager.Click(MouseButton.Left);
});
Expand All @@ -193,7 +193,7 @@ public void TestSaveChangesBeforeGameplayTest()
AddUntilStep("save prompt shown", () => DialogOverlay.CurrentDialog is SaveRequiredPopupDialog);
AddAssert("track stopped", () => !Beatmap.Value.Track.IsRunning);

AddStep("save changes", () => DialogOverlay.CurrentDialog!.PerformOkAction());
AddStep("save changes", () => (DialogOverlay.CurrentDialog as SaveRequiredPopupDialog)!.PerformOkAction());

EditorPlayer editorPlayer = null;
AddUntilStep("player pushed", () => (editorPlayer = Stack.CurrentScreen as EditorPlayer) != null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public void TestCreateNewDifficultyOnNonExistentBeatmap()
});
AddAssert("save dialog displayed", () => Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog is SaveRequiredPopupDialog);

AddStep("press save", () => Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog!.PerformOkAction());
AddStep("press save", () => (Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog as SaveRequiredPopupDialog)!.PerformOkAction());
AddUntilStep("wait for editor", () => Game.ScreenStack.CurrentScreen is Editor editor && editor.IsLoaded);
AddAssert("editor beatmap uses catch ruleset", () => getEditorBeatmap().BeatmapInfo.Ruleset.ShortName == "fruits");
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Tests/Visual/SongSelect/TestSceneSongSelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void TestDeleteHotkey()
});

AddUntilStep("delete dialog shown", () => DialogOverlay.CurrentDialog, Is.InstanceOf<BeatmapDeleteDialog>);
AddStep("confirm deletion", () => DialogOverlay.CurrentDialog!.PerformAction<PopupDialogDangerousButton>());
AddStep("confirm deletion", () => (DialogOverlay.CurrentDialog as BeatmapDeleteDialog)!.PerformAction<PopupDialogDangerousButton>());

AddAssert("beatmap set deleted", () => Beatmaps.GetAllUsableBeatmapSets().Any(), () => Is.False);
}
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Tests/Visual/UserInterface/TestSceneDialogOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void TestTooMuchText()
[Test]
public void TestPushBeforeLoad()
{
PopupDialog dialog = null;
ButtonPopupDialog dialog = null;

AddStep("create slow loading dialog overlay", () => overlay = new SlowLoadingDialogOverlay());

Expand Down Expand Up @@ -191,7 +191,7 @@ public void TestDismissBeforePushViaButtonPress()
AddUntilStep("dialog is not part of hierarchy", () => testDialog.Parent == null);
}

private partial class TestPopupDialog : PopupDialog
private partial class TestPopupDialog : ButtonPopupDialog
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void TestDangerousButton([Values(false, true)] bool atEdge)
AddStep("release button", () => InputManager.ReleaseButton(MouseButton.Left));
}

private partial class TestPopupDialog : PopupDialog
private partial class TestPopupDialog : ButtonPopupDialog
{
public PopupDialogDangerousButton DangerousButton { get; }

Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Tournament/Components/IPCErrorDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace osu.Game.Tournament.Components
{
public partial class IPCErrorDialog : PopupDialog
public partial class IPCErrorDialog : ButtonPopupDialog
{
public IPCErrorDialog(string headerText, string bodyText)
{
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Online/Chat/ExternalLinkOpener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void OpenUrlExternally(string url, LinkWarnMode warnMode = LinkWarnMode.D
host.OpenUrlExternally(url);
}

public partial class ExternalLinkDialog : PopupDialog
public partial class ExternalLinkDialog : ButtonPopupDialog
{
public ExternalLinkDialog(string url, Action openExternalLinkAction, Action copyExternalLinkAction)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ protected override bool OnClick(ClickEvent e)
}
}

internal partial class FeaturedArtistConfirmDialog : PopupDialog
internal partial class FeaturedArtistConfirmDialog : ButtonPopupDialog
{
public FeaturedArtistConfirmDialog(Action confirm)
{
Expand Down
Loading
Loading