public virtual void SetUp() => Schedule(() => { Child = new OsuScreenStack(songSelect = new DummySongSelect()) { RelativeSizeAxes = Axes.Both }; });
public virtual void TestPlayIntroWithFailingAudioDevice() { AddStep("hide notifications", () => notifications.Hide()); AddStep("restart sequence", () => { logo.FinishTransforms(); logo.IsTracking = false; IntroStack?.Expire(); Add(IntroStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both, }); IntroStack.Push(intro = CreateScreen()); }); AddStep("trigger failure", () => { trackResetDelegate = Scheduler.AddDelayed(() => { intro.Beatmap.Value.Track.Seek(0); }, 0, true); }); AddUntilStep("wait for menu", () => intro.DidLoadMenu); if (IntroReliesOnTrack) { AddUntilStep("wait for notification", () => notifications.UnreadCount.Value == 1); } AddStep("uninstall delegate", () => trackResetDelegate?.Cancel()); }
public void LoadScore([NotNull] Score score) { if (Score != null) { throw new InvalidOperationException($"Cannot load a new score on a {nameof(PlayerArea)} that has an existing score."); } Score = score; gameplayContent.Child = new PlayerIsolationContainer(beatmapManager.GetWorkingBeatmap(Score.ScoreInfo.BeatmapInfo), Score.ScoreInfo.Ruleset, Score.ScoreInfo.Mods) { RelativeSizeAxes = Axes.Both, Child = stack = new OsuScreenStack { Name = nameof(PlayerArea), } }; stack.Push(new MultiSpectatorPlayerLoader(Score, () => { var player = new MultiSpectatorPlayer(Score, GameplayClock); player.OnGameplayStarted += () => OnGameplayStarted?.Invoke(); return(player); })); loadingLayer.Hide(); }
public void TestOperationDisposalAfterScreenExit() { TestScreenWithTracker screen = null; OsuScreenStack stack; IDisposable operation = null; AddStep("create screen with tracker", () => { Child = stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }; stack.Push(screen = new TestScreenWithTracker()); }); AddUntilStep("wait for loaded", () => screen.IsLoaded); AddStep("begin operation", () => operation = screen.OngoingOperationTracker.BeginOperation()); AddAssert("operation in progress", () => screen.OngoingOperationTracker.InProgress.Value); AddStep("dispose after screen exit", () => { screen.Exit(); operation.Dispose(); }); AddAssert("operation ended", () => !screen.OngoingOperationTracker.InProgress.Value); }
protected IntroTestScene() { Drawable introStack = null; Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Depth = float.MaxValue, Colour = Color4.Black, }, logo = new OsuLogo { Alpha = 0, RelativePositionAxes = Axes.Both, Depth = float.MinValue, Position = new Vector2(0.5f), } }; AddStep("restart sequence", () => { logo.FinishTransforms(); logo.IsTracking = false; introStack?.Expire(); Add(introStack = new OsuScreenStack(CreateScreen()) { RelativeSizeAxes = Axes.Both, }); }); }
public void Setup() => Schedule(() => { InputManager.Child = stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }; Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo); });
public TestResultsContainer(IScreen screen) { RelativeSizeAxes = Axes.Both; InternalChild = new OsuScreenStack(screen) { RelativeSizeAxes = Axes.Both, }; }
public virtual void SetUp() => Schedule(() => { var stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }; Child = stack; stack.Push(songSelect = new DummySongSelect()); });
public void ResultsWithoutPlayer() { TestSoloResults screen = null; AddStep("load results", () => Child = new OsuScreenStack(screen = createResultsScreen()) { RelativeSizeAxes = Axes.Both }); AddUntilStep("wait for loaded", () => screen.IsLoaded); AddAssert("retry overlay not present", () => screen.RetryOverlay == null); }
private ExposedPlayer loadBeatmap(bool userHasCustomColours, bool beatmapHasColours) { ExposedPlayer player; Beatmap.Value = new CustomSkinWorkingBeatmap(audio, beatmapHasColours); Child = new OsuScreenStack(player = new ExposedPlayer(userHasCustomColours)) { RelativeSizeAxes = Axes.Both }; return(player); }
public TestResultsContainer(IScreen screen) { RelativeSizeAxes = Axes.Both; OsuScreenStack stack; InternalChild = stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both, }; stack.Push(screen); }
public TestSceneScreenBreadcrumbControl() { OsuSpriteText titleText; IScreen startScreen = new TestScreenOne(); screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }; screenStack.Push(startScreen); Children = new Drawable[] { screenStack, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Spacing = new Vector2(10), Children = new Drawable[] { breadcrumbs = new ScreenBreadcrumbControl(screenStack) { RelativeSizeAxes = Axes.X, }, titleText = new OsuSpriteText(), }, }, }; breadcrumbs.Current.ValueChanged += screen => titleText.Text = $"Changed to {screen.NewValue}"; breadcrumbs.Current.TriggerChange(); waitForCurrent(); pushNext(); waitForCurrent(); pushNext(); waitForCurrent(); AddStep(@"make start current", () => startScreen.MakeCurrent()); waitForCurrent(); pushNext(); waitForCurrent(); AddAssert(@"only 2 items", () => breadcrumbs.Items.Count == 2); AddStep(@"exit current", () => screenStack.CurrentScreen.Exit()); AddAssert(@"current screen is first", () => startScreen == screenStack.CurrentScreen); }
public TestCaseMultiHeader() { int index = 0; OsuScreenStack screenStack = new OsuScreenStack(new TestMultiplayerSubScreen(index)) { RelativeSizeAxes = Axes.Both }; Children = new Drawable[] { screenStack, new Header(screenStack) }; AddStep("push multi screen", () => screenStack.CurrentScreen.Push(new TestMultiplayerSubScreen(++index))); }
public void TestResultsWithoutPlayer() { TestResultsScreen screen = null; OsuScreenStack stack; AddStep("load results", () => { Child = stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }; stack.Push(screen = createResultsScreen()); }); AddUntilStep("wait for loaded", () => screen.IsLoaded); AddAssert("retry overlay not present", () => screen.RetryOverlay == null); }
public TestSceneMultiHeader() { int index = 0; OsuScreenStack screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }; screenStack.Push(new TestOnlinePlaySubScreen(index)); Children = new Drawable[] { screenStack, new Header("Multiplayer", screenStack) }; AddStep("push multi screen", () => screenStack.CurrentScreen.Push(new TestOnlinePlaySubScreen(++index))); }
public TestMultiplayerComponents() { multiplayerScreen = new TestMultiplayer(); InternalChildren = new Drawable[] { userLookupCache, beatmapLookupCache, MultiplayerClient = new TestMultiplayerClient(RoomManager), screenStack = new OsuScreenStack { Name = nameof(TestMultiplayerComponents), RelativeSizeAxes = Axes.Both } }; screenStack.Push(multiplayerScreen); }
public virtual void TestPlayIntro() { AddStep("restart sequence", () => { logo.FinishTransforms(); logo.IsTracking = false; IntroStack?.Expire(); Add(IntroStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both, }); IntroStack.Push(intro = CreateScreen()); }); AddUntilStep("wait for menu", () => intro.DidLoadMenu); }
protected IntroTestScene() { Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Depth = float.MaxValue, Colour = Color4.Black, }, logo = new OsuLogo { Alpha = 0, RelativePositionAxes = Axes.Both, Depth = float.MinValue, Position = new Vector2(0.5f), } }; AddStep("restart sequence", () => { logo.FinishTransforms(); logo.IsTracking = false; IntroStack?.Expire(); Add(IntroStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both, }); IntroStack.Push(CreateScreen()); }); AddUntilStep("wait for menu", () => IntroStack.CurrentScreen is MainMenu); }
public TestCasePlayerLoader() { InputManager.Add(stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }); }
protected ScreenTestCase() { Child = stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }; }