Merge branch 'master' of https://github.com/ppy/osu into better-transforms

# Conflicts:
#	osu-framework
#	osu.Game/Graphics/Cursor/OsuTooltipContainer.cs
#	osu.Game/Overlays/DragBar.cs
This commit is contained in:
Thomas Müller
2017-07-18 15:16:02 +03:00
36 changed files with 1727 additions and 282 deletions

View File

@ -12,7 +12,6 @@ using System.Linq;
using osu.Framework.Timing;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Screens.Play
{
public class SongProgress : OverlayContainer
@ -50,6 +49,9 @@ namespace osu.Game.Screens.Play
info.StartTime = firstHitTime;
info.EndTime = lastHitTime;
bar.StartTime = firstHitTime;
bar.EndTime = lastHitTime;
}
}
@ -89,10 +91,7 @@ namespace osu.Game.Screens.Play
Alpha = 0,
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
SeekRequested = delegate (float position)
{
OnSeek?.Invoke(firstHitTime + position * (lastHitTime - firstHitTime));
},
OnSeek = position => OnSeek?.Invoke(position),
},
};
}
@ -144,11 +143,12 @@ namespace osu.Game.Screens.Play
if (objects == null)
return;
double progress = ((audioClock?.CurrentTime ?? Time.Current) - firstHitTime) / (lastHitTime - firstHitTime);
double position = audioClock?.CurrentTime ?? Time.Current;
double progress = (position - firstHitTime) / (lastHitTime - firstHitTime);
if (progress < 1)
{
bar.UpdatePosition((float)progress);
bar.CurrentTime = position;
graph.Progress = (int)(graph.ColumnCount * progress);
}
}