diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounter.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounter.cs index a4ebd80e9f..3f7dbefcd1 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounter.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounter.cs @@ -112,8 +112,6 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter { protected override OsuSpriteText CreateSpriteText() => base.CreateSpriteText().With(s => s.Font = s.Font.With(fixedWidth: true, size: 16)); - - protected override double RollingDuration => 750; } } } diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs index 4880314f29..36466fa8a9 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs @@ -33,9 +33,10 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter [Resolved] private JudgementTally tally { get; set; } = null!; - protected FillFlowContainer JudgementContainer; + protected FillFlowContainer JudgementContainer = null!; - public JudgementCounterDisplay() + [BackgroundDependencyLoader] + private void load() { AutoSizeAxes = Axes.Both; InternalChild = JudgementContainer = new FillFlowContainer @@ -44,17 +45,15 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter Spacing = new Vector2(10), AutoSizeAxes = Axes.Both }; - } - protected override void LoadComplete() - { - //Adding this in "load" will cause the component to not load in properly after the first beatmap attempt. Or after existing and reentering. - //this does not happen in tests, or in the skin editor component preview button. foreach (var result in tally.Results) { JudgementContainer.Add(createCounter(result)); } + } + protected override void LoadComplete() + { base.LoadComplete(); FlowDirection.BindValueChanged(direction => diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementTally.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementTally.cs index a88b18ff6f..e6bc336b0b 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementTally.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementTally.cs @@ -34,19 +34,17 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter protected override void LoadComplete() { base.LoadComplete(); + scoreProcessor.NewJudgement += judgement => { foreach (JudgementCounterInfo result in Results.Where(result => result.Type == judgement.Type)) - { result.ResultCount.Value++; - } }; + scoreProcessor.JudgementReverted += judgement => { foreach (JudgementCounterInfo result in Results.Where(result => result.Type == judgement.Type)) - { result.ResultCount.Value--; - } }; } } diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 89d02e5fb0..728da22123 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -107,6 +107,8 @@ namespace osu.Game.Screens.Play Children = new Drawable[] { CreateFailingLayer(), + //Needs to be initialized before skinnable drawables. + tally = new JudgementTally(), mainComponents = new MainComponentsContainer { AlwaysPresent = true, @@ -150,7 +152,6 @@ namespace osu.Game.Screens.Play Spacing = new Vector2(5) }, clicksPerSecondCalculator = new ClicksPerSecondCalculator(), - tally = new JudgementTally() }; hideTargets = new List { mainComponents, KeyCounter, topRightElements };