Add relax mod

This commit is contained in:
tgi74000
2018-08-03 14:03:11 +02:00
parent 920d988a9e
commit 7310c38df9
5 changed files with 119 additions and 3 deletions

View File

@ -6,6 +6,8 @@ using osu.Framework.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mods;
namespace osu.Game.Rulesets.UI
{
@ -42,9 +44,12 @@ namespace osu.Game.Rulesets.UI
RelativeSizeAxes = Axes.Both;
}
private WorkingBeatmap beatmap;
[BackgroundDependencyLoader]
private void load()
private void load(IBindableBeatmap b)
{
beatmap = b.Value;
HitObjects = CreateHitObjectContainer();
HitObjects.RelativeSizeAxes = Axes.Both;
@ -87,5 +92,15 @@ namespace osu.Game.Rulesets.UI
/// Creates the container that will be used to contain the <see cref="DrawableHitObject"/>s.
/// </summary>
protected virtual HitObjectContainer CreateHitObjectContainer() => new HitObjectContainer();
protected override void Update()
{
base.Update();
if (beatmap != null)
foreach (var m in beatmap.Mods.Value)
if (m is IUpdatableByPlayfield u)
u.Update(this);
}
}
}