1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-05 14:22:55 +08:00
This commit is contained in:
mk56-spn 2022-12-12 11:53:07 +01:00
parent 58bf081096
commit 4d592184ca
3 changed files with 18 additions and 5 deletions

View File

@ -34,13 +34,16 @@ namespace osu.Game.Tests.Visual.Gameplay
{ {
var ruleset = CreateRuleset(); var ruleset = CreateRuleset();
var r = ruleset.CreateBeatmapConverter(Beatmap.Value.Beatmap);
var n = r.Convert().BeatmapInfo.Ruleset.CreateInstance();
Debug.Assert(ruleset != null); Debug.Assert(ruleset != null);
scoreProcessor = new ScoreProcessor(ruleset); scoreProcessor = new ScoreProcessor(n);
Child = new DependencyProvidingContainer Child = new DependencyProvidingContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
CachedDependencies = new (Type, object)[] { (typeof(ScoreProcessor), scoreProcessor), (typeof(Ruleset), ruleset) }, CachedDependencies = new (Type, object)[] { (typeof(ScoreProcessor), scoreProcessor), (typeof(Ruleset), n) },
Children = new Drawable[] Children = new Drawable[]
{ {
judgementTally = new JudgementTally(), judgementTally = new JudgementTally(),

View File

@ -9,6 +9,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
namespace osu.Game.Screens.Play.HUD.JudgementCounter namespace osu.Game.Screens.Play.HUD.JudgementCounter
{ {
@ -29,7 +30,7 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter
private JudgementRollingCounter counter = null!; private JudgementRollingCounter counter = null!;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours, DrawableRuleset ruleset)
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
InternalChild = flowContainer = new FillFlowContainer InternalChild = flowContainer = new FillFlowContainer
@ -44,7 +45,7 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter
ResultName = new OsuSpriteText ResultName = new OsuSpriteText
{ {
Font = OsuFont.Numeric.With(size: 8), Font = OsuFont.Numeric.With(size: 8),
Text = Result.ResultInfo.Displayname Text = ruleset.Ruleset.GetDisplayNameForHitResult(Result.ResultInfo.Type)
} }
} }
}; };

View File

@ -7,6 +7,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
namespace osu.Game.Screens.Play.HUD.JudgementCounter namespace osu.Game.Screens.Play.HUD.JudgementCounter
@ -21,7 +22,7 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(IBindable<WorkingBeatmap> working) private void load(IBindable<WorkingBeatmap> working)
{ {
foreach (var result in working.Value.BeatmapInfo.Ruleset.CreateInstance().GetHitResults()) foreach (var result in getRuleset(working).GetHitResults())
{ {
Results.Add(new JudgementCounterInfo Results.Add(new JudgementCounterInfo
{ {
@ -31,6 +32,14 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter
} }
} }
private Ruleset getRuleset(IBindable<WorkingBeatmap> working)
{
var ruleset = working.Value.BeatmapInfo.Ruleset.CreateInstance();
var converter = ruleset.RulesetInfo.CreateInstance().CreateBeatmapConverter(working.Value.Beatmap);
return converter.CanConvert() ? converter.Convert().BeatmapInfo.Ruleset.CreateInstance() : ruleset;
}
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();