mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge branch 'master' into master
This commit is contained in:
@ -57,7 +57,7 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
// Depending on beatSnapLength, we may snap to a beat that is beyond timingPoint's end time, but we want to instead snap to
|
||||
// the next timing point's start time
|
||||
var nextTimingPoint = ControlPointInfo.TimingPoints.Find(t => t.Time > timingPoint.Time);
|
||||
var nextTimingPoint = ControlPointInfo.TimingPoints.FirstOrDefault(t => t.Time > timingPoint.Time);
|
||||
if (position > nextTimingPoint?.Time)
|
||||
position = nextTimingPoint.Time;
|
||||
|
||||
@ -85,12 +85,8 @@ namespace osu.Game.Screens.Edit
|
||||
var timingPoint = ControlPointInfo.TimingPointAt(CurrentTime);
|
||||
|
||||
if (direction < 0 && timingPoint.Time == CurrentTime)
|
||||
{
|
||||
// When going backwards and we're at the boundary of two timing points, we compute the seek distance with the timing point which we are seeking into
|
||||
int activeIndex = ControlPointInfo.TimingPoints.IndexOf(timingPoint);
|
||||
while (activeIndex > 0 && CurrentTime == timingPoint.Time)
|
||||
timingPoint = ControlPointInfo.TimingPoints[--activeIndex];
|
||||
}
|
||||
timingPoint = ControlPointInfo.TimingPointAt(CurrentTime - 1);
|
||||
|
||||
double seekAmount = timingPoint.BeatLength / beatDivisor.Value * amount;
|
||||
double seekTime = CurrentTime + seekAmount * direction;
|
||||
@ -124,7 +120,7 @@ namespace osu.Game.Screens.Edit
|
||||
if (seekTime < timingPoint.Time && timingPoint != ControlPointInfo.TimingPoints.First())
|
||||
seekTime = timingPoint.Time;
|
||||
|
||||
var nextTimingPoint = ControlPointInfo.TimingPoints.Find(t => t.Time > timingPoint.Time);
|
||||
var nextTimingPoint = ControlPointInfo.TimingPoints.FirstOrDefault(t => t.Time > timingPoint.Time);
|
||||
if (seekTime > nextTimingPoint?.Time)
|
||||
seekTime = nextTimingPoint.Time;
|
||||
|
||||
|
@ -42,6 +42,7 @@ namespace osu.Game.Screens.Menu
|
||||
public IntroSequence()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Alpha = 0;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -212,6 +212,8 @@ namespace osu.Game.Screens.Multi
|
||||
|
||||
public override bool OnExiting(IScreen next)
|
||||
{
|
||||
roomManager.PartRoom();
|
||||
|
||||
if (screenStack.CurrentScreen != null && !(screenStack.CurrentScreen is LoungeSubScreen))
|
||||
{
|
||||
screenStack.Exit();
|
||||
|
@ -87,9 +87,8 @@ namespace osu.Game.Screens.Multi
|
||||
public void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
|
||||
{
|
||||
currentJoinRoomRequest?.Cancel();
|
||||
currentJoinRoomRequest = null;
|
||||
|
||||
currentJoinRoomRequest = new JoinRoomRequest(room, api.LocalUser.Value);
|
||||
|
||||
currentJoinRoomRequest.Success += () =>
|
||||
{
|
||||
joinedRoom = room;
|
||||
@ -98,7 +97,8 @@ namespace osu.Game.Screens.Multi
|
||||
|
||||
currentJoinRoomRequest.Failure += exception =>
|
||||
{
|
||||
Logger.Log($"Failed to join room: {exception}", level: LogLevel.Important);
|
||||
if (!(exception is OperationCanceledException))
|
||||
Logger.Log($"Failed to join room: {exception}", level: LogLevel.Important);
|
||||
onError?.Invoke(exception.ToString());
|
||||
};
|
||||
|
||||
@ -107,6 +107,8 @@ namespace osu.Game.Screens.Multi
|
||||
|
||||
public void PartRoom()
|
||||
{
|
||||
currentJoinRoomRequest?.Cancel();
|
||||
|
||||
if (joinedRoom == null)
|
||||
return;
|
||||
|
||||
|
@ -45,8 +45,6 @@ namespace osu.Game.Screens.Play.HUD
|
||||
VisualSettings = new VisualSettings { Expanded = false }
|
||||
}
|
||||
};
|
||||
|
||||
Show();
|
||||
}
|
||||
|
||||
protected override void PopIn() => this.FadeIn(fade_duration);
|
||||
|
@ -106,6 +106,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
Show();
|
||||
|
||||
replayLoaded.ValueChanged += loaded => AllowSeeking = loaded.NewValue;
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
@ -81,12 +82,10 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
base.Filter(criteria);
|
||||
|
||||
var children = new List<CarouselItem>(InternalChildren);
|
||||
|
||||
children.ForEach(c => c.Filter(criteria));
|
||||
children.Sort((x, y) => x.CompareTo(criteria, y));
|
||||
|
||||
InternalChildren = children;
|
||||
InternalChildren.ForEach(c => c.Filter(criteria));
|
||||
// IEnumerable<T>.OrderBy() is used instead of List<T>.Sort() to ensure sorting stability
|
||||
var criteriaComparer = Comparer<CarouselItem>.Create((x, y) => x.CompareTo(criteria, y));
|
||||
InternalChildren = InternalChildren.OrderBy(c => c, criteriaComparer).ToList();
|
||||
}
|
||||
|
||||
protected virtual void ChildItemStateChanged(CarouselItem item, CarouselItemState value)
|
||||
|
Reference in New Issue
Block a user