1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 05:32:54 +08:00

Make first object not applying custom state

This commit is contained in:
Ganendra Afrasya 2019-06-08 01:46:05 +07:00
parent f326264a85
commit 8ac64b5c16

View File

@ -2,8 +2,11 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects;
@ -11,7 +14,7 @@ using osu.Game.Rulesets.Osu.Objects.Drawables;
namespace osu.Game.Rulesets.Osu.Mods namespace osu.Game.Rulesets.Osu.Mods
{ {
internal class OsuModGrow : Mod, IApplicableToDrawableHitObjects internal class OsuModGrow : Mod, IReadFromConfig, IApplicableToDrawableHitObjects
{ {
public override string Name => "Grow"; public override string Name => "Grow";
@ -25,9 +28,16 @@ namespace osu.Game.Rulesets.Osu.Mods
public override double ScoreMultiplier => 1; public override double ScoreMultiplier => 1;
protected Bindable<bool> IncreaseFirstObjectGrowVisibility = new Bindable<bool>();
public void ReadFromConfig(OsuConfigManager config)
{
IncreaseFirstObjectGrowVisibility = config.GetBindable<bool>(OsuSetting.IncreaseFirstObjectGrowVisibility);
}
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables) public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
{ {
foreach (var drawable in drawables) foreach (var drawable in drawables.Skip(IncreaseFirstObjectGrowVisibility.Value ? 1 : 0))
{ {
switch (drawable) switch (drawable)
{ {