mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:12:54 +08:00
Merge pull request #2741 from peppy/fix-object-ordering
Reverse order of exposed objects in HitObjectContainer
This commit is contained in:
commit
45b00dee0e
@ -277,8 +277,13 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
if (action != Action)
|
||||
return false;
|
||||
|
||||
var hitObject = HitObjects.Objects.LastOrDefault(h => h.HitObject.StartTime > Time.Current) ?? HitObjects.Objects.FirstOrDefault();
|
||||
hitObject?.PlaySamples();
|
||||
var nextObject =
|
||||
HitObjects.AliveObjects.FirstOrDefault(h => h.HitObject.StartTime > Time.Current) ??
|
||||
// fallback to non-alive objects to find next off-screen object
|
||||
HitObjects.Objects.FirstOrDefault(h => h.HitObject.StartTime > Time.Current) ??
|
||||
HitObjects.Objects.LastOrDefault();
|
||||
|
||||
nextObject?.PlaySamples();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -64,9 +64,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
|
||||
public override void PostProcess()
|
||||
{
|
||||
connectionLayer.HitObjects = HitObjects.Objects
|
||||
.Select(d => d.HitObject)
|
||||
.OrderBy(h => h.StartTime).OfType<OsuHitObject>();
|
||||
connectionLayer.HitObjects = HitObjects.Objects.Select(d => d.HitObject).OfType<OsuHitObject>();
|
||||
}
|
||||
|
||||
private void onJudgement(DrawableHitObject judgedObject, Judgement judgement)
|
||||
|
@ -27,8 +27,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
|
||||
public virtual void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
|
||||
{
|
||||
// todo: fix ordering of objects so we don't have to do this (#2740).
|
||||
foreach (var d in drawables.Reverse().Skip(IncreaseFirstObjectVisibility ? 1 : 0))
|
||||
foreach (var d in drawables.Skip(IncreaseFirstObjectVisibility ? 1 : 0))
|
||||
d.ApplyCustomUpdateState += ApplyHiddenState;
|
||||
}
|
||||
|
||||
|
@ -11,8 +11,8 @@ namespace osu.Game.Rulesets.UI
|
||||
{
|
||||
public class HitObjectContainer : CompositeDrawable
|
||||
{
|
||||
public virtual IEnumerable<DrawableHitObject> Objects => InternalChildren.Cast<DrawableHitObject>();
|
||||
public virtual IEnumerable<DrawableHitObject> AliveObjects => AliveInternalChildren.Cast<DrawableHitObject>();
|
||||
public IEnumerable<DrawableHitObject> Objects => InternalChildren.Cast<DrawableHitObject>().OrderBy(h => h.HitObject.StartTime);
|
||||
public IEnumerable<DrawableHitObject> AliveObjects => AliveInternalChildren.Cast<DrawableHitObject>().OrderBy(h => h.HitObject.StartTime);
|
||||
|
||||
public virtual void Add(DrawableHitObject hitObject) => AddInternal(hitObject);
|
||||
public virtual bool Remove(DrawableHitObject hitObject) => RemoveInternal(hitObject);
|
||||
|
Loading…
Reference in New Issue
Block a user