mirror of
https://github.com/osukey/osukey.git
synced 2025-05-11 00:27:23 +09:00
Merge remote-tracking branch 'upstream/master' into rider-configuration
This commit is contained in:
commit
487c25c3dd
@ -57,7 +57,6 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
public override void Add(DrawableHitObject h)
|
public override void Add(DrawableHitObject h)
|
||||||
{
|
{
|
||||||
h.Depth = (float)h.HitObject.StartTime;
|
|
||||||
h.OnJudgement += onJudgement;
|
h.OnJudgement += onJudgement;
|
||||||
|
|
||||||
base.Add(h);
|
base.Add(h);
|
||||||
|
@ -205,7 +205,6 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
/// <param name="hitObject">The DrawableHitObject to add.</param>
|
/// <param name="hitObject">The DrawableHitObject to add.</param>
|
||||||
public override void Add(DrawableHitObject hitObject)
|
public override void Add(DrawableHitObject hitObject)
|
||||||
{
|
{
|
||||||
hitObject.Depth = (float)hitObject.HitObject.StartTime;
|
|
||||||
hitObject.AccentColour = AccentColour;
|
hitObject.AccentColour = AccentColour;
|
||||||
hitObject.OnJudgement += OnJudgement;
|
hitObject.OnJudgement += OnJudgement;
|
||||||
|
|
||||||
@ -263,21 +262,13 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
public bool OnPressed(ManiaAction action)
|
public bool OnPressed(ManiaAction action)
|
||||||
{
|
{
|
||||||
// Play the sounds of the next hitobject
|
if (action != Action)
|
||||||
if (HitObjects.AliveObjects.Any())
|
|
||||||
{
|
|
||||||
// If there are alive hitobjects, we can abuse the fact that AliveObjects are sorted by time (see: Add())
|
|
||||||
HitObjects.AliveObjects.First().PlaySamples();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// If not, we do a slow search - we might want to do a BinarySearch here if this becomes problematic
|
|
||||||
// We fallback to LastOrDefault() if we're beyond the last note in the map
|
|
||||||
var hitObject = HitObjects.Objects.FirstOrDefault(h => h.HitObject.StartTime > Time.Current) ?? HitObjects.Objects.LastOrDefault();
|
|
||||||
hitObject?.PlaySamples();
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
var hitObject = HitObjects.Objects.LastOrDefault(h => h.HitObject.StartTime > Time.Current) ?? HitObjects.Objects.FirstOrDefault();
|
||||||
|
hitObject?.PlaySamples();
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OnReleased(ManiaAction action) => false;
|
public bool OnReleased(ManiaAction action) => false;
|
||||||
|
@ -55,8 +55,6 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
|
|
||||||
public override void Add(DrawableHitObject h)
|
public override void Add(DrawableHitObject h)
|
||||||
{
|
{
|
||||||
h.Depth = (float)h.HitObject.StartTime;
|
|
||||||
|
|
||||||
h.OnJudgement += onJudgement;
|
h.OnJudgement += onJudgement;
|
||||||
|
|
||||||
var c = h as IDrawableHitObjectWithProxiedApproach;
|
var c = h as IDrawableHitObjectWithProxiedApproach;
|
||||||
|
@ -208,8 +208,6 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
public override void Add(DrawableHitObject h)
|
public override void Add(DrawableHitObject h)
|
||||||
{
|
{
|
||||||
h.Depth = (float)h.HitObject.StartTime;
|
|
||||||
|
|
||||||
h.OnJudgement += OnJudgement;
|
h.OnJudgement += OnJudgement;
|
||||||
|
|
||||||
base.Add(h);
|
base.Add(h);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
|
||||||
@ -15,5 +16,15 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
public virtual void Add(DrawableHitObject hitObject) => AddInternal(hitObject);
|
public virtual void Add(DrawableHitObject hitObject) => AddInternal(hitObject);
|
||||||
public virtual bool Remove(DrawableHitObject hitObject) => RemoveInternal(hitObject);
|
public virtual bool Remove(DrawableHitObject hitObject) => RemoveInternal(hitObject);
|
||||||
|
|
||||||
|
protected override int Compare(Drawable x, Drawable y)
|
||||||
|
{
|
||||||
|
if (!(x is DrawableHitObject xObj) || !(y is DrawableHitObject yObj))
|
||||||
|
return base.Compare(x, y);
|
||||||
|
|
||||||
|
// Put earlier hitobjects towards the end of the list, so they handle input first
|
||||||
|
int i = yObj.HitObject.StartTime.CompareTo(xObj.HitObject.StartTime);
|
||||||
|
return i == 0 ? CompareReverseChildID(x, y) : i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user