mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 16:12:57 +08:00
Merge branch 'master' into fix-skinnable-test-scene
This commit is contained in:
commit
8293846afc
@ -171,7 +171,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
}
|
||||
|
||||
hitObjectContainer.Add(drawableObject);
|
||||
followPointRenderer.AddFollowPoints(drawableObject);
|
||||
followPointRenderer.AddFollowPoints(objects[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -180,10 +180,10 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
AddStep("remove hitobject", () =>
|
||||
{
|
||||
var drawableObject = getFunc?.Invoke();
|
||||
var drawableObject = getFunc.Invoke();
|
||||
|
||||
hitObjectContainer.Remove(drawableObject);
|
||||
followPointRenderer.RemoveFollowPoints(drawableObject);
|
||||
followPointRenderer.RemoveFollowPoints(drawableObject.HitObject);
|
||||
});
|
||||
}
|
||||
|
||||
@ -215,10 +215,10 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
DrawableOsuHitObject expectedStart = getObject(i);
|
||||
DrawableOsuHitObject expectedEnd = i < hitObjectContainer.Count - 1 ? getObject(i + 1) : null;
|
||||
|
||||
if (getGroup(i).Start != expectedStart)
|
||||
if (getGroup(i).Start != expectedStart.HitObject)
|
||||
throw new AssertionException($"Object {i} expected to be the start of group {i}.");
|
||||
|
||||
if (getGroup(i).End != expectedEnd)
|
||||
if (getGroup(i).End != expectedEnd?.HitObject)
|
||||
throw new AssertionException($"Object {(expectedEnd == null ? "null" : i.ToString())} expected to be the end of group {i}.");
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
@ -31,19 +32,19 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
/// The <see cref="DrawableOsuHitObject"/> which <see cref="FollowPoint"/>s will exit from.
|
||||
/// </summary>
|
||||
[NotNull]
|
||||
public readonly DrawableOsuHitObject Start;
|
||||
public readonly OsuHitObject Start;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="FollowPointConnection"/>.
|
||||
/// </summary>
|
||||
/// <param name="start">The <see cref="DrawableOsuHitObject"/> which <see cref="FollowPoint"/>s will exit from.</param>
|
||||
public FollowPointConnection([NotNull] DrawableOsuHitObject start)
|
||||
public FollowPointConnection([NotNull] OsuHitObject start)
|
||||
{
|
||||
Start = start;
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
StartTime.BindTo(Start.HitObject.StartTimeBindable);
|
||||
StartTime.BindTo(start.StartTimeBindable);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -52,13 +53,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
bindEvents(Start);
|
||||
}
|
||||
|
||||
private DrawableOsuHitObject end;
|
||||
private OsuHitObject end;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="DrawableOsuHitObject"/> which <see cref="FollowPoint"/>s will enter.
|
||||
/// </summary>
|
||||
[CanBeNull]
|
||||
public DrawableOsuHitObject End
|
||||
public OsuHitObject End
|
||||
{
|
||||
get => end;
|
||||
set
|
||||
@ -75,10 +76,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
}
|
||||
}
|
||||
|
||||
private void bindEvents(DrawableOsuHitObject drawableObject)
|
||||
private void bindEvents(OsuHitObject obj)
|
||||
{
|
||||
drawableObject.HitObject.PositionBindable.BindValueChanged(_ => scheduleRefresh());
|
||||
drawableObject.HitObject.DefaultsApplied += _ => scheduleRefresh();
|
||||
obj.PositionBindable.BindValueChanged(_ => scheduleRefresh());
|
||||
obj.DefaultsApplied += _ => scheduleRefresh();
|
||||
}
|
||||
|
||||
private void scheduleRefresh()
|
||||
@ -88,23 +89,20 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
|
||||
private void refresh()
|
||||
{
|
||||
OsuHitObject osuStart = Start.HitObject;
|
||||
double startTime = osuStart.GetEndTime();
|
||||
double startTime = Start.GetEndTime();
|
||||
|
||||
LifetimeStart = startTime;
|
||||
|
||||
OsuHitObject osuEnd = End?.HitObject;
|
||||
|
||||
if (osuEnd == null || osuEnd.NewCombo || osuStart is Spinner || osuEnd is Spinner)
|
||||
if (End == null || End.NewCombo || Start is Spinner || End is Spinner)
|
||||
{
|
||||
// ensure we always set a lifetime for full LifetimeManagementContainer benefits
|
||||
LifetimeEnd = LifetimeStart;
|
||||
return;
|
||||
}
|
||||
|
||||
Vector2 startPosition = osuStart.StackedEndPosition;
|
||||
Vector2 endPosition = osuEnd.StackedPosition;
|
||||
double endTime = osuEnd.StartTime;
|
||||
Vector2 startPosition = Start.StackedEndPosition;
|
||||
Vector2 endPosition = End.StackedPosition;
|
||||
double endTime = End.StartTime;
|
||||
|
||||
Vector2 distanceVector = endPosition - startPosition;
|
||||
int distance = (int)distanceVector.Length;
|
||||
@ -130,10 +128,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
|
||||
AddInternal(fp = new FollowPoint());
|
||||
|
||||
Debug.Assert(End != null);
|
||||
|
||||
fp.Position = pointStartPosition;
|
||||
fp.Rotation = rotation;
|
||||
fp.Alpha = 0;
|
||||
fp.Scale = new Vector2(1.5f * osuEnd.Scale);
|
||||
fp.Scale = new Vector2(1.5f * End.Scale);
|
||||
|
||||
firstTransformStartTime ??= fadeInTime;
|
||||
|
||||
@ -141,12 +141,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
|
||||
using (fp.BeginAbsoluteSequence(fadeInTime))
|
||||
{
|
||||
fp.FadeIn(osuEnd.TimeFadeIn);
|
||||
fp.ScaleTo(osuEnd.Scale, osuEnd.TimeFadeIn, Easing.Out);
|
||||
fp.MoveTo(pointEndPosition, osuEnd.TimeFadeIn, Easing.Out);
|
||||
fp.Delay(fadeOutTime - fadeInTime).FadeOut(osuEnd.TimeFadeIn);
|
||||
fp.FadeIn(End.TimeFadeIn);
|
||||
fp.ScaleTo(End.Scale, End.TimeFadeIn, Easing.Out);
|
||||
fp.MoveTo(pointEndPosition, End.TimeFadeIn, Easing.Out);
|
||||
fp.Delay(fadeOutTime - fadeInTime).FadeOut(End.TimeFadeIn);
|
||||
|
||||
finalTransformEndTime = fadeOutTime + osuEnd.TimeFadeIn;
|
||||
finalTransformEndTime = fadeOutTime + End.TimeFadeIn;
|
||||
}
|
||||
|
||||
point++;
|
||||
|
@ -24,19 +24,19 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
public override bool RemoveCompletedTransforms => false;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the <see cref="FollowPoint"/>s around a <see cref="DrawableOsuHitObject"/>.
|
||||
/// Adds the <see cref="FollowPoint"/>s around an <see cref="OsuHitObject"/>.
|
||||
/// This includes <see cref="FollowPoint"/>s leading into <paramref name="hitObject"/>, and <see cref="FollowPoint"/>s exiting <paramref name="hitObject"/>.
|
||||
/// </summary>
|
||||
/// <param name="hitObject">The <see cref="DrawableOsuHitObject"/> to add <see cref="FollowPoint"/>s for.</param>
|
||||
public void AddFollowPoints(DrawableOsuHitObject hitObject)
|
||||
/// <param name="hitObject">The <see cref="OsuHitObject"/> to add <see cref="FollowPoint"/>s for.</param>
|
||||
public void AddFollowPoints(OsuHitObject hitObject)
|
||||
=> addConnection(new FollowPointConnection(hitObject).With(g => g.StartTime.BindValueChanged(_ => onStartTimeChanged(g))));
|
||||
|
||||
/// <summary>
|
||||
/// Removes the <see cref="FollowPoint"/>s around a <see cref="DrawableOsuHitObject"/>.
|
||||
/// Removes the <see cref="FollowPoint"/>s around an <see cref="OsuHitObject"/>.
|
||||
/// This includes <see cref="FollowPoint"/>s leading into <paramref name="hitObject"/>, and <see cref="FollowPoint"/>s exiting <paramref name="hitObject"/>.
|
||||
/// </summary>
|
||||
/// <param name="hitObject">The <see cref="DrawableOsuHitObject"/> to remove <see cref="FollowPoint"/>s for.</param>
|
||||
public void RemoveFollowPoints(DrawableOsuHitObject hitObject) => removeGroup(connections.Single(g => g.Start == hitObject));
|
||||
/// <param name="hitObject">The <see cref="OsuHitObject"/> to remove <see cref="FollowPoint"/>s for.</param>
|
||||
public void RemoveFollowPoints(OsuHitObject hitObject) => removeGroup(connections.Single(g => g.Start == hitObject));
|
||||
|
||||
/// <summary>
|
||||
/// Adds a <see cref="FollowPointConnection"/> to this <see cref="FollowPointRenderer"/>.
|
||||
|
@ -32,6 +32,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
|
||||
private PlaySliderBody sliderBody => Body.Drawable as PlaySliderBody;
|
||||
|
||||
public readonly IBindable<int> PathVersion = new Bindable<int>();
|
||||
|
||||
private Container<DrawableSliderHead> headContainer;
|
||||
private Container<DrawableSliderTail> tailContainer;
|
||||
private Container<DrawableSliderTick> tickContainer;
|
||||
@ -51,7 +53,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
tailContainer = new Container<DrawableSliderTail> { RelativeSizeAxes = Axes.Both },
|
||||
tickContainer = new Container<DrawableSliderTick> { RelativeSizeAxes = Axes.Both },
|
||||
repeatContainer = new Container<DrawableSliderRepeat> { RelativeSizeAxes = Axes.Both },
|
||||
Ball = new SliderBall(HitObject, this)
|
||||
Ball = new SliderBall(this)
|
||||
{
|
||||
GetInitialHitAction = () => HeadCircle.HitAction,
|
||||
BypassAutoSizeAxes = Axes.Both,
|
||||
@ -61,6 +63,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
headContainer = new Container<DrawableSliderHead> { RelativeSizeAxes = Axes.Both },
|
||||
};
|
||||
|
||||
PathVersion.BindTo(HitObject.Path.Version);
|
||||
|
||||
PositionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition, true);
|
||||
StackHeightBindable.BindValueChanged(_ => Position = HitObject.StackedPosition, true);
|
||||
ScaleBindable.BindValueChanged(scale => Ball.Scale = new Vector2(scale.NewValue), true);
|
||||
|
@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerBody), _ => new DefaultSpinnerDisc()),
|
||||
RotationTracker = new SpinnerRotationTracker(HitObject)
|
||||
RotationTracker = new SpinnerRotationTracker(this)
|
||||
}
|
||||
},
|
||||
SpmCounter = new SpinnerSpmCounter
|
||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
Origin = Anchor.Centre,
|
||||
Texture = textures.Get(@"Gameplay/osu/disc"),
|
||||
},
|
||||
new TrianglesPiece((int)drawableHitObject.HitObject.StartTime)
|
||||
new TrianglesPiece(drawableHitObject.GetHashCode())
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Blending = BlendingParameters.Additive,
|
||||
|
@ -18,8 +18,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
private DrawableSpinner drawableSpinner;
|
||||
|
||||
private Spinner spinner;
|
||||
|
||||
private const float initial_scale = 1.3f;
|
||||
private const float idle_alpha = 0.2f;
|
||||
private const float tracking_alpha = 0.4f;
|
||||
@ -52,7 +50,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
private void load(OsuColour colours, DrawableHitObject drawableHitObject)
|
||||
{
|
||||
drawableSpinner = (DrawableSpinner)drawableHitObject;
|
||||
spinner = drawableSpinner.HitObject;
|
||||
|
||||
normalColour = colours.BlueDark;
|
||||
completeColour = colours.YellowLight;
|
||||
@ -130,6 +127,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
if (!(drawableHitObject is DrawableSpinner))
|
||||
return;
|
||||
|
||||
Spinner spinner = drawableSpinner.HitObject;
|
||||
|
||||
using (BeginAbsoluteSequence(spinner.StartTime - spinner.TimePreempt, true))
|
||||
{
|
||||
this.ScaleTo(initial_scale);
|
||||
|
@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(DrawableHitObject drawableObject)
|
||||
{
|
||||
OsuHitObject osuObject = (OsuHitObject)drawableObject.HitObject;
|
||||
var drawableOsuObject = (DrawableOsuHitObject)drawableObject;
|
||||
|
||||
state.BindTo(drawableObject.State);
|
||||
state.BindValueChanged(updateState, true);
|
||||
@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
circle.Colour = colour.NewValue;
|
||||
}, true);
|
||||
|
||||
indexInCurrentCombo.BindTo(osuObject.IndexInCurrentComboBindable);
|
||||
indexInCurrentCombo.BindTo(drawableOsuObject.IndexInCurrentComboBindable);
|
||||
indexInCurrentCombo.BindValueChanged(index => number.Text = (index.NewValue + 1).ToString(), true);
|
||||
}
|
||||
|
||||
|
@ -17,23 +17,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
private IBindable<int> pathVersion;
|
||||
private IBindable<Color4> accentColour;
|
||||
|
||||
[Resolved]
|
||||
private DrawableHitObject drawableObject { get; set; }
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
private OsuRulesetConfigManager config { get; set; }
|
||||
|
||||
private Slider slider;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(ISkinSource skin)
|
||||
private void load(ISkinSource skin, DrawableHitObject drawableObject)
|
||||
{
|
||||
slider = (Slider)drawableObject.HitObject;
|
||||
var drawableSlider = (DrawableSlider)drawableObject;
|
||||
|
||||
scaleBindable = slider.ScaleBindable.GetBoundCopy();
|
||||
scaleBindable = drawableSlider.ScaleBindable.GetBoundCopy();
|
||||
scaleBindable.BindValueChanged(scale => PathRadius = OsuHitObject.OBJECT_RADIUS * scale.NewValue, true);
|
||||
|
||||
pathVersion = slider.Path.Version.GetBoundCopy();
|
||||
pathVersion = drawableSlider.PathVersion.GetBoundCopy();
|
||||
pathVersion.BindValueChanged(_ => Refresh());
|
||||
|
||||
accentColour = drawableObject.AccentColour.GetBoundCopy();
|
||||
|
@ -30,15 +30,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
set => ball.Colour = value;
|
||||
}
|
||||
|
||||
private readonly Slider slider;
|
||||
private readonly Drawable followCircle;
|
||||
private readonly DrawableSlider drawableSlider;
|
||||
private readonly Drawable ball;
|
||||
|
||||
public SliderBall(Slider slider, DrawableSlider drawableSlider = null)
|
||||
public SliderBall(DrawableSlider drawableSlider)
|
||||
{
|
||||
this.drawableSlider = drawableSlider;
|
||||
this.slider = slider;
|
||||
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
@ -133,7 +131,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
if (headCircleHitAction == null)
|
||||
timeToAcceptAnyKeyAfter = null;
|
||||
|
||||
var actions = drawableSlider?.OsuActionInputManager?.PressedActions;
|
||||
var actions = drawableSlider.OsuActionInputManager?.PressedActions;
|
||||
|
||||
// if the head circle was hit with a specific key, tracking should only occur while that key is pressed.
|
||||
if (headCircleHitAction != null && timeToAcceptAnyKeyAfter == null)
|
||||
@ -147,7 +145,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
Tracking =
|
||||
// in valid time range
|
||||
Time.Current >= slider.StartTime && Time.Current < slider.EndTime &&
|
||||
Time.Current >= drawableSlider.HitObject.StartTime && Time.Current < drawableSlider.HitObject.EndTime &&
|
||||
// in valid position range
|
||||
lastScreenSpaceMousePosition.HasValue && followCircle.ReceivePositionalInputAt(lastScreenSpaceMousePosition.Value) &&
|
||||
// valid action
|
||||
@ -172,9 +170,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
public void UpdateProgress(double completionProgress)
|
||||
{
|
||||
var newPos = slider.CurvePositionAt(completionProgress);
|
||||
var newPos = drawableSlider.HitObject.CurvePositionAt(completionProgress);
|
||||
|
||||
var diff = lastPosition.HasValue ? lastPosition.Value - newPos : newPos - slider.CurvePositionAt(completionProgress + 0.01f);
|
||||
var diff = lastPosition.HasValue ? lastPosition.Value - newPos : newPos - drawableSlider.HitObject.CurvePositionAt(completionProgress + 0.01f);
|
||||
if (diff == Vector2.Zero)
|
||||
return;
|
||||
|
||||
|
@ -51,18 +51,23 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
/// </summary>
|
||||
private Vector2 snakedPathOffset;
|
||||
|
||||
private Slider slider;
|
||||
private DrawableSlider drawableSlider;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(DrawableHitObject drawableObject)
|
||||
{
|
||||
slider = (Slider)drawableObject.HitObject;
|
||||
drawableSlider = (DrawableSlider)drawableObject;
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
public void UpdateProgress(double completionProgress)
|
||||
{
|
||||
if (drawableSlider == null)
|
||||
return;
|
||||
|
||||
Slider slider = drawableSlider.HitObject;
|
||||
|
||||
var span = slider.SpanAt(completionProgress);
|
||||
var spanProgress = slider.ProgressAt(completionProgress);
|
||||
|
||||
@ -87,8 +92,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
if (drawableSlider == null)
|
||||
return;
|
||||
|
||||
// Generate the entire curve
|
||||
slider.Path.GetPathToProgress(CurrentCurve, 0, 1);
|
||||
drawableSlider.HitObject.Path.GetPathToProgress(CurrentCurve, 0, 1);
|
||||
SetVertices(CurrentCurve);
|
||||
|
||||
// Force the body to be the final path size to avoid excessive autosize computations
|
||||
@ -132,7 +140,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
SnakedStart = p0;
|
||||
SnakedEnd = p1;
|
||||
|
||||
slider.Path.GetPathToProgress(CurrentCurve, p0, p1);
|
||||
drawableSlider.HitObject.Path.GetPathToProgress(CurrentCurve, p0, p1);
|
||||
|
||||
SetVertices(CurrentCurve);
|
||||
|
||||
|
@ -15,13 +15,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
public class SpinnerRotationTracker : CircularContainer
|
||||
{
|
||||
private readonly Spinner spinner;
|
||||
|
||||
public override bool IsPresent => true; // handle input when hidden
|
||||
|
||||
public SpinnerRotationTracker(Spinner s)
|
||||
private readonly DrawableSpinner drawableSpinner;
|
||||
|
||||
public SpinnerRotationTracker(DrawableSpinner drawableSpinner)
|
||||
{
|
||||
spinner = s;
|
||||
this.drawableSpinner = drawableSpinner;
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
}
|
||||
@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
/// <summary>
|
||||
/// Whether currently in the correct time range to allow spinning.
|
||||
/// </summary>
|
||||
private bool isSpinnableTime => spinner.StartTime <= Time.Current && spinner.EndTime > Time.Current;
|
||||
private bool isSpinnableTime => drawableSpinner.HitObject.StartTime <= Time.Current && drawableSpinner.HitObject.EndTime > Time.Current;
|
||||
|
||||
protected override bool OnMouseMove(MouseMoveEvent e)
|
||||
{
|
||||
|
@ -11,6 +11,7 @@ using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
@ -47,7 +48,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(DrawableHitObject drawableObject)
|
||||
{
|
||||
OsuHitObject osuObject = (OsuHitObject)drawableObject.HitObject;
|
||||
var drawableOsuObject = (DrawableOsuHitObject)drawableObject;
|
||||
|
||||
bool allowFallback = false;
|
||||
|
||||
@ -111,7 +112,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
|
||||
state.BindTo(drawableObject.State);
|
||||
accentColour.BindTo(drawableObject.AccentColour);
|
||||
indexInCurrentCombo.BindTo(osuObject.IndexInCurrentComboBindable);
|
||||
indexInCurrentCombo.BindTo(drawableOsuObject.IndexInCurrentComboBindable);
|
||||
|
||||
Texture getTextureWithFallback(string name)
|
||||
{
|
||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
@ -75,10 +76,10 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
|
||||
private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
|
||||
{
|
||||
if (!(drawableHitObject is DrawableSpinner))
|
||||
if (!(drawableHitObject is DrawableSpinner d))
|
||||
return;
|
||||
|
||||
var spinner = drawableSpinner.HitObject;
|
||||
Spinner spinner = d.HitObject;
|
||||
|
||||
using (BeginAbsoluteSequence(spinner.StartTime - spinner.TimePreempt, true))
|
||||
this.FadeOut();
|
||||
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
@ -94,10 +95,10 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
|
||||
private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
|
||||
{
|
||||
if (!(drawableHitObject is DrawableSpinner))
|
||||
if (!(drawableHitObject is DrawableSpinner d))
|
||||
return;
|
||||
|
||||
var spinner = drawableSpinner.HitObject;
|
||||
Spinner spinner = d.HitObject;
|
||||
|
||||
using (BeginAbsoluteSequence(spinner.StartTime - spinner.TimePreempt, true))
|
||||
this.FadeOut();
|
||||
|
@ -5,7 +5,6 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -26,7 +25,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(ISkinSource skin, DrawableHitObject drawableObject)
|
||||
private void load(ISkinSource skin)
|
||||
{
|
||||
var ballColour = skin.GetConfig<OsuSkinColour, Color4>(OsuSkinColour.SliderBall)?.Value ?? Color4.White;
|
||||
|
||||
|
@ -4,12 +4,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Pooling;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Configuration;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables.Connections;
|
||||
using osu.Game.Rulesets.Osu.Scoring;
|
||||
@ -17,9 +20,6 @@ using osu.Game.Rulesets.Osu.UI.Cursor;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Skinning;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Rulesets.Osu.Configuration;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.UI
|
||||
@ -95,6 +95,8 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
|
||||
public override void Add(DrawableHitObject h)
|
||||
{
|
||||
DrawableOsuHitObject osuHitObject = (DrawableOsuHitObject)h;
|
||||
|
||||
h.OnNewResult += onNewResult;
|
||||
h.OnLoadComplete += d =>
|
||||
{
|
||||
@ -107,18 +109,19 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
|
||||
base.Add(h);
|
||||
|
||||
DrawableOsuHitObject osuHitObject = (DrawableOsuHitObject)h;
|
||||
osuHitObject.CheckHittable = hitPolicy.IsHittable;
|
||||
|
||||
followPoints.AddFollowPoints(osuHitObject);
|
||||
followPoints.AddFollowPoints(osuHitObject.HitObject);
|
||||
}
|
||||
|
||||
public override bool Remove(DrawableHitObject h)
|
||||
{
|
||||
DrawableOsuHitObject osuHitObject = (DrawableOsuHitObject)h;
|
||||
|
||||
bool result = base.Remove(h);
|
||||
|
||||
if (result)
|
||||
followPoints.RemoveFollowPoints((DrawableOsuHitObject)h);
|
||||
followPoints.RemoveFollowPoints(osuHitObject.HitObject);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
@ -25,6 +26,8 @@ namespace osu.Game.Skinning
|
||||
|
||||
private readonly IBindable<bool> samplePlaybackDisabled = new Bindable<bool>();
|
||||
|
||||
private ScheduledDelegate scheduledStart;
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(ISamplePlaybackDisabler samplePlaybackDisabler)
|
||||
{
|
||||
@ -39,12 +42,14 @@ namespace osu.Game.Skinning
|
||||
// let non-looping samples that have already been started play out to completion (sounds better than abruptly cutting off).
|
||||
if (!Looping) return;
|
||||
|
||||
cancelPendingStart();
|
||||
|
||||
if (disabled.NewValue)
|
||||
base.Stop();
|
||||
else
|
||||
{
|
||||
// schedule so we don't start playing a sample which is no longer alive.
|
||||
Schedule(() =>
|
||||
scheduledStart = Schedule(() =>
|
||||
{
|
||||
if (RequestedPlaying)
|
||||
base.Play();
|
||||
@ -56,6 +61,7 @@ namespace osu.Game.Skinning
|
||||
|
||||
public override void Play()
|
||||
{
|
||||
cancelPendingStart();
|
||||
RequestedPlaying = true;
|
||||
|
||||
if (samplePlaybackDisabled.Value)
|
||||
@ -66,8 +72,15 @@ namespace osu.Game.Skinning
|
||||
|
||||
public override void Stop()
|
||||
{
|
||||
cancelPendingStart();
|
||||
RequestedPlaying = false;
|
||||
base.Stop();
|
||||
}
|
||||
|
||||
private void cancelPendingStart()
|
||||
{
|
||||
scheduledStart?.Cancel();
|
||||
scheduledStart = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user