1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 02:32:55 +08:00

Merge branch 'master' into mania-rc-cleanup

This commit is contained in:
Dean Herbert 2018-01-05 10:18:15 +09:00 committed by GitHub
commit 01038bd9bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 55 additions and 40 deletions

@ -1 +1 @@
Subproject commit 6134dafccb3368dac96d837537325c04b89fb8ee Subproject commit 8366ab17059b8964b0fd6d1ef4f07b0f3412c2ec

View File

@ -158,14 +158,23 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected override void UpdateCurrentState(ArmedState state) protected override void UpdateCurrentState(ArmedState state)
{ {
Ball.FadeIn(); Ball.FadeIn();
Ball.ScaleTo(HitObject.Scale);
using (BeginDelayedSequence(slider.Duration, true)) using (BeginDelayedSequence(slider.Duration, true))
{ {
Body.FadeOut(160); const float fade_out_time = 450;
Ball.FadeOut(160);
this.FadeOut(800) // intentionally pile on an extra FadeOut to make it happen much faster.
.Expire(); Ball.FadeOut(fade_out_time / 4, Easing.Out);
switch (state)
{
case ArmedState.Hit:
Ball.ScaleTo(HitObject.Scale * 1.4f, fade_out_time, Easing.Out);
break;
}
this.FadeOut(fade_out_time, Easing.OutQuint).Expire();
} }
} }

View File

@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
} }
private readonly Slider slider; private readonly Slider slider;
private readonly Box follow; public readonly Box FollowCircle;
private readonly Box ball; private readonly Box ball;
public SliderBall(Slider slider) public SliderBall(Slider slider)
@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
Children = new Drawable[] Children = new Drawable[]
{ {
follow = new Box FollowCircle = new Box
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
@ -101,11 +101,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
// If the current time is between the start and end of the slider, we should track mouse input regardless of the cursor position. // If the current time is between the start and end of the slider, we should track mouse input regardless of the cursor position.
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => canCurrentlyTrack || base.ReceiveMouseInputAt(screenSpacePos); public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => canCurrentlyTrack || base.ReceiveMouseInputAt(screenSpacePos);
public override void ClearTransforms(bool propagateChildren = false, string targetMember = null) public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null)
{ {
// Consider the case of rewinding - children's transforms are handled internally, so propagating down // Consider the case of rewinding - children's transforms are handled internally, so propagating down
// any further will cause weirdness with the Tracking bool below. Let's not propagate further at this point. // any further will cause weirdness with the Tracking bool below. Let's not propagate further at this point.
base.ClearTransforms(false, targetMember); base.ClearTransformsAfter(time, false, targetMember);
} }
private bool tracking; private bool tracking;
@ -118,8 +118,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
return; return;
tracking = value; tracking = value;
follow.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint); FollowCircle.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint);
follow.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint); FollowCircle.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint);
} }
} }
@ -129,12 +129,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
base.Update(); base.Update();
if (Time.Current < slider.EndTime)
{
// Make sure to use the base version of ReceiveMouseInputAt so that we correctly check the position. // Make sure to use the base version of ReceiveMouseInputAt so that we correctly check the position.
Tracking = canCurrentlyTrack Tracking = canCurrentlyTrack
&& lastState != null && lastState != null
&& base.ReceiveMouseInputAt(lastState.Mouse.NativeState.Position) && base.ReceiveMouseInputAt(lastState.Mouse.NativeState.Position)
&& ((Parent as DrawableSlider)?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false); && ((Parent as DrawableSlider)?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false);
} }
}
public void UpdateProgress(double progress, int repeat) public void UpdateProgress(double progress, int repeat)
{ {

View File

@ -70,7 +70,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
Assert.AreEqual(new Vector2(320, 240), sprite.InitialPosition); Assert.AreEqual(new Vector2(320, 240), sprite.InitialPosition);
Assert.IsTrue(sprite.IsDrawable); Assert.IsTrue(sprite.IsDrawable);
Assert.AreEqual(Anchor.Centre, sprite.Origin); Assert.AreEqual(Anchor.Centre, sprite.Origin);
Assert.AreEqual("SB/lyric/ja-21.png", sprite.Path); Assert.AreEqual(Path.Combine("SB", "lyric", "ja-21.png"), sprite.Path);
var animation = background.Elements.ElementAt(12) as StoryboardAnimation; var animation = background.Elements.ElementAt(12) as StoryboardAnimation;
Assert.NotNull(animation); Assert.NotNull(animation);
@ -82,7 +82,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
Assert.IsTrue(animation.IsDrawable); Assert.IsTrue(animation.IsDrawable);
Assert.AreEqual(AnimationLoopType.LoopForever, animation.LoopType); Assert.AreEqual(AnimationLoopType.LoopForever, animation.LoopType);
Assert.AreEqual(Anchor.Centre, animation.Origin); Assert.AreEqual(Anchor.Centre, animation.Origin);
Assert.AreEqual("SB/red jitter/red_0000.jpg", animation.Path); Assert.AreEqual(Path.Combine("SB", "red jitter", "red_0000.jpg"), animation.Path);
Assert.AreEqual(78993, animation.StartTime); Assert.AreEqual(78993, animation.StartTime);
} }
} }

