public PippidonScoreProcessor(DrawableRuleset <PippidonHitObject> ruleset) : base(ruleset) { }
/// <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(); }
public override void ApplyToDrawableRuleset(DrawableRuleset <TaikoHitObject> drawableRuleset) { playfield = (TaikoPlayfield)drawableRuleset.Playfield; base.ApplyToDrawableRuleset(drawableRuleset); }
public void ApplyToDrawableRuleset(DrawableRuleset <OsuHitObject> drawableRuleset) { drawableRuleset.Overlays.Add(blinds = new DrawableOsuBlinds(drawableRuleset.Playfield, drawableRuleset.Beatmap)); }
/// <summary> /// Run any recording / playback setup for replays. /// </summary> protected virtual void PrepareReplay() { DrawableRuleset.SetRecordTarget(recordingReplay = new Replay()); }
public FailAnimation(DrawableRuleset drawableRuleset) { this.drawableRuleset = drawableRuleset; RelativeSizeAxes = Axes.Both; }
public void ApplyToDrawableRuleset(DrawableRuleset <BosuHitObject> drawableRuleset) { drawableRuleset.Cursor.Add(new MouseInputHelper((BosuPlayfield)drawableRuleset.Playfield)); }
public TaikoScoreProcessor(DrawableRuleset <TaikoHitObject> drawableRuleset) : base(drawableRuleset) { }
protected virtual void BindDrawableRuleset(DrawableRuleset drawableRuleset) { (drawableRuleset as ICanAttachKeyCounter)?.Attach(KeyCounter); replayLoaded.BindTo(drawableRuleset.HasReplayLoaded); }
public void ApplyToDrawableRuleset(DrawableRuleset <TauHitObject> drawableRuleset) { // grab the input manager for future use. tauInputManager = (TauInputManager)drawableRuleset.KeyBindingInputManager; tauInputManager.AllowUserPresses = false; }
public void ApplyToDrawableRuleset(DrawableRuleset <TauHitObject> drawableRuleset) { drawableRuleset.Overlays.Add(blinds = new DrawableTauBlinds(drawableRuleset.Playfield.HitObjectContainer, drawableRuleset.Beatmap)); }
public void ApplyToDrawableRuleset(DrawableRuleset <TObject> drawableRuleset) { drawableRuleset.Overlays.Add(new NightcoreBeatContainer()); }
public FailAnimation(DrawableRuleset drawableRuleset) { this.drawableRuleset = drawableRuleset; }
public void ApplyToDrawableRuleset(DrawableRuleset <SentakkiHitObject> drawableRuleset) { // grab the input manager for future use. sentakkiInputManager = (SentakkiInputManager)drawableRuleset.KeyBindingInputManager; }
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); } }
public void ApplyToDrawableRuleset(DrawableRuleset <OsuHitObject> drawableRuleset) { drawableRuleset.Playfield.RegisterPool <StrictTrackingSliderTailCircle, StrictTrackingDrawableSliderTail>(10, 100); }
public void ApplyToDrawableRuleset(DrawableRuleset <SentakkiHitObject> drawableRuleset) { (drawableRuleset.Playfield as SentakkiPlayfield).RevolutionDuration.Value = RevolutionDuration.Value; }
public virtual void ApplyToDrawableRuleset(DrawableRuleset <T> drawableRuleset) { // AlwaysPresent required for hitsounds drawableRuleset.AlwaysPresent = true; drawableRuleset.Hide(); }
public override void ApplyToDrawableRuleset(DrawableRuleset <CatchHitObject> drawableRuleset) { playfield = (CatchPlayfield)drawableRuleset.Playfield; base.ApplyToDrawableRuleset(drawableRuleset); }
public OsuScoreProcessor(DrawableRuleset <OsuHitObject> drawableRuleset) : base(drawableRuleset) { }
/// <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));
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; }
/// <summary> /// Run any recording / playback setup for replays. /// </summary> protected virtual void PrepareReplay() { DrawableRuleset.SetRecordTarget(Score); }
protected override void PrepareReplay() { DrawableRuleset?.SetReplayScore(score); }
public void ApplyToDrawableRuleset(DrawableRuleset <OsuHitObject> drawableRuleset) { // grab the input manager for future use. osuInputManager = (OsuInputManager)drawableRuleset.KeyBindingInputManager; }
public void ApplyToDrawableRuleset(DrawableRuleset <OsuHitObject> drawableRuleset) { drawableRuleset.Overlays.Add(new Metronome(drawableRuleset.Beatmap.HitObjects.First().StartTime)); }
private void load(DrawableRuleset drawableRuleset) { HitWindows = drawableRuleset?.FirstAvailableHitWindows ?? HitWindows.Empty; }
public CatchScoreProcessor(DrawableRuleset <CatchHitObject> drawableRuleset) : base(drawableRuleset) { }