Exemple #1
0
        private void load(OsuColour colours, GameplayClock clock)
        {
            var baseClock = Clock;

            if (clock != null)
            {
                Clock = clock;
            }

            Children = new Drawable[]
            {
                fadeContainer = new FadeContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        button = new Button
                        {
                            Clock  = baseClock,
                            Anchor = Anchor.Centre,
                            Origin = Anchor.Centre,
                        },
                        remainingTimeBox = new Box
                        {
                            Height           = 5,
                            RelativeSizeAxes = Axes.X,
                            Colour           = colours.Yellow,
                            Anchor           = Anchor.BottomCentre,
                            Origin           = Anchor.BottomCentre,
                        }
                    }
                }
            };
        }
        public GameplayClockContainer(WorkingBeatmap beatmap, double gameplayStartTime)
        {
            this.beatmap = beatmap;

            RelativeSizeAxes = Axes.Both;

            sourceClock = (IAdjustableClock)beatmap.Track ?? new StopwatchClock();

            adjustableClock = new DecoupleableInterpolatingFramedClock {
                IsCoupled = false
            };

            adjustableClock.Seek(Math.Min(0, gameplayStartTime - beatmap.BeatmapInfo.AudioLeadIn));

            adjustableClock.ProcessFrame();

            // Lazer's audio timings in general doesn't match stable. This is the result of user testing, albeit limited.
            // This only seems to be required on windows. We need to eventually figure out why, with a bit of luck.
            var platformOffsetClock = new FramedOffsetClock(adjustableClock)
            {
                Offset = RuntimeInfo.OS == RuntimeInfo.Platform.Windows ? 22 : 0
            };

            // the final usable gameplay clock with user-set offsets applied.
            offsetClock = new FramedOffsetClock(platformOffsetClock);

            // the clock to be exposed via DI to children.
            GameplayClock = new GameplayClock(offsetClock);

            GameplayClock.IsPaused.BindTo(IsPaused);
        }
        public GameplayClockContainer(WorkingBeatmap beatmap, IReadOnlyList <Mod> mods, double gameplayStartTime)
        {
            this.beatmap           = beatmap;
            this.mods              = mods;
            this.gameplayStartTime = gameplayStartTime;
            firstHitObjectTime     = beatmap.Beatmap.HitObjects.First().StartTime;

            RelativeSizeAxes = Axes.Both;

            track = beatmap.Track;

            adjustableClock = new DecoupleableInterpolatingFramedClock {
                IsCoupled = false
            };

            // Lazer's audio timings in general doesn't match stable. This is the result of user testing, albeit limited.
            // This only seems to be required on windows. We need to eventually figure out why, with a bit of luck.
            platformOffsetClock = new FramedOffsetClock(adjustableClock)
            {
                Offset = RuntimeInfo.OS == RuntimeInfo.Platform.Windows ? 15 : 0
            };

            // the final usable gameplay clock with user-set offsets applied.
            userOffsetClock = new FramedOffsetClock(platformOffsetClock);

            // the clock to be exposed via DI to children.
            GameplayClock = new GameplayClock(userOffsetClock);

            GameplayClock.IsPaused.BindTo(IsPaused);
        }
 private void load(GameplayClock clock)
 {
     if (clock != null)
     {
         Clock = clock;
     }
 }
        public GameplayClockContainer(WorkingBeatmap beatmap, IReadOnlyList <Mod> mods, double gameplayStartTime)
        {
            this.beatmap           = beatmap;
            this.mods              = mods;
            this.gameplayStartTime = gameplayStartTime;

            RelativeSizeAxes = Axes.Both;

            sourceClock = (IAdjustableClock)beatmap.Track ?? new StopwatchClock();
            (sourceClock as IAdjustableAudioComponent)?.AddAdjustment(AdjustableProperty.Frequency, pauseFreqAdjust);

            adjustableClock = new DecoupleableInterpolatingFramedClock {
                IsCoupled = false
            };

            // Lazer's audio timings in general doesn't match stable. This is the result of user testing, albeit limited.
            // This only seems to be required on windows. We need to eventually figure out why, with a bit of luck.
            platformOffsetClock = new FramedOffsetClock(adjustableClock)
            {
                Offset = RuntimeInfo.OS == RuntimeInfo.Platform.Windows ? 22 : 0
            };

            // the final usable gameplay clock with user-set offsets applied.
            userOffsetClock = new FramedOffsetClock(platformOffsetClock);

            // the clock to be exposed via DI to children.
            GameplayClock = new GameplayClock(userOffsetClock);

            GameplayClock.IsPaused.BindTo(IsPaused);
        }
Exemple #6
0
        private void load(OsuColour colours, GameplayClock clock)
        {
            if (clock != null)
            {
                gameplayClock = clock;
            }

            graph.FillColour = bar.FillColour = colours.BlueLighter;
        }
Exemple #7
0
        private void load(OsuColour colours, GameplayClock clock, OsuConfigManager config)
        {
            base.LoadComplete();

            if (clock != null)
            {
                gameplayClock = clock;
            }

            config.BindWith(OsuSetting.ShowProgressGraph, ShowGraph);

            graph.FillColour = bar.FillColour = colours.BlueLighter;
        }