mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Better hit object defaults setting.
This commit is contained in:
@ -9,6 +9,7 @@ using osu.Game.Modes.Judgements;
|
||||
using osu.Game.Modes.Mods;
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Objects.Types;
|
||||
using osu.Game.Screens.Play;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -86,16 +87,32 @@ namespace osu.Game.Modes.UI
|
||||
{
|
||||
Debug.Assert(beatmap != null, "HitRenderer initialized with a null beatmap.");
|
||||
|
||||
// Convert + process the beatmap
|
||||
Beatmap = CreateBeatmapConverter().Convert(beatmap.Beatmap);
|
||||
Beatmap.HitObjects.ForEach(h => CreateBeatmapProcessor().SetDefaults(h, Beatmap));
|
||||
CreateBeatmapProcessor().PostProcess(Beatmap);
|
||||
|
||||
applyMods(beatmap.Mods.Value);
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
IBeatmapConverter<TObject> converter = CreateBeatmapConverter();
|
||||
IBeatmapProcessor<TObject> processor = CreateBeatmapProcessor();
|
||||
|
||||
// Convert the beatmap
|
||||
Beatmap = converter.Convert(beatmap.Beatmap);
|
||||
|
||||
// Apply defaults
|
||||
HitObjectDefaults defaults = new HitObjectDefaults
|
||||
{
|
||||
Timing = Beatmap.TimingInfo,
|
||||
Difficulty = Beatmap.BeatmapInfo.BaseDifficulty
|
||||
};
|
||||
|
||||
foreach (var h in Beatmap.HitObjects)
|
||||
h.ApplyDefaults(defaults);
|
||||
|
||||
// Post-process the beatmap
|
||||
processor.PostProcess(Beatmap);
|
||||
|
||||
// Add mods, should always be the last thing applied to give full control to mods
|
||||
applyMods(beatmap.Mods.Value);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Applies the active mods to this HitRenderer.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user