mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 03:23:02 +08:00
Enable NRT on Column
This commit is contained in:
parent
e8d20fb402
commit
64b67252a2
@ -8,7 +8,7 @@ using osu.Game.Rulesets.UI;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania
|
namespace osu.Game.Rulesets.Mania
|
||||||
{
|
{
|
||||||
[Cached] // Used for touch input, see ColumnTouchInputArea.
|
[Cached] // Used for touch input, see Column.OnTouchDown/OnTouchUp.
|
||||||
public partial class ManiaInputManager : RulesetInputManager<ManiaAction>
|
public partial class ManiaInputManager : RulesetInputManager<ManiaAction>
|
||||||
{
|
{
|
||||||
public ManiaInputManager(RulesetInfo ruleset, int variant)
|
public ManiaInputManager(RulesetInfo ruleset, int variant)
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Extensions.ObjectExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Pooling;
|
using osu.Framework.Graphics.Pooling;
|
||||||
@ -45,11 +44,11 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
internal readonly Container TopLevelContainer = new Container { RelativeSizeAxes = Axes.Both };
|
internal readonly Container TopLevelContainer = new Container { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
private DrawablePool<PoolableHitExplosion> hitExplosionPool;
|
private DrawablePool<PoolableHitExplosion> hitExplosionPool = null!;
|
||||||
private readonly OrderedHitPolicy hitPolicy;
|
private readonly OrderedHitPolicy hitPolicy;
|
||||||
public Container UnderlayElements => HitObjectArea.UnderlayElements;
|
public Container UnderlayElements => HitObjectArea.UnderlayElements;
|
||||||
|
|
||||||
private GameplaySampleTriggerSource sampleTriggerSource;
|
private GameplaySampleTriggerSource sampleTriggerSource = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether this is a special (ie. scratch) column.
|
/// Whether this is a special (ie. scratch) column.
|
||||||
@ -75,7 +74,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private ISkinSource skin { get; set; }
|
private ISkinSource skin { get; set; } = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(GameHost host)
|
private void load(GameHost host)
|
||||||
@ -136,7 +135,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
if (skin != null)
|
if (skin.IsNotNull())
|
||||||
skin.SourceChanged -= onSourceChanged;
|
skin.SourceChanged -= onSourceChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,14 +186,14 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
#region Touch Input
|
#region Touch Input
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved]
|
||||||
private ManiaInputManager maniaInputManager { get; set; }
|
private ManiaInputManager? maniaInputManager { get; set; }
|
||||||
|
|
||||||
private int touchActivationCount;
|
private int touchActivationCount;
|
||||||
|
|
||||||
protected override bool OnTouchDown(TouchDownEvent e)
|
protected override bool OnTouchDown(TouchDownEvent e)
|
||||||
{
|
{
|
||||||
maniaInputManager.KeyBindingContainer.TriggerPressed(Action.Value);
|
maniaInputManager?.KeyBindingContainer.TriggerPressed(Action.Value);
|
||||||
touchActivationCount++;
|
touchActivationCount++;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -204,7 +203,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
touchActivationCount--;
|
touchActivationCount--;
|
||||||
|
|
||||||
if (touchActivationCount == 0)
|
if (touchActivationCount == 0)
|
||||||
maniaInputManager.KeyBindingContainer.TriggerReleased(Action.Value);
|
maniaInputManager?.KeyBindingContainer.TriggerReleased(Action.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user