Merge pull request #25759 from Givikap120/arod_rate_adjust

Fix adjusted attributes tooltip not updating without mods
This commit is contained in:
Bartłomiej Dach 2023-12-14 16:09:34 +01:00 committed by GitHub
commit 73c0a0ecb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 7 deletions

View File

@ -220,7 +220,7 @@ namespace osu.Game.Tests.Visual.Online
public void TestSelectedModsDontAffectStatistics()
{
AddStep("show map", () => overlay.ShowBeatmapSet(getBeatmapSet()));
AddAssert("AR displayed as 0", () => overlay.ChildrenOfType<AdvancedStats.StatisticRow>().Single(s => s.Title == BeatmapsetsStrings.ShowStatsAr).Value == (0, null));
AddAssert("AR displayed as 0", () => overlay.ChildrenOfType<AdvancedStats.StatisticRow>().Single(s => s.Title == BeatmapsetsStrings.ShowStatsAr).Value, () => Is.EqualTo((0, 0)));
AddStep("set AR10 diff adjust", () => SelectedMods.Value = new[]
{
new OsuModDifficultyAdjust
@ -228,7 +228,7 @@ namespace osu.Game.Tests.Visual.Online
ApproachRate = { Value = 10 }
}
});
AddAssert("AR still displayed as 0", () => overlay.ChildrenOfType<AdvancedStats.StatisticRow>().Single(s => s.Title == BeatmapsetsStrings.ShowStatsAr).Value == (0, null));
AddAssert("AR still displayed as 0", () => overlay.ChildrenOfType<AdvancedStats.StatisticRow>().Single(s => s.Title == BeatmapsetsStrings.ShowStatsAr).Value, () => Is.EqualTo((0, 0)));
}
[Test]

View File

@ -89,10 +89,10 @@ namespace osu.Game.Overlays.Mods
if (originalDifficulty == null || adjustedDifficulty == null)
return;
attemptAdd("AR", bd => bd.ApproachRate);
attemptAdd("OD", bd => bd.OverallDifficulty);
attemptAdd("CS", bd => bd.CircleSize);
attemptAdd("HP", bd => bd.DrainRate);
attemptAdd("OD", bd => bd.OverallDifficulty);
attemptAdd("AR", bd => bd.ApproachRate);
if (attributesFillFlow.Any())
content.Show();

View File

@ -95,8 +95,8 @@ namespace osu.Game.Overlays.Mods
{
circleSizeDisplay = new VerticalAttributeDisplay("CS") { Shear = new Vector2(-shear, 0), },
drainRateDisplay = new VerticalAttributeDisplay("HP") { Shear = new Vector2(-shear, 0), },
approachRateDisplay = new VerticalAttributeDisplay("AR") { Shear = new Vector2(-shear, 0), },
overallDifficultyDisplay = new VerticalAttributeDisplay("OD") { Shear = new Vector2(-shear, 0), },
approachRateDisplay = new VerticalAttributeDisplay("AR") { Shear = new Vector2(-shear, 0), },
});
}

View File

@ -127,8 +127,7 @@ namespace osu.Game.Screens.Select.Details
IRulesetInfo ruleset = gameRuleset?.Value ?? beatmapInfo.Ruleset;
if (baseDifficulty != null &&
(mods.Value.Any(m => m is IApplicableToDifficulty) || mods.Value.Any(m => m is IApplicableToRate)))
if (baseDifficulty != null)
{
BeatmapDifficulty originalDifficulty = new BeatmapDifficulty(baseDifficulty);