mirror of
https://github.com/ppy/osu
synced 2025-02-04 20:32:12 +00:00
Allow settings to be added to replay HUD from ruleset
This commit is contained in:
parent
992a0da957
commit
cc3d220f6f
@ -1,11 +1,10 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Input.Handlers;
|
||||
@ -31,20 +30,19 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
|
||||
public new OsuPlayfield Playfield => (OsuPlayfield)base.Playfield;
|
||||
|
||||
public DrawableOsuRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods = null)
|
||||
public DrawableOsuRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod>? mods = null)
|
||||
: base(ruleset, beatmap, mods)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(ReplayPlayer? replayPlayer)
|
||||
{
|
||||
if (HasReplayLoaded.Value)
|
||||
LoadComponentAsync(new ReplayAnalysisOverlay(ReplayScore.Replay, this), PlayfieldAdjustmentContainer.Add);
|
||||
|
||||
base.LoadComplete();
|
||||
if (replayPlayer != null)
|
||||
PlayfieldAdjustmentContainer.Add(new ReplayAnalysisOverlay(replayPlayer.Score.Replay, this));
|
||||
}
|
||||
|
||||
public override DrawableHitObject<OsuHitObject> CreateDrawableRepresentation(OsuHitObject h) => null;
|
||||
public override DrawableHitObject<OsuHitObject>? CreateDrawableRepresentation(OsuHitObject h) => null;
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; // always show the gameplay cursor
|
||||
|
||||
|
@ -14,6 +14,7 @@ using osu.Game.Rulesets.Objects.Pooling;
|
||||
using osu.Game.Rulesets.Osu.Replays;
|
||||
using osu.Game.Rulesets.Osu.Skinning.Default;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.Play;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -44,9 +45,9 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
private void load(ReplayPlayer replayPlayer)
|
||||
{
|
||||
AddInternal(Settings = new ReplayAnalysisSettings());
|
||||
replayPlayer.AddSettings(Settings = new ReplayAnalysisSettings());
|
||||
|
||||
LoadReplay();
|
||||
}
|
||||
|
@ -55,6 +55,16 @@ namespace osu.Game.Screens.Play
|
||||
this.createScore = createScore;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a settings group to the HUD overlay. Intended to be used by rulesets to add replay-specific settings.
|
||||
/// </summary>
|
||||
/// <param name="settings">The settings group to be shown.</param>
|
||||
public void AddSettings(PlayerSettingsGroup settings) => Schedule(() =>
|
||||
{
|
||||
settings.Expanded.Value = false;
|
||||
HUDOverlay.PlayerSettingsOverlay.Add(settings);
|
||||
});
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user