mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 12:22:57 +08:00
Merge branch 'master' into combo-colour-brightness-limit
This commit is contained in:
commit
106f1cf90b
@ -1,17 +1,12 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using JetBrains.Annotations;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osuTK;
|
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.Taiko.Skinning.Default;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||||
@ -28,35 +23,15 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private const float tracker_width = 2f;
|
private const float tracker_width = 2f;
|
||||||
|
|
||||||
/// <summary>
|
public readonly Bindable<bool> Major = new Bindable<bool>();
|
||||||
/// The vertical offset of the triangles from the line tracker.
|
|
||||||
/// </summary>
|
|
||||||
private const float triangle_offset = 10f;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The size of the triangles.
|
|
||||||
/// </summary>
|
|
||||||
private const float triangle_size = 20f;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The visual line tracker.
|
|
||||||
/// </summary>
|
|
||||||
private SkinnableDrawable line;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Container with triangles. Only visible for major lines.
|
|
||||||
/// </summary>
|
|
||||||
private Container triangleContainer;
|
|
||||||
|
|
||||||
private readonly Bindable<bool> major = new Bindable<bool>();
|
|
||||||
|
|
||||||
public DrawableBarLine()
|
public DrawableBarLine()
|
||||||
: this(null)
|
: this(null)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public DrawableBarLine([CanBeNull] BarLine barLine)
|
public DrawableBarLine(BarLine? barLine)
|
||||||
: base(barLine)
|
: base(barLine!)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,69 +44,23 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
RelativeSizeAxes = Axes.Y;
|
RelativeSizeAxes = Axes.Y;
|
||||||
Width = tracker_width;
|
Width = tracker_width;
|
||||||
|
|
||||||
AddRangeInternal(new Drawable[]
|
AddInternal(new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.BarLine), _ => new DefaultBarLine())
|
||||||
{
|
{
|
||||||
line = new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.BarLine), _ => new Box
|
Anchor = Anchor.Centre,
|
||||||
{
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
EdgeSmoothness = new Vector2(0.5f, 0),
|
|
||||||
})
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
},
|
|
||||||
triangleContainer = new Container
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
new EquilateralTriangle
|
|
||||||
{
|
|
||||||
Name = "Top",
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Position = new Vector2(0, -triangle_offset),
|
|
||||||
Size = new Vector2(-triangle_size),
|
|
||||||
EdgeSmoothness = new Vector2(1),
|
|
||||||
},
|
|
||||||
new EquilateralTriangle
|
|
||||||
{
|
|
||||||
Name = "Bottom",
|
|
||||||
Anchor = Anchor.BottomCentre,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Position = new Vector2(0, triangle_offset),
|
|
||||||
Size = new Vector2(triangle_size),
|
|
||||||
EdgeSmoothness = new Vector2(1),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
|
||||||
{
|
|
||||||
base.LoadComplete();
|
|
||||||
major.BindValueChanged(updateMajor, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateMajor(ValueChangedEvent<bool> major)
|
|
||||||
{
|
|
||||||
line.Alpha = major.NewValue ? 1f : 0.75f;
|
|
||||||
triangleContainer.Alpha = major.NewValue ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnApply()
|
protected override void OnApply()
|
||||||
{
|
{
|
||||||
base.OnApply();
|
base.OnApply();
|
||||||
major.BindTo(HitObject.MajorBindable);
|
Major.BindTo(HitObject.MajorBindable);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnFree()
|
protected override void OnFree()
|
||||||
{
|
{
|
||||||
base.OnFree();
|
base.OnFree();
|
||||||
major.UnbindFrom(HitObject.MajorBindable);
|
Major.UnbindFrom(HitObject.MajorBindable);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateHitStateTransforms(ArmedState state)
|
protected override void UpdateHitStateTransforms(ArmedState state)
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
@ -16,6 +17,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
{
|
{
|
||||||
public class DrawableDrumRollTick : DrawableTaikoStrongableHitObject<DrumRollTick, DrumRollTick.StrongNestedHit>
|
public class DrawableDrumRollTick : DrawableTaikoStrongableHitObject<DrumRollTick, DrumRollTick.StrongNestedHit>
|
||||||
{
|
{
|
||||||
|
public BindableBool IsFirstTick = new BindableBool();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The hit type corresponding to the <see cref="TaikoAction"/> that the user pressed to hit this <see cref="DrawableDrumRollTick"/>.
|
/// The hit type corresponding to the <see cref="TaikoAction"/> that the user pressed to hit this <see cref="DrawableDrumRollTick"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -32,14 +35,17 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
FillMode = FillMode.Fit;
|
FillMode = FillMode.Fit;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.DrumRollTick),
|
protected override SkinnableDrawable CreateMainPiece() => new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.DrumRollTick), _ => new TickPiece());
|
||||||
_ => new TickPiece
|
|
||||||
{
|
|
||||||
Filled = HitObject.FirstTick
|
|
||||||
});
|
|
||||||
|
|
||||||
public override double MaximumJudgementOffset => HitObject.HitWindow;
|
public override double MaximumJudgementOffset => HitObject.HitWindow;
|
||||||
|
|
||||||
|
protected override void OnApply()
|
||||||
|
{
|
||||||
|
base.OnApply();
|
||||||
|
|
||||||
|
IsFirstTick.Value = HitObject.FirstTick;
|
||||||
|
}
|
||||||
|
|
||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
if (!userTriggered)
|
if (!userTriggered)
|
||||||
|
94
osu.Game.Rulesets.Taiko/Skinning/Default/DefaultBarLine.cs
Normal file
94
osu.Game.Rulesets.Taiko/Skinning/Default/DefaultBarLine.cs
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
// 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.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Taiko.Skinning.Default
|
||||||
|
{
|
||||||
|
public class DefaultBarLine : CompositeDrawable
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The vertical offset of the triangles from the line tracker.
|
||||||
|
/// </summary>
|
||||||
|
private const float triangle_offset = 10f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The size of the triangles.
|
||||||
|
/// </summary>
|
||||||
|
private const float triangle_size = 20f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Container with triangles. Only visible for major lines.
|
||||||
|
/// </summary>
|
||||||
|
private Container triangleContainer = null!;
|
||||||
|
|
||||||
|
private Bindable<bool> major = null!;
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(DrawableHitObject drawableHitObject)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
|
{
|
||||||
|
line = new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
EdgeSmoothness = new Vector2(0.5f, 0),
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
},
|
||||||
|
triangleContainer = new Container
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new EquilateralTriangle
|
||||||
|
{
|
||||||
|
Name = "Top",
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Position = new Vector2(0, -triangle_offset),
|
||||||
|
Size = new Vector2(-triangle_size),
|
||||||
|
EdgeSmoothness = new Vector2(1),
|
||||||
|
},
|
||||||
|
new EquilateralTriangle
|
||||||
|
{
|
||||||
|
Name = "Bottom",
|
||||||
|
Anchor = Anchor.BottomCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Position = new Vector2(0, triangle_offset),
|
||||||
|
Size = new Vector2(triangle_size),
|
||||||
|
EdgeSmoothness = new Vector2(1),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
major = ((DrawableBarLine)drawableHitObject).Major.GetBoundCopy();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
major.BindValueChanged(updateMajor, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Box line = null!;
|
||||||
|
|
||||||
|
private void updateMajor(ValueChangedEvent<bool> major)
|
||||||
|
{
|
||||||
|
line.Alpha = major.NewValue ? 1f : 0.75f;
|
||||||
|
triangleContainer.Alpha = major.NewValue ? 1 : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
// 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.Graphics;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Taiko.Skinning.Default
|
||||||
|
{
|
||||||
|
public class DefaultJudgementPiece : Rulesets.Judgements.DefaultJudgementPiece
|
||||||
|
{
|
||||||
|
public DefaultJudgementPiece(HitResult result)
|
||||||
|
: base(result)
|
||||||
|
{
|
||||||
|
RelativePositionAxes = Axes.Both;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void PlayAnimation()
|
||||||
|
{
|
||||||
|
if (Result != HitResult.Miss)
|
||||||
|
{
|
||||||
|
this
|
||||||
|
.MoveToY(-0.6f)
|
||||||
|
.MoveToY(-1.5f, 500);
|
||||||
|
|
||||||
|
JudgementText
|
||||||
|
.ScaleTo(0.9f)
|
||||||
|
.ScaleTo(1, 500, Easing.OutElastic);
|
||||||
|
|
||||||
|
this.FadeOutFromOne(800, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
base.PlayAnimation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,13 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -22,20 +26,10 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private const float tick_size = 0.35f;
|
private const float tick_size = 0.35f;
|
||||||
|
|
||||||
private bool filled;
|
|
||||||
|
|
||||||
public bool Filled
|
|
||||||
{
|
|
||||||
get => filled;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
filled = value;
|
|
||||||
fillBox.Alpha = filled ? 1 : 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly Box fillBox;
|
private readonly Box fillBox;
|
||||||
|
|
||||||
|
private Bindable<bool> isFirstTick = null!;
|
||||||
|
|
||||||
public TickPiece()
|
public TickPiece()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
@ -62,5 +56,19 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private DrawableHitObject drawableHitObject { get; set; } = null!;
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
if (drawableHitObject is DrawableDrumRollTick drumRollTick)
|
||||||
|
{
|
||||||
|
isFirstTick = drumRollTick.IsFirstTick.GetBoundCopy();
|
||||||
|
isFirstTick.BindValueChanged(first => fillBox.Alpha = first.NewValue ? 1 : 0, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osuTK;
|
||||||
|
using DefaultJudgementPiece = osu.Game.Rulesets.Taiko.Skinning.Default.DefaultJudgementPiece;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.UI
|
namespace osu.Game.Rulesets.Taiko.UI
|
||||||
{
|
{
|
||||||
@ -12,31 +14,15 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class DrawableTaikoJudgement : DrawableJudgement
|
public class DrawableTaikoJudgement : DrawableJudgement
|
||||||
{
|
{
|
||||||
protected override void ApplyHitAnimations()
|
public DrawableTaikoJudgement()
|
||||||
{
|
{
|
||||||
this.MoveToY(-100, 500);
|
Anchor = Anchor.Centre;
|
||||||
base.ApplyHitAnimations();
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
Size = Vector2.One;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Drawable CreateDefaultJudgement(HitResult result) => new TaikoJudgementPiece(result);
|
protected override Drawable CreateDefaultJudgement(HitResult result) => new DefaultJudgementPiece(result);
|
||||||
|
|
||||||
private class TaikoJudgementPiece : DefaultJudgementPiece
|
|
||||||
{
|
|
||||||
public TaikoJudgementPiece(HitResult result)
|
|
||||||
: base(result)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void PlayAnimation()
|
|
||||||
{
|
|
||||||
if (Result != HitResult.Miss)
|
|
||||||
{
|
|
||||||
JudgementText.ScaleTo(0.9f);
|
|
||||||
JudgementText.ScaleTo(1, 500, Easing.OutElastic);
|
|
||||||
}
|
|
||||||
|
|
||||||
base.PlayAnimation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
JudgedObject = judgedObject;
|
JudgedObject = judgedObject;
|
||||||
this.hitType = hitType;
|
this.hitType = hitType;
|
||||||
|
|
||||||
Anchor = Anchor.CentreLeft;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
@ -145,13 +145,16 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
kiaiExplosionContainer = new Container<KiaiHitExplosion>
|
kiaiExplosionContainer = new Container<KiaiHitExplosion>
|
||||||
{
|
{
|
||||||
Name = "Kiai hit explosions",
|
Name = "Kiai hit explosions",
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fit,
|
FillMode = FillMode.Fit,
|
||||||
},
|
},
|
||||||
judgementContainer = new JudgementContainer<DrawableTaikoJudgement>
|
judgementContainer = new JudgementContainer<DrawableTaikoJudgement>
|
||||||
{
|
{
|
||||||
Name = "Judgements",
|
Name = "Judgements",
|
||||||
RelativeSizeAxes = Axes.Y,
|
Origin = Anchor.TopCentre,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
FillMode = FillMode.Fit,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -320,15 +323,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
if (!result.Type.IsScorable())
|
if (!result.Type.IsScorable())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
judgementContainer.Add(judgementPools[result.Type].Get(j =>
|
judgementContainer.Add(judgementPools[result.Type].Get(j => j.Apply(result, judgedObject)));
|
||||||
{
|
|
||||||
j.Apply(result, judgedObject);
|
|
||||||
|
|
||||||
j.Anchor = result.IsHit ? Anchor.TopLeft : Anchor.CentreLeft;
|
|
||||||
j.Origin = result.IsHit ? Anchor.BottomCentre : Anchor.Centre;
|
|
||||||
j.RelativePositionAxes = Axes.X;
|
|
||||||
j.X = result.IsHit ? judgedObject.Position.X : 0;
|
|
||||||
}));
|
|
||||||
|
|
||||||
var type = (judgedObject.HitObject as Hit)?.Type ?? HitType.Centre;
|
var type = (judgedObject.HitObject as Hit)?.Type ?? HitType.Centre;
|
||||||
addExplosion(judgedObject, result.Type, type);
|
addExplosion(judgedObject, result.Type, type);
|
||||||
|
@ -35,13 +35,19 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
State = { Value = Visibility.Visible }
|
State = { Value = Visibility.Visible }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
|
[Test]
|
||||||
|
public void TestBasic()
|
||||||
|
{
|
||||||
|
AddStep("do nothing", () => { });
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestFiltering([Values] bool beforeLoad)
|
public void TestFiltering([Values] bool beforeLoad)
|
||||||
{
|
{
|
||||||
|
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
|
||||||
|
|
||||||
if (beforeLoad)
|
if (beforeLoad)
|
||||||
AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling");
|
AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling");
|
||||||
|
|
||||||
@ -67,6 +73,8 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestFilterAfterLoad()
|
public void TestFilterAfterLoad()
|
||||||
{
|
{
|
||||||
|
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
|
||||||
|
|
||||||
AddUntilStep("wait for items to load", () => settings.SectionsContainer.ChildrenOfType<IFilterable>().Any());
|
AddUntilStep("wait for items to load", () => settings.SectionsContainer.ChildrenOfType<IFilterable>().Any());
|
||||||
|
|
||||||
AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling");
|
AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling");
|
||||||
@ -75,6 +83,8 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
[Test]
|
[Test]
|
||||||
public void ToggleVisibility()
|
public void ToggleVisibility()
|
||||||
{
|
{
|
||||||
|
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
|
||||||
|
|
||||||
AddWaitStep("wait some", 5);
|
AddWaitStep("wait some", 5);
|
||||||
AddToggleStep("toggle visibility", _ => settings.ToggleVisibility());
|
AddToggleStep("toggle visibility", _ => settings.ToggleVisibility());
|
||||||
}
|
}
|
||||||
@ -82,6 +92,8 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestTextboxFocusAfterNestedPanelBackButton()
|
public void TestTextboxFocusAfterNestedPanelBackButton()
|
||||||
{
|
{
|
||||||
|
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
|
||||||
|
|
||||||
AddUntilStep("sections loaded", () => settings.SectionsContainer.Children.Count > 0);
|
AddUntilStep("sections loaded", () => settings.SectionsContainer.Children.Count > 0);
|
||||||
AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType<FocusedTextBox>().FirstOrDefault()?.HasFocus == true);
|
AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType<FocusedTextBox>().FirstOrDefault()?.HasFocus == true);
|
||||||
|
|
||||||
@ -107,6 +119,8 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestTextboxFocusAfterNestedPanelEscape()
|
public void TestTextboxFocusAfterNestedPanelEscape()
|
||||||
{
|
{
|
||||||
|
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
|
||||||
|
|
||||||
AddUntilStep("sections loaded", () => settings.SectionsContainer.Children.Count > 0);
|
AddUntilStep("sections loaded", () => settings.SectionsContainer.Children.Count > 0);
|
||||||
AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType<FocusedTextBox>().FirstOrDefault()?.HasFocus == true);
|
AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType<FocusedTextBox>().FirstOrDefault()?.HasFocus == true);
|
||||||
|
|
||||||
|
@ -58,6 +58,14 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
return base.OnClick(e);
|
return base.OnClick(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void PlayHoverSample()
|
||||||
|
{
|
||||||
|
if (!Enabled.Value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
base.PlayHoverSample();
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
|
@ -27,9 +27,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private const float border_width = 3;
|
private const float border_width = 3;
|
||||||
|
|
||||||
private const double animate_in_duration = 200;
|
|
||||||
private const double animate_out_duration = 500;
|
|
||||||
|
|
||||||
private readonly Box fill;
|
private readonly Box fill;
|
||||||
private readonly Container main;
|
private readonly Container main;
|
||||||
|
|
||||||
@ -72,7 +69,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Colour = GlowColour.Opacity(0),
|
Colour = GlowColour.Opacity(0),
|
||||||
Type = EdgeEffectType.Glow,
|
Type = EdgeEffectType.Glow,
|
||||||
Radius = 8,
|
Radius = 8,
|
||||||
Roundness = 5,
|
Roundness = 4,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,13 +91,18 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
main.FadeColour(GlowingAccentColour, animate_in_duration, Easing.OutQuint);
|
main.FadeColour(GlowingAccentColour.Lighten(0.5f), 40, Easing.OutQuint)
|
||||||
main.FadeEdgeEffectTo(0.2f, animate_in_duration, Easing.OutQuint);
|
.Then()
|
||||||
|
.FadeColour(GlowingAccentColour, 800, Easing.OutQuint);
|
||||||
|
|
||||||
|
main.FadeEdgeEffectTo(Color4.White.Opacity(0.1f), 40, Easing.OutQuint)
|
||||||
|
.Then()
|
||||||
|
.FadeEdgeEffectTo(GlowColour.Opacity(0.1f), 800, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
main.FadeEdgeEffectTo(0, animate_out_duration, Easing.OutQuint);
|
main.FadeEdgeEffectTo(GlowColour.Opacity(0), 800, Easing.OutQuint);
|
||||||
main.FadeColour(AccentColour, animate_out_duration, Easing.OutQuint);
|
main.FadeColour(AccentColour, 800, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -163,14 +165,20 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private void onCurrentValueChanged(ValueChangedEvent<bool> filled)
|
private void onCurrentValueChanged(ValueChangedEvent<bool> filled)
|
||||||
{
|
{
|
||||||
fill.FadeTo(filled.NewValue ? 1 : 0, 200, Easing.OutQuint);
|
const double duration = 200;
|
||||||
|
|
||||||
|
fill.FadeTo(filled.NewValue ? 1 : 0, duration, Easing.OutQuint);
|
||||||
|
|
||||||
if (filled.NewValue)
|
if (filled.NewValue)
|
||||||
main.ResizeWidthTo(1, animate_in_duration, Easing.OutElasticHalf);
|
{
|
||||||
|
main.ResizeWidthTo(1, duration, Easing.OutElasticHalf);
|
||||||
|
main.TransformTo(nameof(BorderThickness), 8.5f, duration, Easing.OutElasticHalf);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
main.ResizeWidthTo(0.9f, animate_out_duration, Easing.OutElastic);
|
{
|
||||||
|
main.ResizeWidthTo(0.75f, duration, Easing.OutQuint);
|
||||||
main.TransformTo(nameof(BorderThickness), filled.NewValue ? 8.5f : border_width, 200, Easing.OutQuint);
|
main.TransformTo(nameof(BorderThickness), border_width, duration, Easing.OutQuint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
@ -95,7 +94,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.White.Opacity(.1f),
|
Colour = Color4.White,
|
||||||
Blending = BlendingParameters.Additive,
|
Blending = BlendingParameters.Additive,
|
||||||
Depth = float.MinValue
|
Depth = float.MinValue
|
||||||
},
|
},
|
||||||
@ -126,7 +125,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
protected override bool OnClick(ClickEvent e)
|
protected override bool OnClick(ClickEvent e)
|
||||||
{
|
{
|
||||||
if (Enabled.Value)
|
if (Enabled.Value)
|
||||||
Background.FlashColour(BackgroundColour.Lighten(0.4f), 200);
|
Background.FlashColour(Color4.White, 800, Easing.OutQuint);
|
||||||
|
|
||||||
return base.OnClick(e);
|
return base.OnClick(e);
|
||||||
}
|
}
|
||||||
@ -134,7 +133,11 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
{
|
{
|
||||||
if (Enabled.Value)
|
if (Enabled.Value)
|
||||||
Hover.FadeIn(200, Easing.OutQuint);
|
{
|
||||||
|
Hover.FadeTo(0.2f, 40, Easing.OutQuint)
|
||||||
|
.Then()
|
||||||
|
.FadeTo(0.1f, 800, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
return base.OnHover(e);
|
return base.OnHover(e);
|
||||||
}
|
}
|
||||||
@ -143,7 +146,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
base.OnHoverLost(e);
|
base.OnHoverLost(e);
|
||||||
|
|
||||||
Hover.FadeOut(300);
|
Hover.FadeOut(800, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(MouseDownEvent e)
|
protected override bool OnMouseDown(MouseDownEvent e)
|
||||||
|
@ -131,8 +131,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
},
|
},
|
||||||
hoverClickSounds = new HoverClickSounds()
|
hoverClickSounds = new HoverClickSounds()
|
||||||
};
|
};
|
||||||
|
|
||||||
Current.DisabledChanged += disabled => { Alpha = disabled ? 0.3f : 1; };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
@ -154,7 +152,12 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
CurrentNumber.BindValueChanged(current => TooltipText = getTooltipText(current.NewValue), true);
|
CurrentNumber.BindValueChanged(current => TooltipText = getTooltipText(current.NewValue), true);
|
||||||
Current.DisabledChanged += disabled => hoverClickSounds.Enabled.Value = !disabled;
|
|
||||||
|
Current.BindDisabledChanged(disabled =>
|
||||||
|
{
|
||||||
|
Alpha = disabled ? 0.3f : 1;
|
||||||
|
hoverClickSounds.Enabled.Value = !disabled;
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
@ -180,7 +183,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private void updateGlow()
|
private void updateGlow()
|
||||||
{
|
{
|
||||||
Nub.Glowing = IsHovered || IsDragged;
|
Nub.Glowing = !Current.Disabled && (IsHovered || IsDragged);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnUserChange(T value)
|
protected override void OnUserChange(T value)
|
||||||
|
@ -78,7 +78,7 @@ namespace osu.Game.Input.Bindings
|
|||||||
new KeyBinding(InputKey.F8, GlobalAction.ToggleChat),
|
new KeyBinding(InputKey.F8, GlobalAction.ToggleChat),
|
||||||
new KeyBinding(InputKey.F6, GlobalAction.ToggleNowPlaying),
|
new KeyBinding(InputKey.F6, GlobalAction.ToggleNowPlaying),
|
||||||
new KeyBinding(InputKey.F9, GlobalAction.ToggleSocial),
|
new KeyBinding(InputKey.F9, GlobalAction.ToggleSocial),
|
||||||
new KeyBinding(new[] { InputKey.Control, InputKey.D }, GlobalAction.ToggleBeatmapListing),
|
new KeyBinding(new[] { InputKey.Control, InputKey.B }, GlobalAction.ToggleBeatmapListing),
|
||||||
new KeyBinding(new[] { InputKey.Control, InputKey.O }, GlobalAction.ToggleSettings),
|
new KeyBinding(new[] { InputKey.Control, InputKey.O }, GlobalAction.ToggleSettings),
|
||||||
new KeyBinding(new[] { InputKey.Control, InputKey.N }, GlobalAction.ToggleNotifications),
|
new KeyBinding(new[] { InputKey.Control, InputKey.N }, GlobalAction.ToggleNotifications),
|
||||||
};
|
};
|
||||||
|
@ -168,11 +168,7 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
RemoveInternal(JudgementBody, true);
|
RemoveInternal(JudgementBody, true);
|
||||||
|
|
||||||
AddInternal(JudgementBody = new SkinnableDrawable(new GameplaySkinComponentLookup<HitResult>(type), _ =>
|
AddInternal(JudgementBody = new SkinnableDrawable(new GameplaySkinComponentLookup<HitResult>(type), _ =>
|
||||||
CreateDefaultJudgement(type), confineMode: ConfineMode.NoScaling)
|
CreateDefaultJudgement(type), confineMode: ConfineMode.NoScaling));
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
});
|
|
||||||
|
|
||||||
JudgementBody.OnSkinChanged += () =>
|
JudgementBody.OnSkinChanged += () =>
|
||||||
{
|
{
|
||||||
|
@ -750,7 +750,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
{
|
{
|
||||||
public new TObject HitObject => (TObject)base.HitObject;
|
public new TObject HitObject => (TObject)base.HitObject;
|
||||||
|
|
||||||
protected DrawableHitObject(TObject hitObject)
|
protected DrawableHitObject([CanBeNull] TObject hitObject)
|
||||||
: base(hitObject)
|
: base(hitObject)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user