示例#1
0
        public FrameStabilityContainer(double gameplayStartTime = double.MinValue)
        {
            RelativeSizeAxes = Axes.Both;
            gameplayClock    = new GameplayClock(framedClock = new FramedClock(manualClock = new ManualClock()));

            this.gameplayStartTime = gameplayStartTime;
        }
示例#2
0
        public void SetUp() => Schedule(() =>
        {
            requestCount = 0;
            increment    = skip_time;

            var working = CreateWorkingBeatmap(CreateBeatmap(new OsuRuleset().RulesetInfo));
            working.LoadTrack();

            Child = gameplayClockContainer = new MasterGameplayClockContainer(working, 0)
            {
                RelativeSizeAxes = Axes.Both,
                Children         = new Drawable[]
                {
                    skip = new TestSkipOverlay(skip_time)
                    {
                        RequestSkip = () =>
                        {
                            requestCount++;
                            gameplayClockContainer.Seek(gameplayClock.CurrentTime + increment);
                        }
                    }
                },
            };

            gameplayClockContainer.Start();
            gameplayClock = gameplayClockContainer.GameplayClock;
        });
示例#3
0
 private void load(GameplayClock clock)
 {
     if (clock != null)
     {
         parentGameplayClock = clock;
     }
 }
 private void load(GameplayClock clock)
 {
     if (clock != null)
     {
         parentGameplayClock = clock;
         GameplayClock.IsPaused.BindTo(clock.IsPaused);
     }
 }
示例#5
0
 private void load(GameplayClock clock, ISamplePlaybackDisabler sampleDisabler)
 {
     if (clock != null)
     {
         parentGameplayClock = frameStableClock.ParentGameplayClock = clock;
         frameStableClock.IsPaused.BindTo(clock.IsPaused);
     }
 }
示例#6
0
        private void load(GameplayClock clock, ISamplePlaybackDisabler sampleDisabler)
        {
            if (clock != null)
            {
                parentGameplayClock = stabilityGameplayClock.ParentGameplayClock = clock;
                GameplayClock.IsPaused.BindTo(clock.IsPaused);
            }

            // this is a bit temporary. should really be done inside of GameplayClock (but requires large structural changes).
            stabilityGameplayClock.ParentSampleDisabler = sampleDisabler;
        }
示例#7
0
        public void ApplyToDrawableRuleset(DrawableRuleset <OsuHitObject> drawableRuleset)
        {
            gameplayClock = drawableRuleset.FrameStableClock;

            // Grab the input manager to disable the user's cursor, and for future use
            inputManager = (OsuInputManager)drawableRuleset.KeyBindingInputManager;
            inputManager.AllowUserCursorMovement = false;

            // Generate the replay frames the cursor should follow
            replayFrames = new OsuAutoGenerator(drawableRuleset.Beatmap).Generate().Frames.Cast <OsuReplayFrame>().ToList();
        }
示例#8
0
        public TestSceneSongProgress()
        {
            clock         = new StopwatchClock();
            gameplayClock = new GameplayClock(framedClock = new FramedClock(clock));

            Add(progressContainer = new Container
            {
                RelativeSizeAxes = Axes.X,
                Anchor           = Anchor.BottomCentre,
                Origin           = Anchor.BottomCentre,
                Height           = 100,
                Y     = -100,
                Child = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.Gray(1),
                }
            });
        }
示例#9
0
 private void load(GameplayClock gameplayClock)
 {
     // if in a gameplay context, pause sample playback when gameplay is paused.
     gameplayClockPaused = gameplayClock?.IsPaused.GetBoundCopy();
     gameplayClockPaused?.BindValueChanged(paused =>
     {
         if (requestedPlaying)
         {
             if (paused.NewValue)
             {
                 stop();
             }
             // it's not easy to know if a sample has finished playing (to end).
             // to keep things simple only resume playing looping samples.
             else if (Looping)
             {
                 play();
             }
         }
     });
 }
示例#10
0
        public TestCaseSongProgress()
        {
            clock = new StopwatchClock(true);

            gameplayClock = new GameplayClock(framedClock = new FramedClock(clock));

            Add(progress = new SongProgress
            {
                RelativeSizeAxes = Axes.X,
                Anchor           = Anchor.BottomLeft,
                Origin           = Anchor.BottomLeft,
            });

            Add(graph = new TestSongProgressGraph
            {
                RelativeSizeAxes = Axes.X,
                Height           = 200,
                Anchor           = Anchor.TopLeft,
                Origin           = Anchor.TopLeft,
            });

            AddWaitStep(5);
            AddAssert("ensure not created", () => graph.CreationCount == 0);

            AddStep("display values", displayNewValues);
            AddWaitStep(5);
            AddUntilStep(() => graph.CreationCount == 1, "wait for creation count");

            AddStep("Toggle Bar", () => progress.AllowSeeking = !progress.AllowSeeking);
            AddWaitStep(5);
            AddUntilStep(() => graph.CreationCount == 1, "wait for creation count");

            AddStep("Toggle Bar", () => progress.AllowSeeking = !progress.AllowSeeking);
            AddWaitStep(5);
            AddUntilStep(() => graph.CreationCount == 1, "wait for creation count");
            AddRepeatStep("New Values", displayNewValues, 5);

            AddWaitStep(5);
            AddAssert("ensure debounced", () => graph.CreationCount == 2);
        }
示例#11
0
        public void SetUp() => Schedule(() =>
        {
            requestCount = 0;
            increment    = skip_time;

            Child = gameplayClockContainer = new GameplayClockContainer(CreateWorkingBeatmap(CreateBeatmap(new OsuRuleset().RulesetInfo)), Array.Empty <Mod>(), 0)
            {
                RelativeSizeAxes = Axes.Both,
                Children         = new Drawable[]
                {
                    skip = new SkipOverlay(skip_time)
                    {
                        RequestSkip = () =>
                        {
                            requestCount++;
                            gameplayClockContainer.Seek(gameplayClock.CurrentTime + increment);
                        }
                    }
                },
            };

            gameplayClockContainer.Start();
            gameplayClock = gameplayClockContainer.GameplayClock;
        });
示例#12
0
 public FrameStabilityContainer()
 {
     RelativeSizeAxes = Axes.Both;
     gameplayClock    = new GameplayClock(framedClock = new FramedClock(manualClock = new ManualClock()));
 }
示例#13
0
 protected RulesetInputManager(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
 {
     InternalChild = KeyBindingContainer = CreateKeyBindingContainer(ruleset, variant, unique);
     gameplayClock = new GameplayClock(framedClock = new FramedClock(manualClock = new ManualClock()));
 }