mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:17:26 +08:00
Fix cake errors
This commit is contained in:
parent
1f48378ce7
commit
211bff6a8f
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user