mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 19:22:56 +08:00
Remove recursive hierarchy traversal for mania sample balance
This commit is contained in:
parent
65b96079a0
commit
cdff6060d3
@ -5,10 +5,10 @@ using JetBrains.Annotations;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
using osu.Game.Rulesets.Mania.UI;
|
using osu.Game.Rulesets.Mania.UI;
|
||||||
|
using osu.Game.Rulesets.UI;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||||
{
|
{
|
||||||
@ -26,17 +26,19 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
|
|
||||||
protected readonly IBindable<ScrollingDirection> Direction = new Bindable<ScrollingDirection>();
|
protected readonly IBindable<ScrollingDirection> Direction = new Bindable<ScrollingDirection>();
|
||||||
|
|
||||||
|
[Resolved(canBeNull: true)]
|
||||||
|
private Playfield playfield { get; set; }
|
||||||
|
|
||||||
protected override float SamplePlaybackPosition
|
protected override float SamplePlaybackPosition
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
CompositeDrawable stage = this;
|
var columns = (playfield as ManiaPlayfield)?.TotalColumns;
|
||||||
while (!(stage is Stage))
|
|
||||||
stage = stage.Parent;
|
|
||||||
|
|
||||||
var columnCount = ((Stage)stage).Columns.Count;
|
if (columns == null)
|
||||||
var columnIndex = HitObject.Column;
|
return base.SamplePlaybackPosition;
|
||||||
return 0.8f * columnIndex / (columnCount - 1) - 0.4f;
|
|
||||||
|
return (float)HitObject.Column / columns.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ using osuTK;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.UI
|
namespace osu.Game.Rulesets.UI
|
||||||
{
|
{
|
||||||
|
[Cached]
|
||||||
public abstract class Playfield : CompositeDrawable
|
public abstract class Playfield : CompositeDrawable
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user