1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 16:07:24 +08:00
This commit is contained in:
Givikap120 2024-08-09 22:51:18 +03:00
parent 6a483b5882
commit 1355af491e
2 changed files with 16 additions and 13 deletions

View File

@ -162,17 +162,19 @@ namespace osu.Game.Tests.Visual.SongSelect
{ {
double starRating = lookup.BeatmapInfo.Difficulty.OverallDifficulty; double starRating = lookup.BeatmapInfo.Difficulty.OverallDifficulty;
ModDoubleTime? DT = lookup.OrderedMods.OfType<ModDoubleTime>().SingleOrDefault(); ModDoubleTime? dt = lookup.OrderedMods.OfType<ModDoubleTime>().SingleOrDefault();
if (DT != null) starRating *= DT.SpeedChange.Value; if (dt != null) starRating *= dt.SpeedChange.Value;
starRating += (double)lookup.Ruleset.OnlineID / 10; starRating += (double)lookup.Ruleset.OnlineID / 10;
var attributes = new DifficultyAttributes(); var attributes = new DifficultyAttributes
attributes.StarRating = starRating; {
attributes.Mods = lookup.OrderedMods; StarRating = starRating,
Mods = lookup.OrderedMods,
// Use this as ruleset ID field // Use this as ruleset ID field
attributes.MaxCombo = lookup.Ruleset.OnlineID; MaxCombo = lookup.Ruleset.OnlineID
};
return Task.FromResult<StarDifficulty?>(new StarDifficulty(attributes)); return Task.FromResult<StarDifficulty?>(new StarDifficulty(attributes));
} }
@ -180,7 +182,8 @@ namespace osu.Game.Tests.Visual.SongSelect
private partial class TestPerformanceCalculator : PerformanceCalculator private partial class TestPerformanceCalculator : PerformanceCalculator
{ {
public TestPerformanceCalculator(Ruleset ruleset) : base(ruleset) public TestPerformanceCalculator(Ruleset ruleset)
: base(ruleset)
{ {
} }
@ -191,10 +194,10 @@ namespace osu.Game.Tests.Visual.SongSelect
Assert.AreEqual(Ruleset.RulesetInfo.OnlineID, score.Ruleset.OnlineID); Assert.AreEqual(Ruleset.RulesetInfo.OnlineID, score.Ruleset.OnlineID);
Assert.AreEqual(Ruleset.RulesetInfo.OnlineID, attributes.MaxCombo); Assert.AreEqual(Ruleset.RulesetInfo.OnlineID, attributes.MaxCombo);
var result = new PerformanceAttributes(); var result = new PerformanceAttributes
result.Total = attributes.StarRating * 100; {
Total = attributes.StarRating * 100 + Ruleset.RulesetInfo.OnlineID
result.Total += Ruleset.RulesetInfo.OnlineID; };
if (attributes.Mods.Any(m => m is ModHidden)) if (attributes.Mods.Any(m => m is ModHidden))
result.Total += 69; result.Total += 69;

View File

@ -158,7 +158,7 @@ namespace osu.Game.Skinning.Components
{ {
// Skip if not relevant attribute // Skip if not relevant attribute
if (!((Attribute.Value >= BeatmapAttribute.Title && Attribute.Value <= BeatmapAttribute.Creator) if (!((Attribute.Value >= BeatmapAttribute.Title && Attribute.Value <= BeatmapAttribute.Creator)
|| Attribute.Value == BeatmapAttribute.RankedStatus || Attribute.Value == BeatmapAttribute.Source)) || Attribute.Value == BeatmapAttribute.RankedStatus || Attribute.Value == BeatmapAttribute.Source))
return; return;
valueDictionary[BeatmapAttribute.Title] = new RomanisableString(beatmap.Value.BeatmapInfo.Metadata.TitleUnicode, beatmap.Value.BeatmapInfo.Metadata.Title); valueDictionary[BeatmapAttribute.Title] = new RomanisableString(beatmap.Value.BeatmapInfo.Metadata.TitleUnicode, beatmap.Value.BeatmapInfo.Metadata.Title);