mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 08:03:52 +09:00
Merge branch 'master' into open-downloaded-beatmas
This commit is contained in:
@ -7,6 +7,7 @@ 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;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||||
{
|
{
|
||||||
@ -20,27 +21,26 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
|||||||
{
|
{
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Masking = true;
|
Child = new SkinnableDrawable("Play/osu/followpoint", _ => new Container
|
||||||
AutoSizeAxes = Axes.Both;
|
{
|
||||||
CornerRadius = width / 2;
|
Masking = true,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
CornerRadius = width / 2,
|
||||||
EdgeEffect = new EdgeEffectParameters
|
EdgeEffect = new EdgeEffectParameters
|
||||||
{
|
{
|
||||||
Type = EdgeEffectType.Glow,
|
Type = EdgeEffectType.Glow,
|
||||||
Colour = Color4.White.Opacity(0.2f),
|
Colour = Color4.White.Opacity(0.2f),
|
||||||
Radius = 4,
|
Radius = 4,
|
||||||
};
|
},
|
||||||
|
Child = new Box
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new Box
|
|
||||||
{
|
{
|
||||||
Size = new Vector2(width),
|
Size = new Vector2(width),
|
||||||
Blending = BlendingMode.Additive,
|
Blending = BlendingMode.Additive,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Alpha = 0.5f,
|
Alpha = 0.5f,
|
||||||
},
|
}
|
||||||
};
|
}, restrictSize: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
|||||||
|
|
||||||
Vector2 distanceVector = endPosition - startPosition;
|
Vector2 distanceVector = endPosition - startPosition;
|
||||||
int distance = (int)distanceVector.Length;
|
int distance = (int)distanceVector.Length;
|
||||||
float rotation = (float)Math.Atan2(distanceVector.Y, distanceVector.X);
|
float rotation = (float)(Math.Atan2(distanceVector.Y, distanceVector.X) * (180 / Math.PI));
|
||||||
double duration = endTime - startTime;
|
double duration = endTime - startTime;
|
||||||
|
|
||||||
for (int d = (int)(PointDistance * 1.5); d < distance - PointDistance; d += PointDistance)
|
for (int d = (int)(PointDistance * 1.5); d < distance - PointDistance; d += PointDistance)
|
||||||
|
@ -10,6 +10,7 @@ using OpenTK;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Rulesets.Osu.Judgements;
|
using osu.Game.Rulesets.Osu.Judgements;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||||
{
|
{
|
||||||
@ -33,11 +34,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new SpriteIcon
|
new SkinnableDrawable("Play/osu/reversearrow", _ => new SpriteIcon
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Icon = FontAwesome.fa_chevron_right
|
Icon = FontAwesome.fa_chevron_right
|
||||||
}
|
}, restrictSize: false)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ using OpenTK.Graphics;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Rulesets.Osu.Judgements;
|
using osu.Game.Rulesets.Osu.Judgements;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||||
{
|
{
|
||||||
@ -22,23 +24,27 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
public DrawableSliderTick(SliderTick sliderTick) : base(sliderTick)
|
public DrawableSliderTick(SliderTick sliderTick) : base(sliderTick)
|
||||||
{
|
{
|
||||||
Size = new Vector2(16) * sliderTick.Scale;
|
Size = new Vector2(16) * sliderTick.Scale;
|
||||||
|
|
||||||
Masking = true;
|
|
||||||
CornerRadius = Size.X / 2;
|
|
||||||
|
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
BorderThickness = 2;
|
|
||||||
BorderColour = Color4.White;
|
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new SkinnableDrawable("Play/osu/sliderscorepoint", _ => new Container
|
||||||
|
{
|
||||||
|
Masking = true,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
CornerRadius = Size.X / 2,
|
||||||
|
|
||||||
|
BorderThickness = 2,
|
||||||
|
BorderColour = Color4.White,
|
||||||
|
|
||||||
|
Child = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = AccentColour,
|
Colour = AccentColour,
|
||||||
Alpha = 0.3f,
|
Alpha = 0.3f,
|
||||||
}
|
}
|
||||||
|
}, restrictSize: false)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Input.States;
|
|||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||||
{
|
{
|
||||||
@ -18,6 +19,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
private const float width = 128;
|
private const float width = 128;
|
||||||
|
|
||||||
private Color4 accentColour = Color4.Black;
|
private Color4 accentColour = Color4.Black;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The colour that is used for the slider ball.
|
/// The colour that is used for the slider ball.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -27,14 +29,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
accentColour = value;
|
accentColour = value;
|
||||||
if (ball != null)
|
if (drawableBall != null)
|
||||||
ball.Colour = value;
|
drawableBall.Colour = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly Slider slider;
|
private readonly Slider slider;
|
||||||
public readonly Box FollowCircle;
|
public readonly Drawable FollowCircle;
|
||||||
private readonly Box ball;
|
private Drawable drawableBall;
|
||||||
|
|
||||||
public SliderBall(Slider slider)
|
public SliderBall(Slider slider)
|
||||||
{
|
{
|
||||||
@ -43,19 +45,30 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
Blending = BlendingMode.Additive;
|
Blending = BlendingMode.Additive;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
BorderThickness = 10;
|
|
||||||
BorderColour = Color4.Orange;
|
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
FollowCircle = new Box
|
FollowCircle = new Container
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Colour = Color4.Orange,
|
|
||||||
Width = width,
|
Width = width,
|
||||||
Height = width,
|
Height = width,
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
|
Child = new SkinnableDrawable("Play/osu/sliderfollowcircle", _ => new CircularContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Masking = true,
|
||||||
|
BorderThickness = 5,
|
||||||
|
BorderColour = Color4.Orange,
|
||||||
|
Blending = BlendingMode.Additive,
|
||||||
|
Child = new Box
|
||||||
|
{
|
||||||
|
Colour = Color4.Orange,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Alpha = 0.2f,
|
||||||
|
}
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
new CircularContainer
|
new CircularContainer
|
||||||
{
|
{
|
||||||
@ -63,18 +76,26 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
Alpha = 1,
|
||||||
|
Child = new Container
|
||||||
|
{
|
||||||
|
Width = width,
|
||||||
|
Height = width,
|
||||||
|
// TODO: support skin filename animation (sliderb0, sliderb1...)
|
||||||
|
Child = new SkinnableDrawable("Play/osu/sliderb", _ => new CircularContainer
|
||||||
|
{
|
||||||
|
Masking = true,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
BorderThickness = 10,
|
BorderThickness = 10,
|
||||||
BorderColour = Color4.White,
|
BorderColour = Color4.White,
|
||||||
Alpha = 1,
|
Alpha = 1,
|
||||||
Children = new[]
|
Child = drawableBall = new Box
|
||||||
{
|
|
||||||
ball = new Box
|
|
||||||
{
|
{
|
||||||
Colour = AccentColour,
|
Colour = AccentColour,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
Alpha = 0.4f,
|
Alpha = 0.4f,
|
||||||
Width = width,
|
}
|
||||||
Height = width,
|
}),
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -111,6 +132,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
}
|
}
|
||||||
|
|
||||||
private bool tracking;
|
private bool tracking;
|
||||||
|
|
||||||
public bool Tracking
|
public bool Tracking
|
||||||
{
|
{
|
||||||
get { return tracking; }
|
get { return tracking; }
|
||||||
@ -120,8 +142,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
return;
|
return;
|
||||||
tracking = value;
|
tracking = value;
|
||||||
|
|
||||||
FollowCircle.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint);
|
FollowCircle.ScaleTo(tracking ? 2f : 1, 300, Easing.OutQuint);
|
||||||
FollowCircle.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint);
|
FollowCircle.FadeTo(tracking ? 1f : 0, 300, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,9 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
{
|
{
|
||||||
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
||||||
|
|
||||||
|
// Out preempt should be one span early to give the user ample warning.
|
||||||
|
TimePreempt += SpanDuration;
|
||||||
|
|
||||||
// We want to show the first RepeatPoint as the TimePreempt dictates but on short (and possibly fast) sliders
|
// We want to show the first RepeatPoint as the TimePreempt dictates but on short (and possibly fast) sliders
|
||||||
// we may need to cut down this time on following RepeatPoints to only show up to two RepeatPoints at any given time.
|
// we may need to cut down this time on following RepeatPoints to only show up to two RepeatPoints at any given time.
|
||||||
if (RepeatIndex > 0)
|
if (RepeatIndex > 0)
|
||||||
|
@ -54,11 +54,11 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
breadcrumbs.Current.TriggerChange();
|
breadcrumbs.Current.TriggerChange();
|
||||||
|
|
||||||
assertCurrent();
|
waitForCurrent();
|
||||||
pushNext();
|
pushNext();
|
||||||
assertCurrent();
|
waitForCurrent();
|
||||||
pushNext();
|
pushNext();
|
||||||
assertCurrent();
|
waitForCurrent();
|
||||||
|
|
||||||
AddStep(@"make start current", () =>
|
AddStep(@"make start current", () =>
|
||||||
{
|
{
|
||||||
@ -66,8 +66,9 @@ namespace osu.Game.Tests.Visual
|
|||||||
currentScreen = startScreen;
|
currentScreen = startScreen;
|
||||||
});
|
});
|
||||||
|
|
||||||
assertCurrent();
|
waitForCurrent();
|
||||||
pushNext();
|
pushNext();
|
||||||
|
waitForCurrent();
|
||||||
AddAssert(@"only 2 items", () => breadcrumbs.Items.Count() == 2);
|
AddAssert(@"only 2 items", () => breadcrumbs.Items.Count() == 2);
|
||||||
AddStep(@"exit current", () => changedScreen.Exit());
|
AddStep(@"exit current", () => changedScreen.Exit());
|
||||||
AddAssert(@"current screen is first", () => startScreen == changedScreen);
|
AddAssert(@"current screen is first", () => startScreen == changedScreen);
|
||||||
@ -80,7 +81,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void pushNext() => AddStep(@"push next screen", () => currentScreen = ((TestScreen)currentScreen).PushNext());
|
private void pushNext() => AddStep(@"push next screen", () => currentScreen = ((TestScreen)currentScreen).PushNext());
|
||||||
private void assertCurrent() => AddAssert(@"changedScreen correct", () => currentScreen == changedScreen);
|
private void waitForCurrent() => AddUntilStep(() => currentScreen.IsCurrentScreen, "current screen");
|
||||||
|
|
||||||
private abstract class TestScreen : OsuScreen
|
private abstract class TestScreen : OsuScreen
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user