Esempio n. 1
0
 public PippidonScoreProcessor(DrawableRuleset <PippidonHitObject> ruleset)
     : base(ruleset)
 {
 }
Esempio n. 2
0
File: Player.cs Progetto: ekrctb/osu
        /// <summary>
        /// Handles changes in player state which may progress the completion of gameplay / this screen's lifetime.
        /// </summary>
        /// <param name="skipStoryboardOutro">If in a state where a storyboard outro is to be played, offers the choice of skipping beyond it.</param>
        /// <exception cref="InvalidOperationException">Thrown if this method is called more than once without changing state.</exception>
        private void updateCompletionState(bool skipStoryboardOutro = false)
        {
            // screen may be in the exiting transition phase.
            if (!this.IsCurrentScreen())
            {
                return;
            }

            if (!ScoreProcessor.HasCompleted.Value)
            {
                completionProgressDelegate?.Cancel();
                completionProgressDelegate = null;
                ValidForResume             = true;
                skipOutroOverlay.Hide();
                return;
            }

            if (completionProgressDelegate != null)
            {
                throw new InvalidOperationException($"{nameof(updateCompletionState)} was fired more than once");
            }

            // Only show the completion screen if the player hasn't failed
            if (HealthProcessor.HasFailed)
            {
                return;
            }

            ValidForResume = false;

            // ensure we are not writing to the replay any more, as we are about to consume and store the score.
            DrawableRuleset.SetRecordTarget(null);

            if (!Configuration.ShowResults)
            {
                return;
            }

            prepareScoreForDisplayTask ??= Task.Run(async() =>
            {
                PrepareScoreForResults();

                try
                {
                    await PrepareScoreForResultsAsync(Score).ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    Logger.Error(ex, "Score preparation failed!");
                }

                try
                {
                    await ImportScore(Score).ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    Logger.Error(ex, "Score import failed!");
                }

                return(Score.ScoreInfo);
            });

            if (skipStoryboardOutro)
            {
                scheduleCompletion();
                return;
            }

            bool storyboardHasOutro = DimmableStoryboard.ContentDisplayed && !DimmableStoryboard.HasStoryboardEnded.Value;

            if (storyboardHasOutro)
            {
                skipOutroOverlay.Show();
                return;
            }

            using (BeginDelayedSequence(RESULTS_DISPLAY_DELAY))
                scheduleCompletion();
        }
Esempio n. 3
0
 public override void ApplyToDrawableRuleset(DrawableRuleset <TaikoHitObject> drawableRuleset)
 {
     playfield = (TaikoPlayfield)drawableRuleset.Playfield;
     base.ApplyToDrawableRuleset(drawableRuleset);
 }
Esempio n. 4
0
 public void ApplyToDrawableRuleset(DrawableRuleset <OsuHitObject> drawableRuleset)
 {
     drawableRuleset.Overlays.Add(blinds = new DrawableOsuBlinds(drawableRuleset.Playfield, drawableRuleset.Beatmap));
 }
Esempio n. 5
0
 /// <summary>
 /// Run any recording / playback setup for replays.
 /// </summary>
 protected virtual void PrepareReplay()
 {
     DrawableRuleset.SetRecordTarget(recordingReplay = new Replay());
 }
Esempio n. 6
0
        public FailAnimation(DrawableRuleset drawableRuleset)
        {
            this.drawableRuleset = drawableRuleset;

            RelativeSizeAxes = Axes.Both;
        }
Esempio n. 7
0
 public void ApplyToDrawableRuleset(DrawableRuleset <BosuHitObject> drawableRuleset)
 {
     drawableRuleset.Cursor.Add(new MouseInputHelper((BosuPlayfield)drawableRuleset.Playfield));
 }
Esempio n. 8
0
 public TaikoScoreProcessor(DrawableRuleset <TaikoHitObject> drawableRuleset)
     : base(drawableRuleset)
 {
 }
Esempio n. 9
0
        protected virtual void BindDrawableRuleset(DrawableRuleset drawableRuleset)
        {
            (drawableRuleset as ICanAttachKeyCounter)?.Attach(KeyCounter);

            replayLoaded.BindTo(drawableRuleset.HasReplayLoaded);
        }
Esempio n. 10
0
 public void ApplyToDrawableRuleset(DrawableRuleset <TauHitObject> drawableRuleset)
 {
     // grab the input manager for future use.
     tauInputManager = (TauInputManager)drawableRuleset.KeyBindingInputManager;
     tauInputManager.AllowUserPresses = false;
 }
Esempio n. 11
0
 public void ApplyToDrawableRuleset(DrawableRuleset <TauHitObject> drawableRuleset)
 {
     drawableRuleset.Overlays.Add(blinds = new DrawableTauBlinds(drawableRuleset.Playfield.HitObjectContainer, drawableRuleset.Beatmap));
 }
