mirror of
https://github.com/ppy/osu.git
synced 2025-02-28 00:43:01 +08:00
Merge branch 'master' into fix-editor-slider-repeat-animation
This commit is contained in:
commit
1e0ee3cd61
@ -34,6 +34,18 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
|
|
||||||
private List<JudgementResult> judgementResults;
|
private List<JudgementResult> judgementResults;
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestPressBothKeysSimultaneouslyAndReleaseOne()
|
||||||
|
{
|
||||||
|
performTest(new List<ReplayFrame>
|
||||||
|
{
|
||||||
|
new OsuReplayFrame { Position = Vector2.Zero, Actions = { OsuAction.LeftButton, OsuAction.RightButton }, Time = time_slider_start },
|
||||||
|
new OsuReplayFrame { Position = Vector2.Zero, Actions = { OsuAction.RightButton }, Time = time_during_slide_1 },
|
||||||
|
});
|
||||||
|
|
||||||
|
AddAssert("Tracking retained", assertMaxJudge);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Scenario:
|
/// Scenario:
|
||||||
/// - Press a key before a slider starts
|
/// - Press a key before a slider starts
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -134,6 +135,11 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private double? timeToAcceptAnyKeyAfter;
|
private double? timeToAcceptAnyKeyAfter;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The actions that were pressed in the previous frame.
|
||||||
|
/// </summary>
|
||||||
|
private readonly List<OsuAction> lastPressedActions = new List<OsuAction>();
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
@ -152,8 +158,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
{
|
{
|
||||||
var otherKey = headCircleHitAction == OsuAction.RightButton ? OsuAction.LeftButton : OsuAction.RightButton;
|
var otherKey = headCircleHitAction == OsuAction.RightButton ? OsuAction.LeftButton : OsuAction.RightButton;
|
||||||
|
|
||||||
// we can return to accepting all keys if the initial head circle key is the *only* key pressed, or all keys have been released.
|
// we can start accepting any key once all other keys have been released in the previous frame.
|
||||||
if (actions?.Contains(otherKey) != true)
|
if (!lastPressedActions.Contains(otherKey))
|
||||||
timeToAcceptAnyKeyAfter = Time.Current;
|
timeToAcceptAnyKeyAfter = Time.Current;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,6 +170,10 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
lastScreenSpaceMousePosition.HasValue && followCircle.ReceivePositionalInputAt(lastScreenSpaceMousePosition.Value) &&
|
lastScreenSpaceMousePosition.HasValue && followCircle.ReceivePositionalInputAt(lastScreenSpaceMousePosition.Value) &&
|
||||||
// valid action
|
// valid action
|
||||||
(actions?.Any(isValidTrackingAction) ?? false);
|
(actions?.Any(isValidTrackingAction) ?? false);
|
||||||
|
|
||||||
|
lastPressedActions.Clear();
|
||||||
|
if (actions != null)
|
||||||
|
lastPressedActions.AddRange(actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A wrapper for a <see cref="DrawableRuleset{TObject}"/>. Handles adding visual representations of <see cref="HitObject"/>s to the underlying <see cref="DrawableRuleset{TObject}"/>.
|
/// A wrapper for a <see cref="DrawableRuleset{TObject}"/>. Handles adding visual representations of <see cref="HitObject"/>s to the underlying <see cref="DrawableRuleset{TObject}"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class DrawableEditRulesetWrapper<TObject> : CompositeDrawable
|
internal class DrawableEditorRulesetWrapper<TObject> : CompositeDrawable
|
||||||
where TObject : HitObject
|
where TObject : HitObject
|
||||||
{
|
{
|
||||||
public Playfield Playfield => drawableRuleset.Playfield;
|
public Playfield Playfield => drawableRuleset.Playfield;
|
||||||
@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private EditorBeatmap beatmap { get; set; }
|
private EditorBeatmap beatmap { get; set; }
|
||||||
|
|
||||||
public DrawableEditRulesetWrapper(DrawableRuleset<TObject> drawableRuleset)
|
public DrawableEditorRulesetWrapper(DrawableRuleset<TObject> drawableRuleset)
|
||||||
{
|
{
|
||||||
this.drawableRuleset = drawableRuleset;
|
this.drawableRuleset = drawableRuleset;
|
||||||
|
|
@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
|
|
||||||
protected ComposeBlueprintContainer BlueprintContainer { get; private set; }
|
protected ComposeBlueprintContainer BlueprintContainer { get; private set; }
|
||||||
|
|
||||||
private DrawableEditRulesetWrapper<TObject> drawableRulesetWrapper;
|
private DrawableEditorRulesetWrapper<TObject> drawableRulesetWrapper;
|
||||||
|
|
||||||
protected readonly Container LayerBelowRuleset = new Container { RelativeSizeAxes = Axes.Both };
|
protected readonly Container LayerBelowRuleset = new Container { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
drawableRulesetWrapper = new DrawableEditRulesetWrapper<TObject>(CreateDrawableRuleset(Ruleset, EditorBeatmap.PlayableBeatmap, new[] { Ruleset.GetAutoplayMod() }))
|
drawableRulesetWrapper = new DrawableEditorRulesetWrapper<TObject>(CreateDrawableRuleset(Ruleset, EditorBeatmap.PlayableBeatmap, new[] { Ruleset.GetAutoplayMod() }))
|
||||||
{
|
{
|
||||||
Clock = EditorClock,
|
Clock = EditorClock,
|
||||||
ProcessCustomClock = false
|
ProcessCustomClock = false
|
||||||
|
Loading…
Reference in New Issue
Block a user