Merge branch 'master' into osu-direct-search

This commit is contained in:
Dean Herbert
2017-07-13 10:08:31 +09:00
39 changed files with 159 additions and 222 deletions

10
.vscode/tasks.json vendored
View File

@ -9,15 +9,9 @@
"showOutput": "silent", "showOutput": "silent",
"args": [ "args": [
"/property:GenerateFullPaths=true", "/property:GenerateFullPaths=true",
"/property:DebugType=portable" "/property:DebugType=portable",
"/m" //parallel compiling support.
], ],
"windows": {
"args": [
"/property:GenerateFullPaths=true",
"/property:DebugType=portable",
"/m" //parallel compiling support. doesn't work well with mono atm
]
},
"tasks": [ "tasks": [
{ {
"taskName": "Build (Debug)", "taskName": "Build (Debug)",

View File

@ -76,7 +76,7 @@ namespace osu.Desktop.VisualTests.Tests
ControlPointInfo = controlPointInfo ControlPointInfo = controlPointInfo
}); });
Add(new Drawable[] AddRange(new Drawable[]
{ {
new Container new Container
{ {

View File

@ -50,7 +50,7 @@ namespace osu.Desktop.VisualTests.Tests
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Position = new Vector2(20, -160), Position = new Vector2(20, -160),
Count = 5, CountStars = 5,
}; };
Add(stars); Add(stars);
@ -59,7 +59,7 @@ namespace osu.Desktop.VisualTests.Tests
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Position = new Vector2(20, -190), Position = new Vector2(20, -190),
Text = stars.Count.ToString("0.00"), Text = stars.CountStars.ToString("0.00"),
}; };
Add(starsLabel); Add(starsLabel);
@ -69,8 +69,8 @@ namespace osu.Desktop.VisualTests.Tests
comboCounter.Current.Value = 0; comboCounter.Current.Value = 0;
numerator = denominator = 0; numerator = denominator = 0;
accuracyCounter.SetFraction(0, 0); accuracyCounter.SetFraction(0, 0);
stars.Count = 0; stars.CountStars = 0;
starsLabel.Text = stars.Count.ToString("0.00"); starsLabel.Text = stars.CountStars.ToString("0.00");
}); });
AddStep(@"Hit! :D", delegate AddStep(@"Hit! :D", delegate
@ -91,8 +91,8 @@ namespace osu.Desktop.VisualTests.Tests
AddStep(@"Alter stars", delegate AddStep(@"Alter stars", delegate
{ {
stars.Count = RNG.NextSingle() * (stars.StarCount + 1); stars.CountStars = RNG.NextSingle() * (stars.StarCount + 1);
starsLabel.Text = stars.Count.ToString("0.00"); starsLabel.Text = stars.CountStars.ToString("0.00");
}); });
AddStep(@"Stop counters", delegate AddStep(@"Stop counters", delegate

View File

@ -55,7 +55,7 @@ namespace osu.Desktop.VisualTests.Tests
timeRangeBindable.ValueChanged += v => timeRangeText.Text = $"Visible Range: {v:#,#.#}"; timeRangeBindable.ValueChanged += v => timeRangeText.Text = $"Visible Range: {v:#,#.#}";
timeRangeBindable.ValueChanged += v => bottomLabel.Text = $"t minus {v:#,#}"; timeRangeBindable.ValueChanged += v => bottomLabel.Text = $"t minus {v:#,#}";
Add(new Drawable[] AddRange(new Drawable[]
{ {
new Container new Container
{ {

View File

@ -202,7 +202,7 @@ namespace osu.Desktop.Overlays
{ {
this.game = game; this.game = game;
IconContent.Add(new Drawable[] IconContent.AddRange(new Drawable[]
{ {
new Box new Box
{ {

View File

@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
Height = (float)HitObject.Duration; Height = (float)HitObject.Duration;
Add(new Drawable[] AddRange(new Drawable[]
{ {
// For now the body piece covers the entire height of the container // For now the body piece covers the entire height of the container
// whereas possibly in the future we don't want to extend under the head/tail. // whereas possibly in the future we don't want to extend under the head/tail.

View File

@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Osu.UI
Anchor = Anchor.Centre; Anchor = Anchor.Centre;
Origin = Anchor.Centre; Origin = Anchor.Centre;
Add(new Drawable[] AddRange(new Drawable[]
{ {
connectionLayer = new FollowPointRenderer connectionLayer = new FollowPointRenderer
{ {

View File

@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
{ {
EarlyActivationMilliseconds = pre_beat_transition_time; EarlyActivationMilliseconds = pre_beat_transition_time;
AddInternal(new Drawable[] AddRangeInternal(new Drawable[]
{ {
background = new CircularContainer background = new CircularContainer
{ {

View File

@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Taiko.UI
public TaikoPlayfield() public TaikoPlayfield()
{ {
AddInternal(new Drawable[] AddRangeInternal(new Drawable[]
{ {
new ScaleFixContainer new ScaleFixContainer
{ {

View File

@ -75,18 +75,16 @@ namespace osu.Game.Tests.Beatmaps.IO
var temp = prepareTempCopy(osz_path); var temp = prepareTempCopy(osz_path);
Assert.IsTrue(File.Exists(temp)); Assert.IsTrue(File.Exists(temp), "Temporary file copy never substantiated");
using (File.OpenRead(temp)) using (File.OpenRead(temp))
host.Dependencies.Get<BeatmapDatabase>().Import(temp); host.Dependencies.Get<BeatmapDatabase>().Import(temp);
ensureLoaded(host); ensureLoaded(host);
Assert.IsTrue(File.Exists(temp));
File.Delete(temp); File.Delete(temp);
Assert.IsFalse(File.Exists(temp)); Assert.IsFalse(File.Exists(temp), "We likely held a read lock on the file when we shouldn't");
} }
} }

View File

@ -140,7 +140,7 @@ namespace osu.Game.Beatmaps.Drawables
}, },
starCounter = new StarCounter starCounter = new StarCounter
{ {
Count = (float)beatmap.StarDifficulty, CountStars = (float)beatmap.StarDifficulty,
Scale = new Vector2(0.8f), Scale = new Vector2(0.8f),
} }
} }

View File

@ -8,9 +8,10 @@ using osu.Framework.Graphics.Containers;
namespace osu.Game.Graphics.Containers namespace osu.Game.Graphics.Containers
{ {
public class ReverseDepthFillFlowContainer<T> : FillFlowContainer<T> where T : Drawable public class ReverseChildIDFillFlowContainer<T> : FillFlowContainer<T> where T : Drawable
{ {
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer(); protected override int Compare(Drawable x, Drawable y) => CompareReverseChildID(x, y);
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse(); protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
} }
} }

View File

@ -93,7 +93,7 @@ namespace osu.Game.Graphics.Containers
sections = value.ToList(); sections = value.ToList();
if (sections.Count == 0) return; if (sections.Count == 0) return;
sectionsContainer.Add(sections); sectionsContainer.AddRange(sections);
SelectedSection.Value = sections[0]; SelectedSection.Value = sections[0];
lastKnownScroll = float.NaN; lastKnownScroll = float.NaN;
} }

View File

@ -58,7 +58,7 @@ namespace osu.Game.Graphics.UserInterface
Direction = Direction, Direction = Direction,
}); });
//I'm using ToList() here because Where() returns an Enumerable which can change it's elements afterwards //I'm using ToList() here because Where() returns an Enumerable which can change it's elements afterwards
Remove(Children.Where((bar, index) => index >= value.Count()).ToList()); RemoveRange(Children.Where((bar, index) => index >= value.Count()).ToList());
} }
} }
} }

View File

@ -49,7 +49,7 @@ namespace osu.Game.Graphics.UserInterface
Content.Masking = true; Content.Masking = true;
Content.CornerRadius = 5; Content.CornerRadius = 5;
Add(new Drawable[] AddRange(new Drawable[]
{ {
new Triangles new Triangles
{ {

View File

@ -17,7 +17,7 @@ namespace osu.Game.Graphics.UserInterface
public SearchTextBox() public SearchTextBox()
{ {
Height = 35; Height = 35;
Add(new Drawable[] AddRange(new Drawable[]
{ {
new TextAwesome new TextAwesome
{ {

View File

@ -33,25 +33,25 @@ namespace osu.Game.Graphics.UserInterface
private const float star_size = 20; private const float star_size = 20;
private const float star_spacing = 4; private const float star_spacing = 4;
private float count; private float countStars;
/// <summary> /// <summary>
/// Amount of stars represented. /// Amount of stars represented.
/// </summary> /// </summary>
public float Count public float CountStars
{ {
get get
{ {
return count; return countStars;
} }
set set
{ {
if (count == value) return; if (countStars == value) return;
if (IsLoaded) if (IsLoaded)
transformCount(value); transformCount(value);
count = value; countStars = value;
} }
} }
@ -94,15 +94,15 @@ namespace osu.Game.Graphics.UserInterface
public void ResetCount() public void ResetCount()
{ {
count = 0; countStars = 0;
StopAnimation(); StopAnimation();
} }
public void ReplayAnimation() public void ReplayAnimation()
{ {
var t = count; var t = countStars;
ResetCount(); ResetCount();
Count = t; CountStars = t;
} }
public void StopAnimation() public void StopAnimation()
@ -111,8 +111,8 @@ namespace osu.Game.Graphics.UserInterface
foreach (var star in stars.Children) foreach (var star in stars.Children)
{ {
star.ClearTransforms(true); star.ClearTransforms(true);
star.FadeTo(i < count ? 1.0f : minStarAlpha); star.FadeTo(i < countStars ? 1.0f : minStarAlpha);
star.Icon.ScaleTo(getStarScale(i, count)); star.Icon.ScaleTo(getStarScale(i, countStars));
i++; i++;
} }
} }
@ -132,7 +132,7 @@ namespace osu.Game.Graphics.UserInterface
{ {
star.ClearTransforms(true); star.ClearTransforms(true);
var delay = (count <= newValue ? Math.Max(i - count, 0) : Math.Max(count - 1 - i, 0)) * animationDelay; var delay = (countStars <= newValue ? Math.Max(i - countStars, 0) : Math.Max(countStars - 1 - i, 0)) * animationDelay;
using (BeginDelayedSequence(delay, true)) using (BeginDelayedSequence(delay, true))
{ {

View File

@ -141,7 +141,7 @@ namespace osu.Game
{ {
base.LoadComplete(); base.LoadComplete();
Add(new Drawable[] { AddRange(new Drawable[] {
new VolumeControlReceptor new VolumeControlReceptor
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,

View File

@ -67,7 +67,7 @@ namespace osu.Game.Overlays.Chat
var displayMessages = newMessages.Skip(Math.Max(0, newMessages.Count() - Channel.MAX_HISTORY)); var displayMessages = newMessages.Skip(Math.Max(0, newMessages.Count() - Channel.MAX_HISTORY));
//up to last Channel.MAX_HISTORY messages //up to last Channel.MAX_HISTORY messages
flow.Add(displayMessages.Select(m => new ChatLine(m))); flow.AddRange(displayMessages.Select(m => new ChatLine(m)));
if (!IsLoaded) return; if (!IsLoaded) return;

View File

@ -199,7 +199,7 @@ namespace osu.Game.Overlays.Mods
iconsContainer.Clear(); iconsContainer.Clear();
if (Mods.Length > 1) if (Mods.Length > 1)
{ {
iconsContainer.Add(new[] iconsContainer.AddRange(new[]
{ {
backgroundIcon = new ModIcon(Mods[1]) backgroundIcon = new ModIcon(Mods[1])
{ {

View File

@ -49,7 +49,7 @@ namespace osu.Game.Overlays.Notifications
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
AddInternal(new Drawable[] AddRangeInternal(new Drawable[]
{ {
Light = new NotificationLight Light = new NotificationLight
{ {

View File

@ -69,7 +69,7 @@ namespace osu.Game.Overlays.Notifications
Left = 20, Left = 20,
}; };
AddInternal(new Drawable[] AddRangeInternal(new Drawable[]
{ {
new Container new Container
{ {

View File

@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Notifications
public SimpleNotification() public SimpleNotification()
{ {
IconContent.Add(new Drawable[] IconContent.AddRange(new Drawable[]
{ {
IconBackgound = new Box IconBackgound = new Box
{ {

View File

@ -44,7 +44,7 @@ namespace osu.Game.Overlays.Settings
const int header_size = 26; const int header_size = 26;
const int header_margin = 25; const int header_margin = 25;
const int border_size = 2; const int border_size = 2;
AddInternal(new Drawable[] AddRangeInternal(new Drawable[]
{ {
new Box new Box
{ {

View File

@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Settings
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Direction = FillDirection.Vertical; Direction = FillDirection.Vertical;
AddInternal(new Drawable[] AddRangeInternal(new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText
{ {

View File

@ -1,55 +0,0 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Objects
{
/// <summary>
/// Compares two hit objects by their start time, falling back to creation order if their start time is equal.
/// </summary>
public class HitObjectStartTimeComparer : Drawable.CreationOrderDepthComparer
{
public override int Compare(Drawable x, Drawable y)
{
var hitObjectX = x as DrawableHitObject;
var hitObjectY = y as DrawableHitObject;
// If either of the two drawables are not hit objects, fall back to the base comparer
if (hitObjectX?.HitObject == null || hitObjectY?.HitObject == null)
return base.Compare(x, y);
// Compare by start time
int i = hitObjectX.HitObject.StartTime.CompareTo(hitObjectY.HitObject.StartTime);
if (i != 0)
return i;
return base.Compare(x, y);
}
}
/// <summary>
/// Compares two hit objects by their start time, falling back to creation order if their start time is equal.
/// This will compare the two hit objects in reverse order.
/// </summary>
public class HitObjectReverseStartTimeComparer : Drawable.ReverseCreationOrderDepthComparer
{
public override int Compare(Drawable x, Drawable y)
{
var hitObjectX = x as DrawableHitObject;
var hitObjectY = y as DrawableHitObject;
// If either of the two drawables are not hit objects, fall back to the base comparer
if (hitObjectX?.HitObject == null || hitObjectY?.HitObject == null)
return base.Compare(x, y);
// Compare by start time
int i = hitObjectY.HitObject.StartTime.CompareTo(hitObjectX.HitObject.StartTime);
if (i != 0)
return i;
return base.Compare(x, y);
}
}
}

View File

@ -1,13 +1,11 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using System.Linq; using System.Linq;
using osu.Framework.Caching; using osu.Framework.Caching;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using OpenTK; using OpenTK;
using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Objects.Types;
@ -55,7 +53,22 @@ namespace osu.Game.Rulesets.Timing
/// </summary> /// </summary>
internal MultiplierControlPoint ControlPoint; internal MultiplierControlPoint ControlPoint;
protected override IComparer<Drawable> DepthComparer => new HitObjectReverseStartTimeComparer(); protected override int Compare(Drawable x, Drawable y)
{
var xHitObject = x as DrawableHitObject;
var yHitObject = y as DrawableHitObject;
// If either of the two drawables are not hit objects, fall back to the base comparer
if (xHitObject?.HitObject == null || yHitObject?.HitObject == null)
return base.Compare(x, y);
// Compare by start time
int i = yHitObject.HitObject.StartTime.CompareTo(xHitObject.HitObject.StartTime);
if (i != 0)
return i;
return base.Compare(x, y);
}
/// <summary> /// <summary>
/// Creates a new <see cref="DrawableTimingSection"/>. /// Creates a new <see cref="DrawableTimingSection"/>.

View File

@ -33,7 +33,20 @@ namespace osu.Game.Rulesets.Timing
set { visibleTimeRange.BindTo(value); } set { visibleTimeRange.BindTo(value); }
} }
protected override IComparer<Drawable> DepthComparer => new SpeedAdjustmentContainerReverseStartTimeComparer(); protected override int Compare(Drawable x, Drawable y)
{
var xSpeedAdjust = x as SpeedAdjustmentContainer;
var ySpeedAdjust = y as SpeedAdjustmentContainer;
// If either of the two drawables are not hit objects, fall back to the base comparer
if (xSpeedAdjust?.ControlPoint == null || ySpeedAdjust?.ControlPoint == null)
return CompareReverseChildID(x, y);
// Compare by start time
int i = ySpeedAdjust.ControlPoint.StartTime.CompareTo(xSpeedAdjust.ControlPoint.StartTime);
return i != 0 ? i : CompareReverseChildID(x, y);
}
/// <summary> /// <summary>
/// Hit objects that are to be re-processed on the next update. /// Hit objects that are to be re-processed on the next update.
@ -116,27 +129,5 @@ namespace osu.Game.Rulesets.Timing
/// <param name="time">The time to find the active <see cref="SpeedAdjustmentContainer"/> at.</param> /// <param name="time">The time to find the active <see cref="SpeedAdjustmentContainer"/> at.</param>
/// <returns>The <see cref="SpeedAdjustmentContainer"/> active at <paramref name="time"/>. Null if there are no speed adjustments.</returns> /// <returns>The <see cref="SpeedAdjustmentContainer"/> active at <paramref name="time"/>. Null if there are no speed adjustments.</returns>
private SpeedAdjustmentContainer adjustmentContainerAt(double time) => Children.FirstOrDefault(c => c.CanContain(time)) ?? Children.LastOrDefault(); private SpeedAdjustmentContainer adjustmentContainerAt(double time) => Children.FirstOrDefault(c => c.CanContain(time)) ?? Children.LastOrDefault();
/// <summary>
/// Compares two speed adjustment containers by their control point start time, falling back to creation order
// if their control point start time is equal. This will compare the two speed adjustment containers in reverse order.
/// </summary>
private class SpeedAdjustmentContainerReverseStartTimeComparer : ReverseCreationOrderDepthComparer
{
public override int Compare(Drawable x, Drawable y)
{
var speedAdjustmentX = x as SpeedAdjustmentContainer;
var speedAdjustmentY = y as SpeedAdjustmentContainer;
// If either of the two drawables are not hit objects, fall back to the base comparer
if (speedAdjustmentX?.ControlPoint == null || speedAdjustmentY?.ControlPoint == null)
return base.Compare(x, y);
// Compare by start time
int i = speedAdjustmentY.ControlPoint.StartTime.CompareTo(speedAdjustmentX.ControlPoint.StartTime);
return i != 0 ? i : base.Compare(x, y);
}
}
} }
} }

View File

@ -114,8 +114,8 @@ namespace osu.Game.Screens.Menu
buttonsTopLevel.Add(new Button(@"osu!direct", string.Empty, FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), () => OnDirect?.Invoke(), 0, Key.D)); buttonsTopLevel.Add(new Button(@"osu!direct", string.Empty, FontAwesome.fa_osu_chevron_down_o, new Color4(165, 204, 0, 255), () => OnDirect?.Invoke(), 0, Key.D));
buttonsTopLevel.Add(new Button(@"exit", string.Empty, FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), onExit, 0, Key.Q)); buttonsTopLevel.Add(new Button(@"exit", string.Empty, FontAwesome.fa_osu_cross_o, new Color4(238, 51, 153, 255), onExit, 0, Key.Q));
buttonFlow.Add(buttonsPlay); buttonFlow.AddRange(buttonsPlay);
buttonFlow.Add(buttonsTopLevel); buttonFlow.AddRange(buttonsTopLevel);
} }
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
@ -213,88 +213,89 @@ namespace osu.Game.Screens.Menu
backButton.ContractStyle = 0; backButton.ContractStyle = 0;
settingsButton.ContractStyle = 0; settingsButton.ContractStyle = 0;
switch (state) bool fromInitial = lastState == MenuState.Initial;
if (state == MenuState.TopLevel)
buttonArea.Flush(true);
using (buttonArea.BeginDelayedSequence(fromInitial ? 150 : 0, true))
{ {
case MenuState.Exit: switch (state)
case MenuState.Initial: {
toolbar?.Hide(); case MenuState.Exit:
case MenuState.Initial:
toolbar?.Hide();
buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out); buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out);
buttonArea.FadeOut(300); buttonArea.FadeOut(300);
osuLogo.Delay(150); using (osuLogo.BeginDelayedSequence(150))
osuLogo.MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo); {
osuLogo.ScaleTo(1, 800, EasingTypes.OutExpo); osuLogo.MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo);
osuLogo.ScaleTo(1, 800, EasingTypes.OutExpo);
}
foreach (Button b in buttonsTopLevel) foreach (Button b in buttonsTopLevel)
b.State = ButtonState.Contracted; b.State = ButtonState.Contracted;
foreach (Button b in buttonsPlay) foreach (Button b in buttonsPlay)
b.State = ButtonState.Contracted; b.State = ButtonState.Contracted;
if (state == MenuState.Exit) if (state == MenuState.Exit)
{ {
osuLogo.RotateTo(20, EXIT_DELAY * 1.5f); osuLogo.RotateTo(20, EXIT_DELAY * 1.5f);
osuLogo.FadeOut(EXIT_DELAY); osuLogo.FadeOut(EXIT_DELAY);
} }
else if (lastState == MenuState.TopLevel) else if (lastState == MenuState.TopLevel)
sampleBack?.Play(); sampleBack?.Play();
break; break;
case MenuState.TopLevel: case MenuState.TopLevel:
buttonArea.Flush(true); buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out);
buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out); osuLogo.ClearTransforms();
osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In);
osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In); buttonArea.FadeIn(300);
osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
buttonArea.FadeIn(300); if (fromInitial && osuLogo.Scale.X > 0.5f)
if (lastState == MenuState.Initial)
{
buttonArea.Delay(150, true);
if (osuLogo.Scale.X > 0.5f)
using (osuLogo.BeginDelayedSequence(200, true)) using (osuLogo.BeginDelayedSequence(200, true))
osuLogo.Impact(); osuLogo.Impact();
}
Scheduler.AddDelayed(() => toolbar?.Show(), 150); Scheduler.AddDelayed(() => toolbar?.Show(), 150);
foreach (Button b in buttonsTopLevel) foreach (Button b in buttonsTopLevel)
b.State = ButtonState.Expanded; b.State = ButtonState.Expanded;
foreach (Button b in buttonsPlay) foreach (Button b in buttonsPlay)
b.State = ButtonState.Contracted; b.State = ButtonState.Contracted;
break; break;
case MenuState.Play: case MenuState.Play:
foreach (Button b in buttonsTopLevel) foreach (Button b in buttonsTopLevel)
b.State = ButtonState.Exploded; b.State = ButtonState.Exploded;
foreach (Button b in buttonsPlay) foreach (Button b in buttonsPlay)
b.State = ButtonState.Expanded; b.State = ButtonState.Expanded;
break; break;
case MenuState.EnteringMode: case MenuState.EnteringMode:
buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, EasingTypes.InSine); buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, EasingTypes.InSine);
buttonsTopLevel.ForEach(b => b.ContractStyle = 1); buttonsTopLevel.ForEach(b => b.ContractStyle = 1);
buttonsPlay.ForEach(b => b.ContractStyle = 1); buttonsPlay.ForEach(b => b.ContractStyle = 1);
backButton.ContractStyle = 1; backButton.ContractStyle = 1;
settingsButton.ContractStyle = 1; settingsButton.ContractStyle = 1;
foreach (Button b in buttonsTopLevel) foreach (Button b in buttonsTopLevel)
b.State = ButtonState.Contracted; b.State = ButtonState.Contracted;
foreach (Button b in buttonsPlay) foreach (Button b in buttonsPlay)
b.State = ButtonState.Contracted; b.State = ButtonState.Contracted;
break; break;
}
backButton.State = state == MenuState.Play ? ButtonState.Expanded : ButtonState.Contracted;
settingsButton.State = state == MenuState.TopLevel ? ButtonState.Expanded : ButtonState.Contracted;
} }
backButton.State = state == MenuState.Play ? ButtonState.Expanded : ButtonState.Contracted;
settingsButton.State = state == MenuState.TopLevel ? ButtonState.Expanded : ButtonState.Contracted;
if (lastState == MenuState.Initial)
buttonArea.DelayReset();
} }
} }

View File

@ -20,7 +20,7 @@ namespace osu.Game.Screens.Menu
/// </summary> /// </summary>
public Drawable CentreTarget; public Drawable CentreTarget;
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer(); protected override int Compare(Drawable x, Drawable y) => CompareReverseChildID(x, y);
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse(); protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();

View File

@ -27,7 +27,7 @@ namespace osu.Game.Screens.Play.HUD
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
iconsContainer = new ReverseDepthFillFlowContainer<ModIcon> iconsContainer = new ReverseChildIDFillFlowContainer<ModIcon>
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,

View File

@ -20,15 +20,15 @@ namespace osu.Game.Screens.Play
private SpriteText countSpriteText; private SpriteText countSpriteText;
public bool IsCounting { get; set; } public bool IsCounting { get; set; }
private int count; private int countPresses;
public int Count public int CountPresses
{ {
get { return count; } get { return countPresses; }
private set private set
{ {
if (count != value) if (countPresses != value)
{ {
count = value; countPresses = value;
countSpriteText.Text = value.ToString(@"#,0"); countSpriteText.Text = value.ToString(@"#,0");
} }
} }
@ -45,7 +45,7 @@ namespace osu.Game.Screens.Play
isLit = value; isLit = value;
updateGlowSprite(value); updateGlowSprite(value);
if (value && IsCounting) if (value && IsCounting)
Count++; CountPresses++;
} }
} }
} }
@ -98,7 +98,7 @@ namespace osu.Game.Screens.Play
}, },
countSpriteText = new OsuSpriteText countSpriteText = new OsuSpriteText
{ {
Text = Count.ToString(@"#,0"), Text = CountPresses.ToString(@"#,0"),
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
RelativePositionAxes = Axes.Both, RelativePositionAxes = Axes.Both,
@ -128,6 +128,6 @@ namespace osu.Game.Screens.Play
} }
} }
public void ResetCount() => Count = 0; public void ResetCount() => CountPresses = 0;
} }
} }

View File

@ -200,7 +200,7 @@ namespace osu.Game.Screens.Play
scoreProcessor = HitRenderer.CreateScoreProcessor(); scoreProcessor = HitRenderer.CreateScoreProcessor();
hudOverlay.KeyCounter.Add(rulesetInstance.CreateGameplayKeys()); hudOverlay.KeyCounter.AddRange(rulesetInstance.CreateGameplayKeys());
hudOverlay.BindProcessor(scoreProcessor); hudOverlay.BindProcessor(scoreProcessor);
hudOverlay.BindHitRenderer(HitRenderer); hudOverlay.BindHitRenderer(HitRenderer);

View File

@ -40,7 +40,7 @@ namespace osu.Game.Screens.Ranking
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
AddInternal(new Drawable[] AddRangeInternal(new Drawable[]
{ {
fill = new Box fill = new Box
{ {

View File

@ -12,7 +12,6 @@ using osu.Game.Beatmaps.Drawables;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Framework.Input; using osu.Framework.Input;
using OpenTK.Input; using OpenTK.Input;
using System.Collections;
using osu.Framework.MathUtils; using osu.Framework.MathUtils;
using System.Diagnostics; using System.Diagnostics;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -22,7 +21,7 @@ using osu.Framework.Configuration;
namespace osu.Game.Screens.Select namespace osu.Game.Screens.Select
{ {
internal class BeatmapCarousel : ScrollContainer, IEnumerable<BeatmapGroup> internal class BeatmapCarousel : ScrollContainer
{ {
public BeatmapInfo SelectedBeatmap => selectedPanel?.Beatmap; public BeatmapInfo SelectedBeatmap => selectedPanel?.Beatmap;
@ -265,10 +264,6 @@ namespace osu.Game.Screens.Select
perform(); perform();
} }
public IEnumerator<BeatmapGroup> GetEnumerator() => groups.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
private BeatmapGroup createGroup(BeatmapSetInfo beatmapSet) private BeatmapGroup createGroup(BeatmapSetInfo beatmapSet)
{ {
foreach (var b in beatmapSet.Beatmaps) foreach (var b in beatmapSet.Beatmaps)
@ -307,7 +302,7 @@ namespace osu.Game.Screens.Select
panels.Remove(p); panels.Remove(p);
scrollableContent.Remove(group.Header); scrollableContent.Remove(group.Header);
scrollableContent.Remove(group.BeatmapPanels); scrollableContent.RemoveRange(group.BeatmapPanels);
if (selectedGroup == group) if (selectedGroup == group)
SelectNext(); SelectNext();

View File

@ -33,7 +33,7 @@ namespace osu.Game.Screens.Select
public BeatmapDetailArea() public BeatmapDetailArea()
{ {
AddInternal(new Drawable[] AddRangeInternal(new Drawable[]
{ {
new BeatmapDetailAreaTabControl new BeatmapDetailAreaTabControl
{ {
@ -61,7 +61,7 @@ namespace osu.Game.Screens.Select
}, },
}); });
Add(new Drawable[] AddRange(new Drawable[]
{ {
Details = new BeatmapDetails Details = new BeatmapDetails
{ {

View File

@ -70,7 +70,7 @@ namespace osu.Game.Screens.Select.Options
Scale = new Vector2(1, 0), Scale = new Vector2(1, 0),
Colour = Color4.Black.Opacity(0.5f), Colour = Color4.Black.Opacity(0.5f),
}, },
buttonsContainer = new ReverseDepthFillFlowContainer<BeatmapOptionsButton> buttonsContainer = new ReverseChildIDFillFlowContainer<BeatmapOptionsButton>
{ {
Height = height, Height = height,
RelativePositionAxes = Axes.X, RelativePositionAxes = Axes.X,

View File

@ -190,7 +190,6 @@
<Compile Include="Rulesets\Objects\Drawables\IScrollingHitObject.cs" /> <Compile Include="Rulesets\Objects\Drawables\IScrollingHitObject.cs" />
<Compile Include="Rulesets\Judgements\Judgement.cs" /> <Compile Include="Rulesets\Judgements\Judgement.cs" />
<Compile Include="Rulesets\Objects\HitObjectParser.cs" /> <Compile Include="Rulesets\Objects\HitObjectParser.cs" />
<Compile Include="Rulesets\Objects\HitObjectStartTimeComparer.cs" />
<Compile Include="Rulesets\Objects\Types\IHasCombo.cs" /> <Compile Include="Rulesets\Objects\Types\IHasCombo.cs" />
<Compile Include="Rulesets\Objects\Types\IHasEndTime.cs" /> <Compile Include="Rulesets\Objects\Types\IHasEndTime.cs" />
<Compile Include="Rulesets\Objects\Types\IHasDistance.cs" /> <Compile Include="Rulesets\Objects\Types\IHasDistance.cs" />
@ -475,7 +474,7 @@
<Compile Include="Overlays\Direct\DirectGridPanel.cs" /> <Compile Include="Overlays\Direct\DirectGridPanel.cs" />
<Compile Include="Overlays\Direct\DirectListPanel.cs" /> <Compile Include="Overlays\Direct\DirectListPanel.cs" />
<Compile Include="Database\BeatmapOnlineInfo.cs" /> <Compile Include="Database\BeatmapOnlineInfo.cs" />
<Compile Include="Graphics\Containers\ReverseDepthFillFlowContainer.cs" /> <Compile Include="Graphics\Containers\ReverseChildIDFillFlowContainer.cs" />
<Compile Include="Database\RankStatus.cs" /> <Compile Include="Database\RankStatus.cs" />
<Compile Include="Database\BeatmapSetOnlineInfo.cs" /> <Compile Include="Database\BeatmapSetOnlineInfo.cs" />
<Compile Include="Online\API\Requests\GetBeatmapSetsRequest.cs" /> <Compile Include="Online\API\Requests\GetBeatmapSetsRequest.cs" />