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)
{
Ball.FadeIn();
Ball.ScaleTo(HitObject.Scale);
using (BeginDelayedSequence(slider.Duration, true))
{
Body.FadeOut(160);
Ball.FadeOut(160);
const float fade_out_time = 450;
this.FadeOut(800)
.Expire();
// intentionally pile on an extra FadeOut to make it happen much faster.
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 Box follow;
public readonly Box FollowCircle;
private readonly Box ball;
public SliderBall(Slider slider)
@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
Children = new Drawable[]
{
follow = new Box
FollowCircle = new Box
{
Origin = 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.
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
// 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;
@ -118,8 +118,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
return;
tracking = value;
follow.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint);
follow.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint);
FollowCircle.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint);
FollowCircle.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint);
}
}
@ -129,11 +129,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
base.Update();
// Make sure to use the base version of ReceiveMouseInputAt so that we correctly check the position.
Tracking = canCurrentlyTrack
&& lastState != null
&& base.ReceiveMouseInputAt(lastState.Mouse.NativeState.Position)
&& ((Parent as DrawableSlider)?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false);
if (Time.Current < slider.EndTime)
{
// Make sure to use the base version of ReceiveMouseInputAt so that we correctly check the position.
Tracking = canCurrentlyTrack
&& lastState != null
&& base.ReceiveMouseInputAt(lastState.Mouse.NativeState.Position)
&& ((Parent as DrawableSlider)?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false);
}
}
public void UpdateProgress(double progress, int repeat)
@ -141,4 +144,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
Position = slider.Curve.PositionAt(progress);
}
}
}
}

View File

@ -70,7 +70,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
Assert.AreEqual(new Vector2(320, 240), sprite.InitialPosition);
Assert.IsTrue(sprite.IsDrawable);
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;
Assert.NotNull(animation);
@ -82,7 +82,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
Assert.IsTrue(animation.IsDrawable);
Assert.AreEqual(AnimationLoopType.LoopForever, animation.LoopType);
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);
}
}

View File

@ -64,24 +64,24 @@ namespace osu.Game.Beatmaps.ControlPoints
/// <returns>The timing control point.</returns>
public TimingControlPoint TimingPointAt(double time) => binarySearch(TimingPoints, time, TimingPoints.FirstOrDefault());
[JsonIgnore]
/// <summary>
/// Finds the maximum BPM represented by any timing control point.
/// </summary>
[JsonIgnore]
public double BPMMaximum =>
60000 / (TimingPoints.OrderBy(c => c.BeatLength).FirstOrDefault() ?? new TimingControlPoint()).BeatLength;
[JsonIgnore]
/// <summary>
/// Finds the minimum BPM represented by any timing control point.
/// </summary>
[JsonIgnore]
public double BPMMinimum =>
60000 / (TimingPoints.OrderByDescending(c => c.BeatLength).FirstOrDefault() ?? new TimingControlPoint()).BeatLength;
[JsonIgnore]
/// <summary>
/// Finds the mode BPM (most common BPM) represented by the control points.
/// </summary>
[JsonIgnore]
public double BPMMode =>
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}");
}
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)
{
if ((invalidation & Invalidation.DrawSize) > 0)

View File

@ -9,11 +9,11 @@ using Newtonsoft.Json.Linq;
namespace osu.Game.IO.Serialization.Converters
{
/// <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
/// reconstruct the objects with their original types.
/// </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
{
private readonly bool requiresTypeVersion;

View File

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

View File

@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Mods
/// <summary>
/// Applies this <see cref="IApplicableToDrawableHitObjects"/> to a list of <see cref="DrawableHitObject"/>s.
/// </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);
}
}

View File

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

View File

@ -20,6 +20,7 @@ using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Localisation;
namespace osu.Game.Screens.Select
{
@ -86,6 +87,8 @@ namespace osu.Game.Screens.Select
public OsuSpriteText ArtistLabel { get; private set; }
public FillFlowContainer MapperContainer { get; private set; }
public FillFlowContainer InfoLabelContainer { get; private set; }
private UnicodeBindableString titleBinding;
private UnicodeBindableString artistBinding;
public BufferedWedgeInfo(WorkingBeatmap working)
{
@ -93,7 +96,7 @@ namespace osu.Game.Screens.Select
}
[BackgroundDependencyLoader]
private void load()
private void load(LocalisationEngine localisation)
{
var beatmapInfo = working.BeatmapInfo;
var metadata = beatmapInfo.Metadata ?? working.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();
@ -102,6 +105,9 @@ namespace osu.Game.Screens.Select
CacheDrawnFrameBuffer = true;
RelativeSizeAxes = Axes.Both;
titleBinding = localisation.GetUnicodePreference(metadata.TitleUnicode, metadata.Title);
artistBinding = localisation.GetUnicodePreference(metadata.ArtistUnicode, metadata.Artist);
Children = new Drawable[]
{
// 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
{
Font = @"Exo2.0-MediumItalic",
Text = string.IsNullOrEmpty(metadata.Source) ? metadata.Title : metadata.Source + " — " + metadata.Title,
TextSize = 28,
},
ArtistLabel = new OsuSpriteText
{
Font = @"Exo2.0-MediumItalic",
Text = metadata.Artist,
TextSize = 17,
},
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()

View File

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

View File

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

View File

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