Merge remote-tracking branch 'upstream/master' into profile

# Conflicts:
#	osu.Game/Graphics/Containers/SectionsContainer.cs
This commit is contained in:
Dean Herbert
2017-07-13 13:44:21 +09:00
59 changed files with 590 additions and 360 deletions

View File

@ -8,9 +8,10 @@ using osu.Framework.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();
}
}

View File

@ -85,6 +85,7 @@ namespace osu.Game.Graphics.Containers
if (value == null) return;
headerBackgroundContainer.Add(headerBackground);
lastKnownScroll = float.NaN;
}
}

View File

@ -58,7 +58,7 @@ namespace osu.Game.Graphics.UserInterface
Direction = Direction,
});
//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.CornerRadius = 5;
Add(new Drawable[]
AddRange(new Drawable[]
{
new Triangles
{

View File

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

View File

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