View File

@ -64,24 +64,24 @@ namespace osu.Game.Beatmaps.ControlPoints
/// <returns>The timing control point.</returns> /// <returns>The timing control point.</returns>
public TimingControlPoint TimingPointAt(double time) => binarySearch(TimingPoints, time, TimingPoints.FirstOrDefault()); public TimingControlPoint TimingPointAt(double time) => binarySearch(TimingPoints, time, TimingPoints.FirstOrDefault());
[JsonIgnore]
/// <summary> /// <summary>
/// Finds the maximum BPM represented by any timing control point. /// Finds the maximum BPM represented by any timing control point.
/// </summary> /// </summary>
[JsonIgnore]
public double BPMMaximum => public double BPMMaximum =>
60000 / (TimingPoints.OrderBy(c => c.BeatLength).FirstOrDefault() ?? new TimingControlPoint()).BeatLength; 60000 / (TimingPoints.OrderBy(c => c.BeatLength).FirstOrDefault() ?? new TimingControlPoint()).BeatLength;
[JsonIgnore]
/// <summary> /// <summary>
/// Finds the minimum BPM represented by any timing control point. /// Finds the minimum BPM represented by any timing control point.
/// </summary> /// </summary>
[JsonIgnore]
public double BPMMinimum => public double BPMMinimum =>
60000 / (TimingPoints.OrderByDescending(c => c.BeatLength).FirstOrDefault() ?? new TimingControlPoint()).BeatLength; 60000 / (TimingPoints.OrderByDescending(c => c.BeatLength).FirstOrDefault() ?? new TimingControlPoint()).BeatLength;
[JsonIgnore]
/// <summary> /// <summary>
/// Finds the mode BPM (most common BPM) represented by the control points. /// Finds the mode BPM (most common BPM) represented by the control points.
/// </summary> /// </summary>
[JsonIgnore]
public double BPMMode => public double BPMMode =>
60000 / (TimingPoints.GroupBy(c => c.BeatLength).OrderByDescending(grp => grp.Count()).FirstOrDefault()?.FirstOrDefault() ?? new TimingControlPoint()).BeatLength; 60000 / (TimingPoints.GroupBy(c => c.BeatLength).OrderByDescending(grp => grp.Count()).FirstOrDefault()?.FirstOrDefault() ?? new TimingControlPoint()).BeatLength;

View File

@ -266,6 +266,6 @@ namespace osu.Game.Beatmaps.Formats
throw new InvalidDataException($@"Unknown origin: {value}"); throw new InvalidDataException($@"Unknown origin: {value}");
} }
private string cleanFilename(string path) => FileSafety.PathStandardise(path.Trim('\"')); private string cleanFilename(string path) => FileSafety.PathSanitise(path.Trim('\"'));
} }
} }

View File

@ -73,8 +73,6 @@ namespace osu.Game.Graphics.UserInterface
}); });
} }
private bool pending;
public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true) public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true)
{ {
if ((invalidation & Invalidation.DrawSize) > 0) if ((invalidation & Invalidation.DrawSize) > 0)

View File

@ -9,11 +9,11 @@ using Newtonsoft.Json.Linq;
namespace osu.Game.IO.Serialization.Converters namespace osu.Game.IO.Serialization.Converters
{ {
/// <summary> /// <summary>
/// A type of <see cref="JsonConverter"/> that serializes a <see cref="List<T>"/> alongside /// A type of <see cref="JsonConverter"/> that serializes a <see cref="List{T}"/> alongside
/// a lookup table for the types contained. The lookup table is used in deserialization to /// a lookup table for the types contained. The lookup table is used in deserialization to
/// reconstruct the objects with their original types. /// reconstruct the objects with their original types.
/// </summary> /// </summary>
/// <typeparam name="T">The type of objects contained in the <see cref="List<T>"/> this attribute is attached to.</typeparam> /// <typeparam name="T">The type of objects contained in the <see cref="List{T}"/> this attribute is attached to.</typeparam>
public class TypedListConverter<T> : JsonConverter public class TypedListConverter<T> : JsonConverter
{ {
private readonly bool requiresTypeVersion; private readonly bool requiresTypeVersion;

View File

@ -4,7 +4,6 @@
using OpenTK; using OpenTK;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
@ -16,7 +15,6 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
{ {
public abstract class DrawableProfileScore : DrawableProfileRow public abstract class DrawableProfileScore : DrawableProfileRow
{ {
private readonly FillFlowContainer metadata;
private readonly ScoreModsContainer modsContainer; private readonly ScoreModsContainer modsContainer;
protected readonly Score Score; protected readonly Score Score;

View File

@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Mods
/// <summary> /// <summary>
/// Applies this <see cref="IApplicableToDrawableHitObjects"/> to a list of <see cref="DrawableHitObject"/>s. /// Applies this <see cref="IApplicableToDrawableHitObjects"/> to a list of <see cref="DrawableHitObject"/>s.
/// </summary> /// </summary>
/// <param name="drawable">The list of <see cref="DrawableHitObject"/>s to apply to.</param> /// <param name="drawables">The list of <see cref="DrawableHitObject"/>s to apply to.</param>
void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables); void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables);
} }
} }

View File

@ -101,8 +101,6 @@ namespace osu.Game.Screens
loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_3, FragmentShaderDescriptor.TEXTURE)); loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_3, FragmentShaderDescriptor.TEXTURE));
} }
private Shader currentLoadTarget;
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();

