mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Merge remote-tracking branch 'origin/master' into move-osu-settings
# Conflicts: # osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs # osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs
This commit is contained in:
@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
/// <summary>
|
||||
/// Connects hit objects visually, for example with follow points.
|
||||
/// </summary>
|
||||
public abstract class ConnectionRenderer<T> : Container
|
||||
public abstract class ConnectionRenderer<T> : LifetimeManagementContainer
|
||||
where T : HitObject
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -12,39 +12,44 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
public class FollowPointRenderer : ConnectionRenderer<OsuHitObject>
|
||||
{
|
||||
private int pointDistance = 32;
|
||||
|
||||
/// <summary>
|
||||
/// Determines how much space there is between points.
|
||||
/// </summary>
|
||||
public int PointDistance
|
||||
{
|
||||
get { return pointDistance; }
|
||||
get => pointDistance;
|
||||
set
|
||||
{
|
||||
if (pointDistance == value) return;
|
||||
|
||||
pointDistance = value;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
private int preEmpt = 800;
|
||||
|
||||
/// <summary>
|
||||
/// Follow points to the next hitobject start appearing for this many milliseconds before an hitobject's end time.
|
||||
/// </summary>
|
||||
public int PreEmpt
|
||||
{
|
||||
get { return preEmpt; }
|
||||
get => preEmpt;
|
||||
set
|
||||
{
|
||||
if (preEmpt == value) return;
|
||||
|
||||
preEmpt = value;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<OsuHitObject> hitObjects;
|
||||
|
||||
public override IEnumerable<OsuHitObject> HitObjects
|
||||
{
|
||||
get { return hitObjects; }
|
||||
get => hitObjects;
|
||||
set
|
||||
{
|
||||
hitObjects = value;
|
||||
@ -56,7 +61,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
|
||||
private void update()
|
||||
{
|
||||
Clear();
|
||||
ClearInternal();
|
||||
|
||||
if (hitObjects == null)
|
||||
return;
|
||||
@ -86,7 +91,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
|
||||
FollowPoint fp;
|
||||
|
||||
Add(fp = new FollowPoint
|
||||
AddInternal(fp = new FollowPoint
|
||||
{
|
||||
Position = pointStartPosition,
|
||||
Rotation = rotation,
|
||||
@ -107,6 +112,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
fp.Expire(true);
|
||||
}
|
||||
}
|
||||
|
||||
prevHitObject = currHitObject;
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
|
||||
using osuTK;
|
||||
@ -27,40 +28,60 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
private readonly IBindable<int> stackHeightBindable = new Bindable<int>();
|
||||
private readonly IBindable<float> scaleBindable = new Bindable<float>();
|
||||
|
||||
public OsuAction? HitAction => circle.HitAction;
|
||||
|
||||
private readonly Container explodeContainer;
|
||||
|
||||
private readonly Container scaleContainer;
|
||||
|
||||
public DrawableHitCircle(HitCircle h)
|
||||
: base(h)
|
||||
{
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Position = HitObject.StackedPosition;
|
||||
Scale = new Vector2(h.Scale);
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
glow = new GlowPiece(),
|
||||
circle = new CirclePiece
|
||||
scaleContainer = new Container
|
||||
{
|
||||
Hit = () =>
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
Child = explodeContainer = new Container
|
||||
{
|
||||
if (AllJudged)
|
||||
return false;
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
glow = new GlowPiece(),
|
||||
circle = new CirclePiece
|
||||
{
|
||||
Hit = () =>
|
||||
{
|
||||
if (AllJudged)
|
||||
return false;
|
||||
|
||||
UpdateResult(true);
|
||||
return true;
|
||||
},
|
||||
UpdateResult(true);
|
||||
return true;
|
||||
},
|
||||
},
|
||||
number = new NumberPiece
|
||||
{
|
||||
Text = (HitObject.IndexInCurrentCombo + 1).ToString(),
|
||||
},
|
||||
ring = new RingPiece(),
|
||||
flash = new FlashPiece(),
|
||||
explode = new ExplodePiece(),
|
||||
ApproachCircle = new ApproachCircle
|
||||
{
|
||||
Alpha = 0,
|
||||
Scale = new Vector2(4),
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
number = new NumberPiece
|
||||
{
|
||||
Text = (HitObject.IndexInCurrentCombo + 1).ToString(),
|
||||
},
|
||||
ring = new RingPiece(),
|
||||
flash = new FlashPiece(),
|
||||
explode = new ExplodePiece(),
|
||||
ApproachCircle = new ApproachCircle
|
||||
{
|
||||
Alpha = 0,
|
||||
Scale = new Vector2(4),
|
||||
}
|
||||
};
|
||||
|
||||
//may not be so correct
|
||||
@ -72,7 +93,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
|
||||
stackHeightBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
|
||||
scaleBindable.BindValueChanged(v => Scale = new Vector2(v));
|
||||
scaleBindable.BindValueChanged(scale => scaleContainer.Scale = new Vector2(scale.NewValue), true);
|
||||
|
||||
positionBindable.BindTo(HitObject.PositionBindable);
|
||||
stackHeightBindable.BindTo(HitObject.StackHeightBindable);
|
||||
@ -81,7 +102,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
|
||||
public override Color4 AccentColour
|
||||
{
|
||||
get { return base.AccentColour; }
|
||||
get => base.AccentColour;
|
||||
set
|
||||
{
|
||||
base.AccentColour = value;
|
||||
@ -118,6 +139,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
|
||||
ApproachCircle.FadeIn(Math.Min(HitObject.TimeFadeIn * 2, HitObject.TimePreempt));
|
||||
ApproachCircle.ScaleTo(1.1f, HitObject.TimePreempt);
|
||||
ApproachCircle.Expire(true);
|
||||
}
|
||||
|
||||
protected override void UpdateCurrentState(ArmedState state)
|
||||
@ -131,6 +153,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
|
||||
Expire(true);
|
||||
|
||||
circle.HitAction = null;
|
||||
|
||||
// override lifetime end as FadeIn may have been changed externally, causing out expiration to be too early.
|
||||
LifetimeEnd = HitObject.StartTime + HitObject.HitWindows.HalfWindowFor(HitResult.Miss);
|
||||
break;
|
||||
@ -156,8 +180,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
circle.FadeOut();
|
||||
number.FadeOut();
|
||||
|
||||
this.FadeOut(800)
|
||||
.ScaleTo(Scale * 1.5f, 400, Easing.OutQuad);
|
||||
this.FadeOut(800);
|
||||
explodeContainer.ScaleTo(1.5f, 400, Easing.OutQuad);
|
||||
}
|
||||
|
||||
Expire();
|
||||
|
@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
base.SkinChanged(skin, allowFallback);
|
||||
|
||||
if (HitObject is IHasComboInformation combo)
|
||||
AccentColour = skin.GetValue<SkinConfiguration, Color4>(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : Color4.White);
|
||||
AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : (Color4?)null) ?? Color4.White;
|
||||
}
|
||||
|
||||
protected virtual void UpdatePreemptState() => this.FadeIn(HitObject.TimeFadeIn);
|
||||
|
@ -8,7 +8,7 @@ using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Osu.Configuration;
|
||||
@ -53,6 +53,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
repeatPoints = new Container<DrawableRepeatPoint> { RelativeSizeAxes = Axes.Both },
|
||||
Ball = new SliderBall(s, this)
|
||||
{
|
||||
GetInitialHitAction = () => HeadCircle.HitAction,
|
||||
BypassAutoSizeAxes = Axes.Both,
|
||||
Scale = new Vector2(s.Scale),
|
||||
AlwaysPresent = true,
|
||||
@ -99,10 +100,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
config.BindWith(OsuRulesetSetting.SnakingOutSliders, Body.SnakingOut);
|
||||
|
||||
positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
|
||||
scaleBindable.BindValueChanged(v =>
|
||||
scaleBindable.BindValueChanged(scale =>
|
||||
{
|
||||
Body.PathWidth = HitObject.Scale * 64;
|
||||
Ball.Scale = new Vector2(HitObject.Scale);
|
||||
Body.PathWidth = scale.NewValue * 64;
|
||||
Ball.Scale = new Vector2(scale.NewValue);
|
||||
});
|
||||
|
||||
positionBindable.BindTo(HitObject.PositionBindable);
|
||||
@ -114,7 +115,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
|
||||
public override Color4 AccentColour
|
||||
{
|
||||
get { return base.AccentColour; }
|
||||
get => base.AccentColour;
|
||||
set
|
||||
{
|
||||
base.AccentColour = value;
|
||||
@ -156,9 +157,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
base.SkinChanged(skin, allowFallback);
|
||||
|
||||
Body.AccentColour = skin.GetValue<SkinConfiguration, Color4>(s => s.CustomColours.ContainsKey("SliderTrackOverride") ? s.CustomColours["SliderTrackOverride"] : Body.AccentColour);
|
||||
Body.BorderColour = skin.GetValue<SkinConfiguration, Color4>(s => s.CustomColours.ContainsKey("SliderBorder") ? s.CustomColours["SliderBorder"] : Body.BorderColour);
|
||||
Ball.AccentColour = skin.GetValue<SkinConfiguration, Color4>(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : Ball.AccentColour);
|
||||
Body.AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderTrackOverride") ? s.CustomColours["SliderTrackOverride"] : (Color4?)null) ?? Body.AccentColour;
|
||||
Body.BorderColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBorder") ? s.CustomColours["SliderBorder"] : (Color4?)null) ?? Body.BorderColour;
|
||||
Ball.AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? Ball.AccentColour;
|
||||
}
|
||||
|
||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osuTK;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// 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.
|
||||
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
@ -20,7 +20,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
|
||||
public override bool DisplayResult => false;
|
||||
|
||||
public DrawableSliderTick(SliderTick sliderTick) : base(sliderTick)
|
||||
public DrawableSliderTick(SliderTick sliderTick)
|
||||
: base(sliderTick)
|
||||
{
|
||||
Size = new Vector2(16) * sliderTick.Scale;
|
||||
Origin = Anchor.Centre;
|
||||
|
@ -11,7 +11,7 @@ using osuTK.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Screens.Ranking;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
@ -42,7 +42,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
private Color4 normalColour;
|
||||
private Color4 completeColour;
|
||||
|
||||
public DrawableSpinner(Spinner s) : base(s)
|
||||
public DrawableSpinner(Spinner s)
|
||||
: base(s)
|
||||
{
|
||||
Origin = Anchor.Centre;
|
||||
Position = s.Position;
|
||||
@ -130,7 +131,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
circle.Colour = colours.BlueDark;
|
||||
glow.Colour = colours.BlueDark;
|
||||
|
||||
positionBindable.BindValueChanged(v => Position = v);
|
||||
positionBindable.BindValueChanged(pos => Position = pos.NewValue);
|
||||
positionBindable.BindTo(HitObject.PositionBindable);
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
public class ApproachCircle : Container
|
||||
{
|
||||
public override bool RemoveWhenNotAlive => false;
|
||||
|
||||
public ApproachCircle()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
|
@ -17,6 +17,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
public Func<bool> Hit;
|
||||
|
||||
public OsuAction? HitAction;
|
||||
|
||||
public CirclePiece()
|
||||
{
|
||||
Size = new Vector2((float)OsuHitObject.OBJECT_RADIUS * 2);
|
||||
@ -35,7 +37,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
case OsuAction.LeftButton:
|
||||
case OsuAction.RightButton:
|
||||
return IsHovered && (Hit?.Invoke() ?? false);
|
||||
if (IsHovered && (Hit?.Invoke() ?? false))
|
||||
{
|
||||
HitAction = action;
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Skinning;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
@ -17,8 +18,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
public string Text
|
||||
{
|
||||
get { return number.Text; }
|
||||
set { number.Text = value; }
|
||||
get => number.Text;
|
||||
set => number.Text = value;
|
||||
}
|
||||
|
||||
public NumberPiece()
|
||||
@ -42,9 +43,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
}, s => s.GetTexture("Play/osu/hitcircle") == null),
|
||||
number = new SkinnableSpriteText("Play/osu/number-text", _ => new OsuSpriteText
|
||||
{
|
||||
Font = @"Venera",
|
||||
Font = OsuFont.Numeric.With(size: 40),
|
||||
UseFullGlyphHeight = false,
|
||||
TextSize = 40,
|
||||
}, restrictSize: false)
|
||||
{
|
||||
Text = @"1"
|
||||
|
@ -1,6 +1,7 @@
|
||||
// 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.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -19,12 +20,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
private Color4 accentColour = Color4.Black;
|
||||
|
||||
public Func<OsuAction?> GetInitialHitAction;
|
||||
|
||||
/// <summary>
|
||||
/// The colour that is used for the slider ball.
|
||||
/// </summary>
|
||||
public Color4 AccentColour
|
||||
{
|
||||
get { return accentColour; }
|
||||
get => accentColour;
|
||||
set
|
||||
{
|
||||
accentColour = value;
|
||||
@ -133,11 +136,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
public bool Tracking
|
||||
{
|
||||
get { return tracking; }
|
||||
get => tracking;
|
||||
private set
|
||||
{
|
||||
if (value == tracking)
|
||||
return;
|
||||
|
||||
tracking = value;
|
||||
|
||||
FollowCircle.ScaleTo(tracking ? 2f : 1, 300, Easing.OutQuint);
|
||||
@ -145,20 +149,72 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
}
|
||||
}
|
||||
|
||||
private bool canCurrentlyTrack => Time.Current >= slider.StartTime && Time.Current < slider.EndTime;
|
||||
/// <summary>
|
||||
/// If the cursor moves out of the ball's radius we still need to be able to receive positional updates to stop tracking.
|
||||
/// </summary>
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
|
||||
|
||||
/// <summary>
|
||||
/// The point in time after which we can accept any key for tracking. Before this time, we may need to restrict tracking to the key used to hit the head circle.
|
||||
///
|
||||
/// This is a requirement to stop the case where a player holds down one key (from before the slider) and taps the second key while maintaining full scoring (tracking) of sliders.
|
||||
/// Visually, this special case can be seen below (time increasing from left to right):
|
||||
///
|
||||
/// Z Z+X Z
|
||||
/// o========o
|
||||
///
|
||||
/// Without this logic, tracking would continue through the entire slider even though no key hold action is directly attributing to it.
|
||||
///
|
||||
/// In all other cases, no special handling is required (either key being pressed is allowable as valid tracking).
|
||||
///
|
||||
/// The reason for storing this as a time value (rather than a bool) is to correctly handle rewind scenarios.
|
||||
/// </summary>
|
||||
private double? timeToAcceptAnyKeyAfter;
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
if (Time.Current < slider.EndTime)
|
||||
// from the point at which the head circle is hit, this will be non-null.
|
||||
// it may be null if the head circle was missed.
|
||||
var headCircleHitAction = GetInitialHitAction();
|
||||
|
||||
if (headCircleHitAction == null)
|
||||
timeToAcceptAnyKeyAfter = null;
|
||||
|
||||
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)
|
||||
{
|
||||
// Make sure to use the base version of ReceivePositionalInputAt so that we correctly check the position.
|
||||
Tracking = canCurrentlyTrack
|
||||
&& lastScreenSpaceMousePosition.HasValue
|
||||
&& ReceivePositionalInputAt(lastScreenSpaceMousePosition.Value)
|
||||
&& (drawableSlider?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false);
|
||||
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.
|
||||
if (actions?.Contains(otherKey) != true)
|
||||
timeToAcceptAnyKeyAfter = Time.Current;
|
||||
}
|
||||
|
||||
Tracking =
|
||||
// in valid time range
|
||||
Time.Current >= slider.StartTime && Time.Current < slider.EndTime &&
|
||||
// in valid position range
|
||||
lastScreenSpaceMousePosition.HasValue && base.ReceivePositionalInputAt(lastScreenSpaceMousePosition.Value) &&
|
||||
// valid action
|
||||
(actions?.Any(isValidTrackingAction) ?? false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check whether a given user input is a valid tracking action.
|
||||
/// </summary>
|
||||
private bool isValidTrackingAction(OsuAction action)
|
||||
{
|
||||
bool headCircleHit = GetInitialHitAction().HasValue;
|
||||
|
||||
// if the head circle was hit, we may not yet be allowed to accept any key, so we must use the initial hit action.
|
||||
if (headCircleHit && (!timeToAcceptAnyKeyAfter.HasValue || Time.Current <= timeToAcceptAnyKeyAfter.Value))
|
||||
return action == GetInitialHitAction();
|
||||
|
||||
return action == OsuAction.LeftButton || action == OsuAction.RightButton;
|
||||
}
|
||||
|
||||
public void UpdateProgress(double completionProgress)
|
||||
|
@ -40,6 +40,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
if (path.AccentColour == value)
|
||||
return;
|
||||
|
||||
path.AccentColour = value;
|
||||
|
||||
container.ForceRedraw();
|
||||
@ -56,6 +57,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
if (path.BorderColour == value)
|
||||
return;
|
||||
|
||||
path.BorderColour = value;
|
||||
|
||||
container.ForceRedraw();
|
||||
@ -105,6 +107,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
if (borderColour == value)
|
||||
return;
|
||||
|
||||
borderColour = value;
|
||||
|
||||
InvalidateTexture();
|
||||
@ -120,6 +123,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
if (accentColour == value)
|
||||
return;
|
||||
|
||||
accentColour = value;
|
||||
|
||||
InvalidateTexture();
|
||||
|
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osuTK;
|
||||
|
||||
@ -54,18 +54,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
var spanProgress = slider.ProgressAt(completionProgress);
|
||||
|
||||
double start = 0;
|
||||
double end = SnakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - slider.TimePreempt)) / slider.TimeFadeIn, 0, 1) : 1;
|
||||
double end = SnakingIn.Value ? MathHelper.Clamp((Time.Current - (slider.StartTime - slider.TimePreempt)) / slider.TimeFadeIn, 0, 1) : 1;
|
||||
|
||||
if (span >= slider.SpanCount() - 1)
|
||||
{
|
||||
if (Math.Min(span, slider.SpanCount() - 1) % 2 == 1)
|
||||
{
|
||||
start = 0;
|
||||
end = SnakingOut ? spanProgress : 1;
|
||||
end = SnakingOut.Value ? spanProgress : 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
start = SnakingOut ? spanProgress : 0;
|
||||
start = SnakingOut.Value ? spanProgress : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,10 +15,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
public Color4 AccentColour
|
||||
{
|
||||
get
|
||||
{
|
||||
return Disc.Colour;
|
||||
}
|
||||
get => Disc.Colour;
|
||||
set
|
||||
{
|
||||
Disc.Colour = value;
|
||||
|
@ -17,8 +17,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
public Color4 AccentColour
|
||||
{
|
||||
get { return background.AccentColour; }
|
||||
set { background.AccentColour = value; }
|
||||
get => background.AccentColour;
|
||||
set => background.AccentColour = value;
|
||||
}
|
||||
|
||||
private readonly SpinnerBackground background;
|
||||
@ -43,12 +43,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
|
||||
|
||||
private bool tracking;
|
||||
|
||||
public bool Tracking
|
||||
{
|
||||
get { return tracking; }
|
||||
get => tracking;
|
||||
set
|
||||
{
|
||||
if (value == tracking) return;
|
||||
|
||||
tracking = value;
|
||||
|
||||
background.FadeTo(tracking ? tracking_alpha : idle_alpha, 100);
|
||||
@ -56,12 +58,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
}
|
||||
|
||||
private bool complete;
|
||||
|
||||
public bool Complete
|
||||
{
|
||||
get { return complete; }
|
||||
get => complete;
|
||||
set
|
||||
{
|
||||
if (value == complete) return;
|
||||
|
||||
complete = value;
|
||||
|
||||
updateCompleteTick();
|
||||
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
@ -23,16 +24,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Text = @"0",
|
||||
Font = @"Venera",
|
||||
TextSize = 24
|
||||
Font = OsuFont.Numeric.With(size: 24)
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Text = @"SPINS PER MINUTE",
|
||||
Font = @"Venera",
|
||||
TextSize = 12,
|
||||
Font = OsuFont.Numeric.With(size: 12),
|
||||
Y = 30
|
||||
}
|
||||
};
|
||||
@ -42,10 +41,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
public double SpinsPerMinute
|
||||
{
|
||||
get { return spm; }
|
||||
get => spm;
|
||||
private set
|
||||
{
|
||||
if (value == spm) return;
|
||||
|
||||
spm = value;
|
||||
spmText.Text = Math.Truncate(value).ToString(@"#0");
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// 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.
|
||||
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osuTK;
|
||||
@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
|
||||
public virtual Vector2 Position
|
||||
{
|
||||
get => PositionBindable;
|
||||
get => PositionBindable.Value;
|
||||
set => PositionBindable.Value = value;
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
|
||||
public int StackHeight
|
||||
{
|
||||
get => StackHeightBindable;
|
||||
get => StackHeightBindable.Value;
|
||||
set => StackHeightBindable.Value = value;
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
|
||||
public float Scale
|
||||
{
|
||||
get => ScaleBindable;
|
||||
get => ScaleBindable.Value;
|
||||
set => ScaleBindable.Value = value;
|
||||
}
|
||||
|
||||
|
@ -7,8 +7,8 @@ using osu.Game.Rulesets.Objects.Types;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using System.Linq;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Caching;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
@ -262,6 +262,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
{
|
||||
if (nodeIndex < NodeSamples.Count)
|
||||
return NodeSamples[nodeIndex];
|
||||
|
||||
return Samples;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// 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.
|
||||
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Osu.Judgements;
|
||||
|
Reference in New Issue
Block a user