1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 10:47:28 +08:00

change IssueTemplatePreviewTimeConflict's text

This commit is contained in:
cdwcgt 2023-01-23 15:26:28 +09:00
parent 997a1a8b02
commit 5afb733fb2
No known key found for this signature in database
GPG Key ID: 144396D01095C3A2
2 changed files with 8 additions and 4 deletions

View File

@ -67,7 +67,7 @@ namespace osu.Game.Tests.Editing.Checks
Assert.That(issues, Has.Count.EqualTo(1));
Assert.That(issues.Single().Template is CheckPreviewTime.IssueTemplatePreviewTimeConflict);
Assert.That(issues.Single().Arguments.Single().ToString() == "Test1");
Assert.That(issues.Single().Arguments.FirstOrDefault()?.ToString() == "Test1");
}
private void setNoPreviewTimeBeatmap()

View File

@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Edit.Checks
if (diff.Metadata.PreviewTime != previewTime)
{
yield return new IssueTemplatePreviewTimeConflict(this).Create(diff.DifficultyName);
yield return new IssueTemplatePreviewTimeConflict(this).Create(diff.DifficultyName, previewTime, diff.Metadata.PreviewTime);
}
}
}
@ -44,11 +44,15 @@ namespace osu.Game.Rulesets.Edit.Checks
public class IssueTemplatePreviewTimeConflict : IssueTemplate
{
public IssueTemplatePreviewTimeConflict(ICheck check)
: base(check, IssueType.Warning, "Audio preview time conflicts with {0} diff")
: base(check, IssueType.Warning, "Audio preview time {1} doesn't match \"{0}\"'s preview time {2}")
{
}
public Issue Create(string diffName) => new Issue(this, diffName);
public Issue Create(string diffName, int originalTime, int conflictTime) =>
// preview time should show (not set) when it is not set.
new Issue(this, diffName,
originalTime != -1 ? $"({originalTime:N0})" : "(not set)",
conflictTime != -1 ? $"({conflictTime:N0})" : "(not set)");
}
public class IssueTemplateHasNoPreviewTime : IssueTemplate