mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 20:05:29 +08:00
Fix test and spawn smoke immediately
This commit is contained in:
parent
74056201e7
commit
c3b8e1d718
@ -10,7 +10,6 @@ using osu.Framework.Input.Bindings;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Input.StateChanges.Events;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu
|
||||
{
|
||||
|
@ -166,17 +166,21 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
Anchor = Anchor.TopLeft;
|
||||
Origin = Anchor.TopLeft;
|
||||
|
||||
SmokeStartTime = Time.Current;
|
||||
|
||||
totalDistance = PointInterval;
|
||||
|
||||
if (smokeContainer != null)
|
||||
{
|
||||
smokeContainer.SmokeMoved += onSmokeMoved;
|
||||
smokeContainer.SmokeEnded += onSmokeEnded;
|
||||
IsActive = true;
|
||||
|
||||
onSmokeMoved(smokeContainer.LastMousePosition, Time.Current);
|
||||
}
|
||||
|
||||
Anchor = Anchor.TopLeft;
|
||||
Origin = Anchor.TopLeft;
|
||||
|
||||
SmokeStartTime = Time.Current;
|
||||
}
|
||||
|
||||
private Vector2 nextPointDirection()
|
||||
|
@ -19,6 +19,8 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
public event Action<Vector2, double>? SmokeMoved;
|
||||
public event Action<double>? SmokeEnded;
|
||||
|
||||
public Vector2 LastMousePosition;
|
||||
|
||||
private bool isSmoking;
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 _) => true;
|
||||
@ -50,6 +52,8 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
if (isSmoking)
|
||||
SmokeMoved?.Invoke(e.MousePosition, Time.Current);
|
||||
|
||||
LastMousePosition = e.MousePosition;
|
||||
|
||||
return base.OnMouseMove(e);
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddUntilStep("wait for track to start running", () => Beatmap.Value.Track.IsRunning);
|
||||
addSeekStep(3000);
|
||||
AddAssert("all judged", () => Player.DrawableRuleset.Playfield.AllHitObjects.All(h => h.Judged));
|
||||
AddUntilStep("key counter counted keys", () => Player.HUDOverlay.KeyCounter.Children.All(kc => kc.CountPresses >= 7));
|
||||
AddUntilStep("key counter counted keys", () => Player.HUDOverlay.KeyCounter.Children.Select(kc => kc.CountPresses).Sum() == 15);
|
||||
AddStep("clear results", () => Player.Results.Clear());
|
||||
addSeekStep(0);
|
||||
AddAssert("none judged", () => Player.DrawableRuleset.Playfield.AllHitObjects.All(h => !h.Judged));
|
||||
|
Loading…
Reference in New Issue
Block a user