1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-16 04:32:57 +08:00

Merge branch 'master' into generic-interface

This commit is contained in:
Huo Yaoyuan 2017-05-18 02:40:05 +08:00
commit 65ff66682a
8 changed files with 35 additions and 31 deletions

@ -1 +1 @@
Subproject commit 67f39580365f7d0a42f8788eae2b60881dde1c67 Subproject commit f8e5b10f6883af83ffbc431b03fe4ee3e89797a6

View File

@ -146,7 +146,7 @@ namespace osu.Game
{ {
base.LoadComplete(); base.LoadComplete();
AddInternal(ratioContainer = new RatioAdjust base.Content.Add(ratioContainer = new RatioAdjust
{ {
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -206,18 +206,12 @@ namespace osu.Game.Overlays
private long? lastMessageId; private long? lastMessageId;
private List<Channel> careChannels; private readonly List<Channel> careChannels = new List<Channel>();
private readonly List<DrawableChannel> loadedChannels = new List<DrawableChannel>(); private readonly List<DrawableChannel> loadedChannels = new List<DrawableChannel>();
private void initializeChannels() private void initializeChannels()
{ {
currentChannelContainer.Clear();
loadedChannels.Clear();
careChannels = new List<Channel>();
SpriteText loading; SpriteText loading;
Add(loading = new OsuSpriteText Add(loading = new OsuSpriteText
{ {
@ -232,8 +226,6 @@ namespace osu.Game.Overlays
ListChannelsRequest req = new ListChannelsRequest(); ListChannelsRequest req = new ListChannelsRequest();
req.Success += delegate (List<Channel> channels) req.Success += delegate (List<Channel> channels)
{ {
Debug.Assert(careChannels.Count == 0);
Scheduler.Add(delegate Scheduler.Add(delegate
{ {
loading.FadeOut(100); loading.FadeOut(100);

View File

@ -38,7 +38,7 @@ namespace osu.Game.Screens.Play
public Action RestartRequested; public Action RestartRequested;
public bool IsPaused => !decoupledClock.IsRunning; public bool IsPaused { get; private set; }
internal override bool AllowRulesetChange => false; internal override bool AllowRulesetChange => false;
@ -264,19 +264,18 @@ namespace osu.Game.Screens.Play
{ {
if (!canPause && !force) return; if (!canPause && !force) return;
// the actual pausing is potentially happening on a different thread. if (IsPaused) return;
// we want to wait for the source clock to stop so we can be sure all components are in a stable state.
if (!IsPaused)
{
decoupledClock.Stop();
Schedule(() => Pause(force)); // stop the decoupled clock (stops the audio eventually)
return; decoupledClock.Stop();
}
// stop processing updatess on the offset clock (instantly freezes time for all our components)
offsetClock.ProcessSourceClockFrames = false;
IsPaused = true;
// we need to do a final check after all of our children have processed up to the paused clock time. // we need to do a final check after all of our children have processed up to the paused clock time.
// this is to cover cases where, for instance, the player fails in the last processed frame (which would change canPause). // this is to cover cases where, for instance, the player fails in the current processing frame.
// as the scheduler runs before children updates, let's schedule for the next frame.
Schedule(() => Schedule(() =>
{ {
if (!canPause) return; if (!canPause) return;
@ -291,6 +290,11 @@ namespace osu.Game.Screens.Play
public void Resume() public void Resume()
{ {
if (!IsPaused) return;
IsPaused = false;
offsetClock.ProcessSourceClockFrames = true;
lastPauseActionTime = Time.Current; lastPauseActionTime = Time.Current;
hudOverlay.KeyCounter.IsCounting = true; hudOverlay.KeyCounter.IsCounting = true;
hudOverlay.Progress.Hide(); hudOverlay.Progress.Hide();

View File

@ -107,6 +107,8 @@ namespace osu.Game.Screens.Select
return; return;
} }
if (beatmap == SelectedBeatmap) return;
foreach (BeatmapGroup group in groups) foreach (BeatmapGroup group in groups)
{ {
var panel = group.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(beatmap)); var panel = group.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(beatmap));
@ -204,7 +206,7 @@ namespace osu.Game.Screens.Select
if (selectedGroup == null || selectedGroup.State == BeatmapGroupState.Hidden) if (selectedGroup == null || selectedGroup.State == BeatmapGroupState.Hidden)
SelectNext(); SelectNext();
else else
selectGroup(selectedGroup); selectGroup(selectedGroup, selectedPanel);
}; };
filterTask?.Cancel(); filterTask?.Cancel();
@ -339,6 +341,8 @@ namespace osu.Game.Screens.Select
selectedGroup.State = BeatmapGroupState.Collapsed; selectedGroup.State = BeatmapGroupState.Collapsed;
group.State = BeatmapGroupState.Expanded; group.State = BeatmapGroupState.Expanded;
group.SelectedPanel = panel;
panel.State = PanelSelectedState.Selected; panel.State = PanelSelectedState.Selected;
if (selectedPanel == panel) return; if (selectedPanel == panel) return;

View File

@ -49,6 +49,8 @@ namespace osu.Game.Screens.Select
get { return beatmap; } get { return beatmap; }
set set
{ {
if (beatmap == value) return;
beatmap = value; beatmap = value;
pendingBeatmapSwitch?.Cancel(); pendingBeatmapSwitch?.Cancel();

View File

@ -100,6 +100,8 @@ namespace osu.Game.Screens.Select.Leaderboards
get { return beatmap; } get { return beatmap; }
set set
{ {
if (beatmap == value) return;
beatmap = value; beatmap = value;
Scores = null; Scores = null;

View File

@ -313,15 +313,15 @@ namespace osu.Game.Screens.Select
{ {
bool beatmapSetChange = false; bool beatmapSetChange = false;
if (!beatmap.Equals(Beatmap?.BeatmapInfo)) if (beatmap.Equals(Beatmap?.BeatmapInfo))
return;
if (beatmap.BeatmapSetInfoID == selectionChangeNoBounce?.BeatmapSetInfoID)
sampleChangeDifficulty.Play();
else
{ {
if (beatmap.BeatmapSetInfoID == selectionChangeNoBounce?.BeatmapSetInfoID) sampleChangeBeatmap.Play();
sampleChangeDifficulty.Play(); beatmapSetChange = true;
else
{
sampleChangeBeatmap.Play();
beatmapSetChange = true;
}
} }
selectionChangeNoBounce = beatmap; selectionChangeNoBounce = beatmap;