Esempio n. 12
0
 public void ApplyToDrawableRuleset(DrawableRuleset <TObject> drawableRuleset)
 {
     drawableRuleset.Overlays.Add(new NightcoreBeatContainer());
 }
Esempio n. 13
0
 public FailAnimation(DrawableRuleset drawableRuleset)
 {
     this.drawableRuleset = drawableRuleset;
 }
Esempio n. 14
0
 public void ApplyToDrawableRuleset(DrawableRuleset <SentakkiHitObject> drawableRuleset)
 {
     // grab the input manager for future use.
     sentakkiInputManager = (SentakkiInputManager)drawableRuleset.KeyBindingInputManager;
 }
Esempio n. 15
0
        private void load(AudioManager audio, IAPIProvider api, OsuConfigManager config)
        {
            this.api = api;

            Mods.Value = base.Mods.Value.Select(m => m.CreateCopy()).ToArray();

            WorkingBeatmap working = loadBeatmap();

            if (working == null)
            {
                return;
            }

            sampleRestart = audio.Sample.Get(@"Gameplay/restart");

            mouseWheelDisabled = config.GetBindable <bool>(OsuSetting.MouseDisableWheel);
            showStoryboard     = config.GetBindable <bool>(OsuSetting.ShowStoryboard);

            ScoreProcessor = DrawableRuleset.CreateScoreProcessor();
            ScoreProcessor.Mods.BindTo(Mods);

            if (!ScoreProcessor.Mode.Disabled)
            {
                config.BindWith(OsuSetting.ScoreDisplayMode, ScoreProcessor.Mode);
            }

            InternalChild = GameplayClockContainer = new GameplayClockContainer(working, Mods.Value, DrawableRuleset.GameplayStartTime);

            GameplayClockContainer.Children = new[]
            {
                StoryboardContainer = CreateStoryboardContainer(),
                new ScalingContainer(ScalingMode.Gameplay)
                {
                    Child = new LocalSkinOverrideContainer(working.Skin)
                    {
                        RelativeSizeAxes = Axes.Both,
                        Child            = DrawableRuleset
                    }
                },
                new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Breaks = working.Beatmap.Breaks
                },
                // display the cursor above some HUD elements.
                DrawableRuleset.Cursor?.CreateProxy() ?? new Container(),
                HUDOverlay = new HUDOverlay(ScoreProcessor, DrawableRuleset, Mods.Value)
                {
                    HoldToQuit            = { Action = performUserRequestedExit },
                    PlayerSettingsOverlay = { PlaybackSettings = { UserPlaybackRate = { BindTarget = GameplayClockContainer.UserPlaybackRate } } },
                    KeyCounter            = { Visible = { BindTarget = DrawableRuleset.HasReplayLoaded } },
                    RequestSeek           = GameplayClockContainer.Seek,
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre
                },
                new SkipOverlay(DrawableRuleset.GameplayStartTime)
                {
                    RequestSeek = GameplayClockContainer.Seek
                },
                FailOverlay = new FailOverlay
                {
                    OnRetry = Restart,
                    OnQuit  = performUserRequestedExit,
                },
                PauseOverlay = new PauseOverlay
                {
                    OnResume = Resume,
                    Retries  = RestartCount,
                    OnRetry  = Restart,
                    OnQuit   = performUserRequestedExit,
                },
                new HotkeyRetryOverlay
                {
                    Action = () =>
                    {
                        if (!this.IsCurrentScreen())
                        {
                            return;
                        }

                        fadeOut(true);
                        Restart();
                    },
                }
            };

            // bind clock into components that require it
            DrawableRuleset.IsPaused.BindTo(GameplayClockContainer.IsPaused);

            // load storyboard as part of player's load if we can
            initializeStoryboard(false);

            // Bind ScoreProcessor to ourselves
            ScoreProcessor.AllJudged += onCompletion;
            ScoreProcessor.Failed    += onFail;

            foreach (var mod in Mods.Value.OfType <IApplicableToScoreProcessor>())
            {
                mod.ApplyToScoreProcessor(ScoreProcessor);
            }
        }
Esempio n. 16
0
 public void ApplyToDrawableRuleset(DrawableRuleset <OsuHitObject> drawableRuleset)
 {
     drawableRuleset.Playfield.RegisterPool <StrictTrackingSliderTailCircle, StrictTrackingDrawableSliderTail>(10, 100);
 }
Esempio n. 17
0
 public void ApplyToDrawableRuleset(DrawableRuleset <SentakkiHitObject> drawableRuleset)
 {
     (drawableRuleset.Playfield as SentakkiPlayfield).RevolutionDuration.Value = RevolutionDuration.Value;
 }
Esempio n. 18
0
 public virtual void ApplyToDrawableRuleset(DrawableRuleset <T> drawableRuleset)
 {
     // AlwaysPresent required for hitsounds
     drawableRuleset.AlwaysPresent = true;
     drawableRuleset.Hide();
 }
