mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 00:12:59 +08:00
Move HitErrorDisplayOverlay back to the HUD
This commit is contained in:
parent
d337f9b482
commit
9f64e09625
@ -115,7 +115,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
}
|
||||
});
|
||||
|
||||
Add(display = new BarHitErrorDisplay(overallDifficulty, hitWindows)
|
||||
Add(display = new BarHitErrorDisplay(hitWindows)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
@ -15,6 +15,7 @@ using osu.Game.Overlays.Notifications;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.Play.HitErrorDisplay;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
@ -33,6 +34,7 @@ namespace osu.Game.Screens.Play
|
||||
public readonly HealthDisplay HealthDisplay;
|
||||
public readonly SongProgress Progress;
|
||||
public readonly ModDisplay ModDisplay;
|
||||
public readonly HitErrorDisplayOverlay HitErrorDisplayOverlay;
|
||||
public readonly HoldForMenuButton HoldToQuit;
|
||||
public readonly PlayerSettingsOverlay PlayerSettingsOverlay;
|
||||
|
||||
@ -84,6 +86,7 @@ namespace osu.Game.Screens.Play
|
||||
HealthDisplay = CreateHealthDisplay(),
|
||||
Progress = CreateProgress(),
|
||||
ModDisplay = CreateModsContainer(),
|
||||
HitErrorDisplayOverlay = CreateHitErrorDisplayOverlay(),
|
||||
}
|
||||
},
|
||||
PlayerSettingsOverlay = CreatePlayerSettingsOverlay(),
|
||||
@ -256,6 +259,11 @@ namespace osu.Game.Screens.Play
|
||||
Margin = new MarginPadding { Top = 20, Right = 10 },
|
||||
};
|
||||
|
||||
protected virtual HitErrorDisplayOverlay CreateHitErrorDisplayOverlay() => new HitErrorDisplayOverlay(scoreProcessor)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
};
|
||||
|
||||
protected virtual PlayerSettingsOverlay CreatePlayerSettingsOverlay() => new PlayerSettingsOverlay();
|
||||
|
||||
protected virtual void BindProcessor(ScoreProcessor processor)
|
||||
|
@ -34,8 +34,8 @@ namespace osu.Game.Screens.Play.HitErrorDisplay
|
||||
private readonly Queue<double> judgementOffsets = new Queue<double>();
|
||||
private readonly double maxHitWindows;
|
||||
|
||||
public BarHitErrorDisplay(float overallDifficulty, HitWindows hitWindows, bool reversed = false)
|
||||
: base(overallDifficulty, hitWindows)
|
||||
public BarHitErrorDisplay(HitWindows hitWindows, bool reversed = false)
|
||||
: base(hitWindows)
|
||||
{
|
||||
maxHitWindows = HitWindows.Meh == 0 ? HitWindows.Good : HitWindows.Meh;
|
||||
|
||||
|
@ -11,10 +11,9 @@ namespace osu.Game.Screens.Play.HitErrorDisplay
|
||||
{
|
||||
protected readonly HitWindows HitWindows;
|
||||
|
||||
protected HitErrorDisplay(float overallDifficulty, HitWindows hitWindows)
|
||||
protected HitErrorDisplay(HitWindows hitWindows)
|
||||
{
|
||||
HitWindows = hitWindows;
|
||||
HitWindows.SetDifficulty(overallDifficulty);
|
||||
}
|
||||
|
||||
public abstract void OnNewJudgement(JudgementResult newJudgement);
|
||||
|
@ -21,22 +21,18 @@ namespace osu.Game.Screens.Play.HitErrorDisplay
|
||||
private readonly Bindable<ScoreMeterType> type = new Bindable<ScoreMeterType>();
|
||||
private readonly HitWindows hitWindows;
|
||||
private readonly ScoreProcessor processor;
|
||||
private readonly float overallDifficulty;
|
||||
|
||||
public HitErrorDisplayOverlay(ScoreProcessor processor, WorkingBeatmap workingBeatmap)
|
||||
public HitErrorDisplayOverlay(ScoreProcessor processor)
|
||||
{
|
||||
this.processor = processor;
|
||||
|
||||
overallDifficulty = workingBeatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty;
|
||||
hitWindows = processor.CreateHitWindows();
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
private void load(OsuConfigManager config, Bindable<WorkingBeatmap> workingBeatmap)
|
||||
{
|
||||
config.BindWith(OsuSetting.ScoreMeter, type);
|
||||
hitWindows.SetDifficulty(workingBeatmap.Value.BeatmapInfo.BaseDifficulty.OverallDifficulty);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -80,7 +76,7 @@ namespace osu.Game.Screens.Play.HitErrorDisplay
|
||||
|
||||
private void createNew(bool reversed = false)
|
||||
{
|
||||
var display = new BarHitErrorDisplay(overallDifficulty, hitWindows, reversed)
|
||||
var display = new BarHitErrorDisplay(hitWindows, reversed)
|
||||
{
|
||||
Margin = new MarginPadding(margin),
|
||||
Anchor = reversed ? Anchor.CentreRight : Anchor.CentreLeft,
|
||||
|
@ -24,7 +24,6 @@ using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Play.HitErrorDisplay;
|
||||
using osu.Game.Screens.Ranking;
|
||||
using osu.Game.Skinning;
|
||||
using osu.Game.Users;
|
||||
@ -74,8 +73,6 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected HUDOverlay HUDOverlay { get; private set; }
|
||||
|
||||
protected HitErrorDisplayOverlay HitErrorDisplayOverlay { get; private set; }
|
||||
|
||||
public bool LoadedBeatmapSuccessfully => DrawableRuleset?.Objects.Any() == true;
|
||||
|
||||
protected GameplayClockContainer GameplayClockContainer { get; private set; }
|
||||
@ -160,7 +157,6 @@ namespace osu.Game.Screens.Play
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre
|
||||
},
|
||||
HitErrorDisplayOverlay = new HitErrorDisplayOverlay(ScoreProcessor, working),
|
||||
new SkipOverlay(DrawableRuleset.GameplayStartTime)
|
||||
{
|
||||
RequestSeek = GameplayClockContainer.Seek
|
||||
|
Loading…
Reference in New Issue
Block a user