From e55077436deb24c071ee708c4c9827869356b101 Mon Sep 17 00:00:00 2001 From: Flutterish Date: Thu, 11 Mar 2021 21:00:19 +0100 Subject: [PATCH] bump osu, add defaults for color bindables --- Hitokori/Difficulty/HitokoriDifficultyCalculator.cs | 4 ++-- Hitokori/Difficulty/Skills/Reading.cs | 3 +++ Hitokori/Difficulty/Skills/Speed.cs | 3 +++ Hitokori/Objects/Drawables/Hitokori/Hi.cs | 6 +++--- Hitokori/Objects/Drawables/Hitokori/Kori.cs | 6 +++--- Hitokori/Objects/Drawables/Hitokori/TheUnwantedChild.cs | 6 +++--- Hitokori/osu.Game.Rulesets.Hitokori.csproj | 2 +- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Hitokori/Difficulty/HitokoriDifficultyCalculator.cs b/Hitokori/Difficulty/HitokoriDifficultyCalculator.cs index a8789f6..65e096a 100644 --- a/Hitokori/Difficulty/HitokoriDifficultyCalculator.cs +++ b/Hitokori/Difficulty/HitokoriDifficultyCalculator.cs @@ -37,8 +37,8 @@ protected override IEnumerable CreateDifficultyHitObjects ( } } - protected override Skill[] CreateSkills ( IBeatmap beatmap ) { - return new Skill[] { new Reading(), new Speed() }; + protected override Skill[] CreateSkills ( IBeatmap beatmap, Mod[] mods ) { + return new Skill[] { new Reading( mods ), new Speed( mods ) }; } } } diff --git a/Hitokori/Difficulty/Skills/Reading.cs b/Hitokori/Difficulty/Skills/Reading.cs index 46a0cc1..0b7e840 100644 --- a/Hitokori/Difficulty/Skills/Reading.cs +++ b/Hitokori/Difficulty/Skills/Reading.cs @@ -1,5 +1,6 @@ using osu.Game.Rulesets.Difficulty.Preprocessing; using osu.Game.Rulesets.Difficulty.Skills; +using osu.Game.Rulesets.Mods; using System; namespace osu.Game.Rulesets.Hitokori.Difficulty.Skills { @@ -9,6 +10,8 @@ public class Reading : Skill { private const double DIRECTION_CHANGE_BONUS = 1.05; + public Reading ( Mod[] mods ) : base( mods ) { } + protected override double StrainValueOf ( DifficultyHitObject current ) { HitokoriDifficultyHitObject hitokoriCurrent = (HitokoriDifficultyHitObject)current; diff --git a/Hitokori/Difficulty/Skills/Speed.cs b/Hitokori/Difficulty/Skills/Speed.cs index b43e8aa..38714bf 100644 --- a/Hitokori/Difficulty/Skills/Speed.cs +++ b/Hitokori/Difficulty/Skills/Speed.cs @@ -1,5 +1,6 @@ using osu.Game.Rulesets.Difficulty.Preprocessing; using osu.Game.Rulesets.Difficulty.Skills; +using osu.Game.Rulesets.Mods; using System; namespace osu.Game.Rulesets.Hitokori.Difficulty.Skills { @@ -17,6 +18,8 @@ public class Speed : Skill { /// private const double BASE_BPM = 120; + public Speed ( Mod[] mods ) : base( mods ) { } + protected override double StrainValueOf ( DifficultyHitObject current ) { HitokoriDifficultyHitObject hitokoriCurrent = (HitokoriDifficultyHitObject)current; double bpm = Math.Min( hitokoriCurrent.BPM, MAX_BPM ); diff --git a/Hitokori/Objects/Drawables/Hitokori/Hi.cs b/Hitokori/Objects/Drawables/Hitokori/Hi.cs index c979f99..ebf5b4b 100644 --- a/Hitokori/Objects/Drawables/Hitokori/Hi.cs +++ b/Hitokori/Objects/Drawables/Hitokori/Hi.cs @@ -8,10 +8,10 @@ namespace osu.Game.Rulesets.Hitokori.Objects.Drawables.Hitokori { public class Hi : StandardOrbital { public Hi ( IHasTilePosition parent, Radius radius ) : base( parent, radius, Color4.Red ) { } - Bindable color = new(); - [BackgroundDependencyLoader] + Bindable color = new( Color4.Red ); + [BackgroundDependencyLoader(permitNulls: true)] private void load ( HitokoriSettingsManager config ) { - config.BindWith( HitokoriSetting.HiColor, color ); + config?.BindWith( HitokoriSetting.HiColor, color ); color.BindValueChanged( v => { Colour = v.NewValue; }, true ); diff --git a/Hitokori/Objects/Drawables/Hitokori/Kori.cs b/Hitokori/Objects/Drawables/Hitokori/Kori.cs index 6fc2a64..59125f8 100644 --- a/Hitokori/Objects/Drawables/Hitokori/Kori.cs +++ b/Hitokori/Objects/Drawables/Hitokori/Kori.cs @@ -8,10 +8,10 @@ namespace osu.Game.Rulesets.Hitokori.Objects.Drawables.Hitokori { public class Kori : StandardOrbital { public Kori ( IHasTilePosition parent, Radius radius ) : base( parent, radius, Color4.Blue ) { } - Bindable color = new(); - [BackgroundDependencyLoader] + Bindable color = new( Color4.Blue ); + [BackgroundDependencyLoader(permitNulls: true)] private void load ( HitokoriSettingsManager config ) { - config.BindWith( HitokoriSetting.KoriColor, color ); + config?.BindWith( HitokoriSetting.KoriColor, color ); color.BindValueChanged( v => { Colour = v.NewValue; }, true ); diff --git a/Hitokori/Objects/Drawables/Hitokori/TheUnwantedChild.cs b/Hitokori/Objects/Drawables/Hitokori/TheUnwantedChild.cs index d0faa74..cccd9f6 100644 --- a/Hitokori/Objects/Drawables/Hitokori/TheUnwantedChild.cs +++ b/Hitokori/Objects/Drawables/Hitokori/TheUnwantedChild.cs @@ -8,10 +8,10 @@ namespace osu.Game.Rulesets.Hitokori.Objects.Drawables.Hitokori { public class TheUnwantedChild : StandardOrbital { public TheUnwantedChild ( IHasTilePosition parent, Radius radius ) : base( parent, radius, Color4.Green ) { } - Bindable color = new(); - [BackgroundDependencyLoader] + Bindable color = new( Color4.Green ); + [BackgroundDependencyLoader(permitNulls: true)] private void load ( HitokoriSettingsManager config ) { - config.BindWith( HitokoriSetting.GreenBitchColor, color ); + config?.BindWith( HitokoriSetting.GreenBitchColor, color ); color.BindValueChanged( v => { Colour = v.NewValue; }, true ); diff --git a/Hitokori/osu.Game.Rulesets.Hitokori.csproj b/Hitokori/osu.Game.Rulesets.Hitokori.csproj index 88e67d3..61e5635 100644 --- a/Hitokori/osu.Game.Rulesets.Hitokori.csproj +++ b/Hitokori/osu.Game.Rulesets.Hitokori.csproj @@ -6,7 +6,7 @@ - +