Esempio n. 19
0
 public override void ApplyToDrawableRuleset(DrawableRuleset <CatchHitObject> drawableRuleset)
 {
     playfield = (CatchPlayfield)drawableRuleset.Playfield;
     base.ApplyToDrawableRuleset(drawableRuleset);
 }
Esempio n. 20
0
 public OsuScoreProcessor(DrawableRuleset <OsuHitObject> drawableRuleset)
     : base(drawableRuleset)
 {
 }
Esempio n. 21
0
        /// <summary>
        /// Run any recording / playback setup for replays.
        /// </summary>
        protected virtual void PrepareReplay()
        {
            DrawableRuleset.SetRecordTarget(recordingScore = new Score());

            ScoreProcessor.NewJudgement += result => ScoreProcessor.PopulateScore(recordingScore.ScoreInfo);
        }
 public virtual void ApplyToDrawableRuleset(DrawableRuleset <T> drawableRuleset) => drawableRuleset.SetReplayScore(CreateReplayScore(drawableRuleset.Beatmap));
Esempio n. 23
0
        public HUDOverlay(ScoreProcessor scoreProcessor, HealthProcessor healthProcessor, DrawableRuleset drawableRuleset, IReadOnlyList <Mod> mods)
        {
            this.scoreProcessor  = scoreProcessor;
            this.healthProcessor = healthProcessor;
            this.drawableRuleset = drawableRuleset;
            this.mods            = mods;

            RelativeSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                FailingLayer        = CreateFailingLayer(),
                visibilityContainer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = new GridContainer
                    {
                        RelativeSizeAxes = Axes.Both,
                        Content          = new[]
                        {
                            new Drawable[]
                            {
                                new Container
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Children         = new Drawable[]
                                    {
                                        HealthDisplay   = CreateHealthDisplay(),
                                        AccuracyCounter = CreateAccuracyCounter(),
                                        ScoreCounter    = CreateScoreCounter(),
                                        ComboCounter    = CreateComboCounter(),
                                        HitErrorDisplay = CreateHitErrorDisplayOverlay(),
                                    }
                                },
                            },
                            new Drawable[]
                            {
                                Progress = CreateProgress(),
                            }
                        },
                        RowDimensions = new[]
                        {
                            new Dimension(),
                            new Dimension(GridSizeMode.AutoSize)
                        }
                    },
                },
                topRightElements = new FillFlowContainer
                {
                    Anchor       = Anchor.TopRight,
                    Origin       = Anchor.TopRight,
                    Margin       = new MarginPadding(10),
                    Spacing      = new Vector2(10),
                    AutoSizeAxes = Axes.Both,
                    Direction    = FillDirection.Vertical,
                    Children     = new Drawable[]
                    {
                        ModDisplay            = CreateModsContainer(),
                        PlayerSettingsOverlay = CreatePlayerSettingsOverlay(),
                    }
                },
                bottomRightElements = new FillFlowContainer
                {
                    Anchor         = Anchor.BottomRight,
                    Origin         = Anchor.BottomRight,
                    Margin         = new MarginPadding(10),
                    Spacing        = new Vector2(10),
                    AutoSizeAxes   = Axes.Both,
                    LayoutDuration = FADE_DURATION / 2,
                    LayoutEasing   = FADE_EASING,
                    Direction      = FillDirection.Vertical,
                    Children       = new Drawable[]
                    {
                        KeyCounter = CreateKeyCounter(),
                        HoldToQuit = CreateHoldForMenuButton(),
                    }
                }
            };
        }
 public void ApplyToDrawableRuleset(DrawableRuleset <CatchHitObject> drawableRuleset)
 {
     this.drawableRuleset = drawableRuleset;
 }
Esempio n. 25
0
File: Player.cs Progetto: ekrctb/osu
 /// <summary>
 /// Run any recording / playback setup for replays.
 /// </summary>
 protected virtual void PrepareReplay()
 {
     DrawableRuleset.SetRecordTarget(Score);
 }
Esempio n. 26
0
 protected override void PrepareReplay()
 {
     DrawableRuleset?.SetReplayScore(score);
 }
Esempio n. 27
0
 public void ApplyToDrawableRuleset(DrawableRuleset <OsuHitObject> drawableRuleset)
 {
     // grab the input manager for future use.
     osuInputManager = (OsuInputManager)drawableRuleset.KeyBindingInputManager;
 }
Esempio n. 28
0
 public void ApplyToDrawableRuleset(DrawableRuleset <OsuHitObject> drawableRuleset)
 {
     drawableRuleset.Overlays.Add(new Metronome(drawableRuleset.Beatmap.HitObjects.First().StartTime));
 }
Esempio n. 29
0
 private void load(DrawableRuleset drawableRuleset)
 {
     HitWindows = drawableRuleset?.FirstAvailableHitWindows ?? HitWindows.Empty;
 }
Esempio n. 30
0
 public CatchScoreProcessor(DrawableRuleset <CatchHitObject> drawableRuleset)
     : base(drawableRuleset)
 {
 }