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