Merge branch 'master' into use-has-flags

This commit is contained in:
Dean Herbert 2018-07-17 03:50:40 +09:00 committed by GitHub
commit 84c13174d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 47 additions and 11 deletions

View File

@ -148,7 +148,7 @@ namespace osu.Game.Beatmaps
return;
}
var downloadNotification = new ProgressNotification
var downloadNotification = new DownloadNotification
{
CompletionText = $"Imported {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}!",
Text = $"Downloading {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}",
@ -460,5 +460,21 @@ namespace osu.Game.Beatmaps
protected override Texture GetBackground() => null;
protected override Track GetTrack() => null;
}
private class DownloadNotification : ProgressNotification
{
public override bool IsImportant => false;
protected override Notification CreateCompletionNotification() => new SilencedProgressCompletionNotification
{
Activated = CompletionClickAction,
Text = CompletionText
};
private class SilencedProgressCompletionNotification : ProgressCompletionNotification
{
public override bool IsImportant => false;
}
}
}
}

View File

@ -62,28 +62,30 @@ namespace osu.Game.Beatmaps.Formats
protected override void ParseLine(Beatmap beatmap, Section section, string line)
{
var strippedLine = StripComments(line);
switch (section)
{
case Section.General:
handleGeneral(line);
handleGeneral(strippedLine);
return;
case Section.Editor:
handleEditor(line);
handleEditor(strippedLine);
return;
case Section.Metadata:
handleMetadata(line);
return;
case Section.Difficulty:
handleDifficulty(line);
handleDifficulty(strippedLine);
return;
case Section.Events:
handleEvent(line);
handleEvent(strippedLine);
return;
case Section.TimingPoints:
handleTimingPoint(line);
handleTimingPoint(strippedLine);
return;
case Section.HitObjects:
handleHitObject(line);
handleHitObject(strippedLine);
return;
}

View File

@ -57,6 +57,8 @@ namespace osu.Game.Beatmaps.Formats
protected virtual void ParseLine(T output, Section section, string line)
{
line = StripComments(line);
switch (section)
{
case Section.Colours:
@ -65,6 +67,14 @@ namespace osu.Game.Beatmaps.Formats
}
}
protected string StripComments(string line)
{
var index = line.IndexOf("//", StringComparison.Ordinal);
if (index > 0)
return line.Substring(0, index);
return line;
}
private bool hasComboColours;
private void handleColours(T output, string line)

View File

@ -42,6 +42,8 @@ namespace osu.Game.Beatmaps.Formats
protected override void ParseLine(Storyboard storyboard, Section section, string line)
{
line = StripComments(line);
switch (section)
{
case Section.Events:

View File

@ -128,7 +128,8 @@ namespace osu.Game.Overlays
var section = sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => accept.IsAssignableFrom(ourType)));
section?.Add(notification, notification.DisplayOnTop ? -runningDepth : runningDepth);
State = Visibility.Visible;
if (notification.IsImportant)
State = Visibility.Visible;
updateCounts();
});

View File

@ -23,6 +23,11 @@ namespace osu.Game.Overlays.Notifications
/// </summary>
public event Action Closed;
/// <summary>
/// Whether this notification should forcefully display itself.
/// </summary>
public virtual bool IsImportant => true;
/// <summary>
/// Run on user activating the notification. Return true to close.
/// </summary>

View File

@ -219,9 +219,7 @@ namespace osu.Game.Screens.Play
{
if (!IsCurrentScreen) return;
//we want to hide the hitrenderer immediately (looks better).
//we may be able to remove this once the mouse cursor trail is improved.
RulesetContainer?.Hide();
pauseContainer.Hide();
Restart();
},
}

View File

@ -14,6 +14,8 @@ namespace osu.Game.Skinning
protected override void ParseLine(SkinConfiguration skin, Section section, string line)
{
line = StripComments(line);
switch (section)
{
case Section.General: