mirror of
https://github.com/ppy/osu
synced 2025-02-17 02:47:19 +00:00
Only calculate difficulties on import for now.
This commit is contained in:
parent
9c664e5b05
commit
cd98af29c4
@ -63,8 +63,6 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
{
|
||||
BeatmapSet = beatmapSet;
|
||||
WorkingBeatmap beatmap = database.GetWorkingBeatmap(BeatmapSet.Beatmaps.FirstOrDefault());
|
||||
foreach (var b in BeatmapSet.Beatmaps)
|
||||
b.StarDifficulty = (float)(database.GetWorkingBeatmap(b).Beatmap?.CalculateStarDifficulty() ?? -1f);
|
||||
|
||||
Header = new BeatmapSetHeader(beatmap)
|
||||
{
|
||||
|
@ -138,7 +138,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
},
|
||||
starCounter = new StarCounter
|
||||
{
|
||||
Count = beatmap.StarDifficulty,
|
||||
Count = (float)beatmap.StarDifficulty,
|
||||
Scale = new Vector2(0.8f),
|
||||
}
|
||||
}
|
||||
|
@ -236,6 +236,8 @@ namespace osu.Game.Database
|
||||
// TODO: Diff beatmap metadata with set metadata and leave it here if necessary
|
||||
beatmap.BeatmapInfo.Metadata = null;
|
||||
|
||||
beatmap.BeatmapInfo.StarDifficulty = beatmap.CalculateStarDifficulty();
|
||||
|
||||
beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
|
||||
}
|
||||
beatmapSet.StoryboardFile = archive.StoryboardFilename;
|
||||
|
@ -75,16 +75,7 @@ namespace osu.Game.Database
|
||||
// Metadata
|
||||
public string Version { get; set; }
|
||||
|
||||
private float starDifficulty = -1;
|
||||
public float StarDifficulty
|
||||
{
|
||||
get
|
||||
{
|
||||
return starDifficulty < 0 ? (Difficulty?.OverallDifficulty ?? 5) : starDifficulty;
|
||||
}
|
||||
|
||||
set { starDifficulty = value; }
|
||||
}
|
||||
public double StarDifficulty { get; set; }
|
||||
|
||||
public bool Equals(BeatmapInfo other)
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Database
|
||||
[OneToMany(CascadeOperations = CascadeOperation.All)]
|
||||
public List<BeatmapInfo> Beatmaps { get; set; }
|
||||
|
||||
public float MaxStarDifficulty => Beatmaps.Max(b => b.StarDifficulty);
|
||||
public double MaxStarDifficulty => Beatmaps.Max(b => b.StarDifficulty);
|
||||
|
||||
public bool DeletePending { get; set; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user