View File

@ -20,6 +20,7 @@ using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Objects.Types;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Cursor;
using osu.Framework.Localisation;
namespace osu.Game.Screens.Select namespace osu.Game.Screens.Select
{ {
@ -86,6 +87,8 @@ namespace osu.Game.Screens.Select
public OsuSpriteText ArtistLabel { get; private set; } public OsuSpriteText ArtistLabel { get; private set; }
public FillFlowContainer MapperContainer { get; private set; } public FillFlowContainer MapperContainer { get; private set; }
public FillFlowContainer InfoLabelContainer { get; private set; } public FillFlowContainer InfoLabelContainer { get; private set; }
private UnicodeBindableString titleBinding;
private UnicodeBindableString artistBinding;
public BufferedWedgeInfo(WorkingBeatmap working) public BufferedWedgeInfo(WorkingBeatmap working)
{ {
@ -93,7 +96,7 @@ namespace osu.Game.Screens.Select
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load(LocalisationEngine localisation)
{ {
var beatmapInfo = working.BeatmapInfo; var beatmapInfo = working.BeatmapInfo;
var metadata = beatmapInfo.Metadata ?? working.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); var metadata = beatmapInfo.Metadata ?? working.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();
@ -102,6 +105,9 @@ namespace osu.Game.Screens.Select
CacheDrawnFrameBuffer = true; CacheDrawnFrameBuffer = true;
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
titleBinding = localisation.GetUnicodePreference(metadata.TitleUnicode, metadata.Title);
artistBinding = localisation.GetUnicodePreference(metadata.ArtistUnicode, metadata.Artist);
Children = new Drawable[] Children = new Drawable[]
{ {
// We will create the white-to-black gradient by modulating transparency and having // We will create the white-to-black gradient by modulating transparency and having
@ -167,13 +173,11 @@ namespace osu.Game.Screens.Select
TitleLabel = new OsuSpriteText TitleLabel = new OsuSpriteText
{ {
Font = @"Exo2.0-MediumItalic", Font = @"Exo2.0-MediumItalic",
Text = string.IsNullOrEmpty(metadata.Source) ? metadata.Title : metadata.Source + " — " + metadata.Title,
TextSize = 28, TextSize = 28,
}, },
ArtistLabel = new OsuSpriteText ArtistLabel = new OsuSpriteText
{ {
Font = @"Exo2.0-MediumItalic", Font = @"Exo2.0-MediumItalic",
Text = metadata.Artist,
TextSize = 17, TextSize = 17,
}, },
MapperContainer = new FillFlowContainer MapperContainer = new FillFlowContainer
@ -193,6 +197,15 @@ namespace osu.Game.Screens.Select
} }
} }
}; };
artistBinding.ValueChanged += value => setMetadata(metadata.Source);
artistBinding.TriggerChange();
}
private void setMetadata(string source)
{
ArtistLabel.Text = artistBinding.Value;
TitleLabel.Text = string.IsNullOrEmpty(source) ? titleBinding.Value : source + " — " + titleBinding.Value;
ForceRedraw();
} }
private InfoLabel[] getInfoLabels() private InfoLabel[] getInfoLabels()

View File

@ -10,8 +10,6 @@ namespace osu.Game.Screens.Select.Carousel
/// </summary> /// </summary>
public class CarouselGroup : CarouselItem public class CarouselGroup : CarouselItem
{ {
private readonly List<CarouselItem> items;
protected override DrawableCarouselItem CreateDrawableRepresentation() => null; protected override DrawableCarouselItem CreateDrawableRepresentation() => null;
public IReadOnlyList<CarouselItem> Children => InternalChildren; public IReadOnlyList<CarouselItem> Children => InternalChildren;

View File

@ -31,8 +31,6 @@ namespace osu.Game.Screens.Select.Carousel
private readonly BeatmapSetInfo beatmapSet; private readonly BeatmapSetInfo beatmapSet;
private readonly FillFlowContainer difficultyIcons;
public DrawableCarouselBeatmapSet(CarouselBeatmapSet set) public DrawableCarouselBeatmapSet(CarouselBeatmapSet set)
: base(set) : base(set)
{ {

View File

@ -40,7 +40,7 @@ namespace osu.Game.Screens.Select.Leaderboards
{ {
private readonly SpriteIcon icon; private readonly SpriteIcon icon;
public Action Action; public new Action Action;
public RetryButton() public RetryButton()
{ {