コード例 #1
0
ファイル: SkipOverlay.cs プロジェクト: chenvinci2020/osu
        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,
                        }
                    }
                }
            };
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 private void load(GameplayClock clock)
 {
     if (clock != null)
     {
         Clock = clock;
     }
 }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: SongProgress.cs プロジェクト: Tiller431/yes
        private void load(OsuColour colours, GameplayClock clock)
        {
            if (clock != null)
            {
                gameplayClock = clock;
            }

            graph.FillColour = bar.FillColour = colours.BlueLighter;
        }
コード例 #7
0
ファイル: SongProgress.cs プロジェクト: zh010zh/osu
        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;
        }