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

increaseFirstObjectVisibility now cannot be null

This commit is contained in:
Vidalee 2018-03-20 22:23:27 +01:00
parent cdbe6bf22d
commit 8159e219fd

View File

@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Mods
public override double ScoreMultiplier => 1.06; public override double ScoreMultiplier => 1.06;
private const double fade_in_duration_multiplier = 0.4; private const double fade_in_duration_multiplier = 0.4;
private const double fade_out_duration_multiplier = 0.3; private const double fade_out_duration_multiplier = 0.3;
private Bindable<bool> increaseFirstObjectVisibility; private Bindable<bool> increaseFirstObjectVisibility = new Bindable<bool>();
public void ReadFromConfig(OsuConfigManager config) public void ReadFromConfig(OsuConfigManager config)
{ {
@ -33,8 +33,6 @@ namespace osu.Game.Rulesets.Osu.Mods
foreach (var d in drawables.OfType<DrawableOsuHitObject>()) foreach (var d in drawables.OfType<DrawableOsuHitObject>())
{ {
//Don't hide the first object if the increaseFirstObjectVisibility is true ("drawables" are in a reverse order -> Last() ) //Don't hide the first object if the increaseFirstObjectVisibility is true ("drawables" are in a reverse order -> Last() )
//If increaseFirstObjectVisibility is null then we're exectuing one of the tests for the hidden mod. Since it's too much
//work for just this interface to work on this tests (DI of the config..), I just make sure to not throw a null exception
if (d == drawables.Last() && (increaseFirstObjectVisibility == null || increaseFirstObjectVisibility)) continue; if (d == drawables.Last() && (increaseFirstObjectVisibility == null || increaseFirstObjectVisibility)) continue;
d.ApplyCustomUpdateState += ApplyHiddenState; d.ApplyCustomUpdateState += ApplyHiddenState;