1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 08:12:56 +08:00

Merge branch 'master' into fix-ef-hiding

This commit is contained in:
Dan Balasescu 2017-10-20 17:22:50 +09:00 committed by GitHub
commit a9b9d82b74
2 changed files with 39 additions and 41 deletions

View File

@ -25,10 +25,7 @@ namespace osu.Game.Overlays.Notifications
public float Progress public float Progress
{ {
get { return progressBar.Progress; } get { return progressBar.Progress; }
set set { Schedule(() => progressBar.Progress = value); }
{
progressBar.Progress = value;
}
} }
protected override void LoadComplete() protected override void LoadComplete()
@ -44,41 +41,44 @@ namespace osu.Game.Overlays.Notifications
get { return state; } get { return state; }
set set
{ {
bool stateChanged = state != value; Schedule(() =>
state = value;
if (IsLoaded)
{ {
switch (state) bool stateChanged = state != value;
{ state = value;
case ProgressNotificationState.Queued:
Light.Colour = colourQueued;
Light.Pulsate = false;
progressBar.Active = false;
break;
case ProgressNotificationState.Active:
Light.Colour = colourActive;
Light.Pulsate = true;
progressBar.Active = true;
break;
case ProgressNotificationState.Cancelled:
Light.Colour = colourCancelled;
Light.Pulsate = false;
progressBar.Active = false;
break;
}
}
if (stateChanged) if (IsLoaded)
{
switch (state)
{ {
case ProgressNotificationState.Completed: switch (state)
NotificationContent.MoveToY(-DrawSize.Y / 2, 200, Easing.OutQuint); {
this.FadeOut(200).Finally(d => Completed()); case ProgressNotificationState.Queued:
break; Light.Colour = colourQueued;
Light.Pulsate = false;
progressBar.Active = false;
break;
case ProgressNotificationState.Active:
Light.Colour = colourActive;
Light.Pulsate = true;
progressBar.Active = true;
break;
case ProgressNotificationState.Cancelled:
Light.Colour = colourCancelled;
Light.Pulsate = false;
progressBar.Active = false;
break;
}
} }
}
if (stateChanged)
{
switch (state)
{
case ProgressNotificationState.Completed:
NotificationContent.MoveToY(-DrawSize.Y / 2, 200, Easing.OutQuint);
this.FadeOut(200).Finally(d => Completed());
break;
}
}
});
} }
} }
@ -232,4 +232,4 @@ namespace osu.Game.Overlays.Notifications
Completed, Completed,
Cancelled Cancelled
} }
} }

View File

@ -66,13 +66,11 @@ namespace osu.Game.Tests.Visual
progressingNotifications.RemoveAll(n => n.State == ProgressNotificationState.Completed); progressingNotifications.RemoveAll(n => n.State == ProgressNotificationState.Completed);
while (progressingNotifications.Count(n => n.State == ProgressNotificationState.Active) < 3) if (progressingNotifications.Count(n => n.State == ProgressNotificationState.Active) < 3)
{ {
var p = progressingNotifications.FirstOrDefault(n => n.IsAlive && n.State == ProgressNotificationState.Queued); var p = progressingNotifications.FirstOrDefault(n => n.IsAlive && n.State == ProgressNotificationState.Queued);
if (p == null) if (p != null)
break; p.State = ProgressNotificationState.Active;
p.State = ProgressNotificationState.Active;
} }
foreach (var n in progressingNotifications.FindAll(n => n.State == ProgressNotificationState.Active)) foreach (var n in progressingNotifications.FindAll(n => n.State == ProgressNotificationState.Active))