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