/// <summary>
        /// Sets the input manager child to a new test player loader container instance.
        /// </summary>
        /// <param name="interactive">If the test player should behave like the production one.</param>
        /// <param name="beforeLoadAction">An action to run before player load but after bindable leases are returned.</param>
        /// <param name="afterLoadAction">An action to run after container load.</param>
        public void ResetPlayer(bool interactive, Action beforeLoadAction = null, Action afterLoadAction = null)
        {
            audioManager.Volume.SetDefault();

            InputManager.Clear();

            beforeLoadAction?.Invoke();
            Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);

            InputManager.Child = container = new TestPlayerLoaderContainer(
                loader         = new TestPlayerLoader(() =>
            {
                afterLoadAction?.Invoke();
                return(player = new TestPlayer(interactive, interactive));
            }));
        }
Exemplo n.º 2
0
        public void TestLoadContinuation()
        {
            SlowLoadPlayer slowPlayer = null;

            AddStep("load dummy beatmap", () => ResetPlayer(false));
            AddUntilStep("wait for current", () => loader.IsCurrentScreen());
            AddStep("mouse in centre", () => InputManager.MoveMouseTo(loader.ScreenSpaceDrawQuad.Centre));
            AddUntilStep("wait for player to be current", () => player.IsCurrentScreen());
            AddStep("load slow dummy beatmap", () =>
            {
                InputManager.Child = container = new TestPlayerLoaderContainer(
                    loader         = new TestPlayerLoader(() => slowPlayer = new SlowLoadPlayer(false, false)));

                Scheduler.AddDelayed(() => slowPlayer.AllowLoad.Set(), 5000);
            });

            AddUntilStep("wait for player to be current", () => slowPlayer.IsCurrentScreen());
        }
Exemplo n.º 3
0
        /// <summary>
        /// Sets the input manager child to a new test player loader container instance.
        /// </summary>
        /// <param name="interactive">If the test player should behave like the production one.</param>
        /// <param name="beforeLoadAction">An action to run before player load but after bindable leases are returned.</param>
        /// <param name="afterLoadAction">An action to run after container load.</param>
        public void ResetPlayer(bool interactive, Action beforeLoadAction = null, Action afterLoadAction = null)
        {
            audioManager.Volume.SetDefault();

            InputManager.Clear();

            beforeLoadAction?.Invoke();
            Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);

            foreach (var mod in SelectedMods.Value.OfType <IApplicableToTrack>())
            {
                mod.ApplyToTrack(Beatmap.Value.Track);
            }

            InputManager.Child = container = new TestPlayerLoaderContainer(
                loader         = new TestPlayerLoader(() =>
            {
                afterLoadAction?.Invoke();
                return(player = new TestPlayer(interactive, interactive));
            }));
        }