Merge branch 'master' into fix-mod-select

This commit is contained in:
Dan Balasescu 2018-02-28 21:52:07 +09:00 committed by GitHub
commit b898226a91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 9 deletions

@ -1 +1 @@
Subproject commit 9a773e62eb246206b918ba4fccf9f2507aaa4595
Subproject commit 500a791577979669e47eece699d5bd8b9068ee4b

View File

@ -4,6 +4,7 @@
using System;
using System.IO;
using System.Linq;
using System.Runtime;
using osu.Framework;
using osu.Framework.Platform;
using osu.Game.IPC;
@ -15,6 +16,9 @@ namespace osu.Desktop
[STAThread]
public static int Main(string[] args)
{
if (!RuntimeInfo.IsMono)
useMulticoreJit();
// Back up the cwd before DesktopGameHost changes it
var cwd = Environment.CurrentDirectory;
@ -44,8 +48,16 @@ namespace osu.Desktop
break;
}
}
return 0;
}
}
private static void useMulticoreJit()
{
var directory = Directory.CreateDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Profiles"));
ProfileOptimization.SetProfileRoot(directory.FullName);
ProfileOptimization.StartProfile("Startup.Profile");
}
}
}

View File

@ -207,6 +207,12 @@ namespace osu.Game.Tests.Visual
checkVisibleItemCount(true, 0);
AddAssert("Selection is null", () => currentSelection == null);
advanceSelection(true);
AddAssert("Selection is null", () => currentSelection == null);
advanceSelection(false);
AddAssert("Selection is null", () => currentSelection == null);
AddStep("Un-filter", () => carousel.Filter(new FilterCriteria(), false));
AddAssert("Selection is non-null", () => currentSelection != null);

View File

@ -8,6 +8,7 @@ using OpenTK;
using osu.Framework.Allocation;
using osu.Game.Configuration;
using osu.Framework.Configuration;
using osu.Framework.MathUtils;
namespace osu.Game.Graphics.Containers
{
@ -61,8 +62,9 @@ namespace osu.Game.Graphics.Containers
if (parallaxEnabled)
{
Vector2 offset = input.CurrentState.Mouse == null ? Vector2.Zero : ToLocalSpace(input.CurrentState.Mouse.NativeState.Position) - DrawSize / 2;
content.MoveTo(offset * ParallaxAmount, firstUpdate ? 0 : 1000, Easing.OutQuint);
Vector2 offset = (input.CurrentState.Mouse == null ? Vector2.Zero : ToLocalSpace(input.CurrentState.Mouse.NativeState.Position) - DrawSize / 2) * ParallaxAmount;
content.Position = Interpolation.ValueAt(Clock.ElapsedFrameTime, content.Position, offset, 0, 1000, Easing.OutQuint);
content.Scale = new Vector2(1 + ParallaxAmount);
}

View File

@ -109,7 +109,7 @@ namespace osu.Game.Screens.Play
{
var xFill = value * UsableWidth;
fill.Width = xFill;
handleBase.MoveToX(xFill);
handleBase.X = xFill;
}
protected override void OnUserChange() => OnSeek?.Invoke(Current);

View File

@ -192,7 +192,9 @@ namespace osu.Game.Screens.Select
/// <param name="skipDifficulties">Whether to skip individual difficulties and only increment over full groups.</param>
public void SelectNext(int direction = 1, bool skipDifficulties = true)
{
if (!Items.Any())
var visibleItems = Items.Where(s => !s.Item.Filtered).ToList();
if (!visibleItems.Any())
return;
DrawableCarouselItem drawable = null;
@ -202,15 +204,15 @@ namespace osu.Game.Screens.Select
// we can fix this by changing this method to not reference drawables / Items in the first place.
return;
int originalIndex = Items.IndexOf(drawable);
int originalIndex = visibleItems.IndexOf(drawable);
int currentIndex = originalIndex;
// local function to increment the index in the required direction, wrapping over extremities.
int incrementIndex() => currentIndex = (currentIndex + direction + Items.Count) % Items.Count;
int incrementIndex() => currentIndex = (currentIndex + direction + visibleItems.Count) % visibleItems.Count;
while (incrementIndex() != originalIndex)
{
var item = Items[currentIndex].Item;
var item = visibleItems[currentIndex].Item;
if (item.Filtered || item.State == CarouselItemState.Selected) continue;
@ -407,12 +409,14 @@ namespace osu.Game.Screens.Select
continue;
}
float depth = i + (item is DrawableCarouselBeatmapSet ? -Items.Count : 0);
// Only add if we're not already part of the content.
if (!scrollableContent.Contains(item))
{
// Makes sure headers are always _below_ items,
// and depth flows downward.
item.Depth = i + (item is DrawableCarouselBeatmapSet ? -Items.Count : 0);
item.Depth = depth;
switch (item.LoadState)
{
@ -426,6 +430,10 @@ namespace osu.Game.Screens.Select
break;
}
}
else
{
scrollableContent.ChangeChildDepth(item, depth);
}
}
// this is not actually useful right now, but once we have groups may well be.