mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Add positional sound support for all rulesets
The SamplePlaybackBalance is calculated in a way that the balance remains between -0.4 and 0.4. Positional sound is not supported in osu!taiko.
This commit is contained in:
@ -5,8 +5,10 @@ using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.UI.Scrolling;
|
||||
using osu.Game.Rulesets.Mania.UI;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
{
|
||||
@ -24,6 +26,20 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
|
||||
protected readonly IBindable<ScrollingDirection> Direction = new Bindable<ScrollingDirection>();
|
||||
|
||||
protected override float SamplePlaybackBalance
|
||||
{
|
||||
get
|
||||
{
|
||||
CompositeDrawable stage = this;
|
||||
while (!(stage is Stage))
|
||||
stage = stage.Parent;
|
||||
|
||||
var columnCount = ((Stage)stage).Columns.Count;
|
||||
var columnIndex = HitObject.Column;
|
||||
return 0.8f * columnIndex / (columnCount - 1) - 0.4f;
|
||||
}
|
||||
}
|
||||
|
||||
protected DrawableManiaHitObject(ManiaHitObject hitObject)
|
||||
: base(hitObject)
|
||||
{
|
||||
|
Reference in New Issue
Block a user