1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 00:42:55 +08:00

Enable NRT on Column

This commit is contained in:
Salman Alshamrani 2025-01-30 08:22:28 -05:00
parent e8d20fb402
commit 64b67252a2
2 changed files with 10 additions and 11 deletions

View File

@ -8,7 +8,7 @@ using osu.Game.Rulesets.UI;
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 ManiaInputManager(RulesetInfo ruleset, int variant)

View File

@ -1,10 +1,9 @@
// 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.
#nullable disable
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Pooling;
@ -45,11 +44,11 @@ namespace osu.Game.Rulesets.Mania.UI
internal readonly Container TopLevelContainer = new Container { RelativeSizeAxes = Axes.Both };
private DrawablePool<PoolableHitExplosion> hitExplosionPool;
private DrawablePool<PoolableHitExplosion> hitExplosionPool = null!;
private readonly OrderedHitPolicy hitPolicy;
public Container UnderlayElements => HitObjectArea.UnderlayElements;
private GameplaySampleTriggerSource sampleTriggerSource;
private GameplaySampleTriggerSource sampleTriggerSource = null!;
/// <summary>
/// Whether this is a special (ie. scratch) column.
@ -75,7 +74,7 @@ namespace osu.Game.Rulesets.Mania.UI
}
[Resolved]
private ISkinSource skin { get; set; }
private ISkinSource skin { get; set; } = null!;
[BackgroundDependencyLoader]
private void load(GameHost host)
@ -136,7 +135,7 @@ namespace osu.Game.Rulesets.Mania.UI
base.Dispose(isDisposing);
if (skin != null)
if (skin.IsNotNull())
skin.SourceChanged -= onSourceChanged;
}
@ -187,14 +186,14 @@ namespace osu.Game.Rulesets.Mania.UI
#region Touch Input
[Resolved(canBeNull: true)]
private ManiaInputManager maniaInputManager { get; set; }
[Resolved]
private ManiaInputManager? maniaInputManager { get; set; }
private int touchActivationCount;
protected override bool OnTouchDown(TouchDownEvent e)
{
maniaInputManager.KeyBindingContainer.TriggerPressed(Action.Value);
maniaInputManager?.KeyBindingContainer.TriggerPressed(Action.Value);
touchActivationCount++;
return true;
}
@ -204,7 +203,7 @@ namespace osu.Game.Rulesets.Mania.UI
touchActivationCount--;
if (touchActivationCount == 0)
maniaInputManager.KeyBindingContainer.TriggerReleased(Action.Value);
maniaInputManager?.KeyBindingContainer.TriggerReleased(Action.Value);
}
#endregion