1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Fix cake errors

This commit is contained in:
Justus Franklin Tumacder 2021-04-25 09:21:25 +08:00
parent 1f48378ce7
commit 211bff6a8f
2 changed files with 7 additions and 7 deletions

View File

@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
private readonly Drawable headPiece; private readonly Drawable headPiece;
private readonly Bindable<int> Snap = new Bindable<int>(); private readonly Bindable<int> snap = new Bindable<int>();
public DrawableNote(Note hitObject) public DrawableNote(Note hitObject)
: base(hitObject) : base(hitObject)
@ -61,9 +61,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
{ {
config?.BindWith(ManiaRulesetSetting.ColourCodedNotes, configColourCodedNotes); config?.BindWith(ManiaRulesetSetting.ColourCodedNotes, configColourCodedNotes);
HitObject.StartTimeBindable.BindValueChanged(_ => Snap.Value = snapFinder.FindSnap(HitObject), true); HitObject.StartTimeBindable.BindValueChanged(_ => snap.Value = snapFinder.FindSnap(HitObject), true);
Snap.BindValueChanged(_ => updateSnapColour(), true); snap.BindValueChanged(_ => updateSnapColour(), true);
configColourCodedNotes.BindValueChanged(_ => updateSnapColour()); configColourCodedNotes.BindValueChanged(_ => updateSnapColour());
} }
} }
@ -106,12 +106,12 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
public virtual void OnReleased(ManiaAction action) public virtual void OnReleased(ManiaAction action)
{ {
} }
private void updateSnapColour() private void updateSnapColour()
{ {
Colour = configColourCodedNotes.Value Colour = configColourCodedNotes.Value
? (ColourInfo)BindableBeatDivisor.GetColourFor(Snap.Value, colours) ? (ColourInfo)BindableBeatDivisor.GetColourFor(snap.Value, colours)
: (ColourInfo)Colour4.White; : (ColourInfo)Colour4.White;
} }
} }

View File

@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Objects
this.beatmap = beatmap; this.beatmap = beatmap;
} }
private readonly static int[] snaps = { 1, 2, 3, 4, 6, 8, 12, 16 }; private static readonly int[] snaps = { 1, 2, 3, 4, 6, 8, 12, 16 };
/// <summary> /// <summary>
/// Finds the lowest beat divisor that the given HitObject aligns to. /// Finds the lowest beat divisor that the given HitObject aligns to.
@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Objects
foreach (var snap in snaps) foreach (var snap in snaps)
{ {
if (almostDivisibleBy(snapResult, currentTimingPoint.BeatLength / (double)snap)) if (almostDivisibleBy(snapResult, currentTimingPoint.BeatLength / snap))
return snap; return snap;
} }