1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Fix formatting of colour getter

This commit is contained in:
Dean Herbert 2021-04-12 15:30:33 +09:00
parent 257acf9cd8
commit 3551322f1d
2 changed files with 21 additions and 9 deletions

View File

@ -66,16 +66,28 @@ namespace osu.Game.Rulesets.Edit.Checks.Components
/// <summary>
/// Returns the colour corresponding to the type of this issue.
/// </summary>
public Colour4 TypeColour()
public Colour4 Colour
{
return Type switch
get
{
IssueType.Problem => problem_red,
IssueType.Warning => warning_yellow,
IssueType.Negligible => negligible_green,
IssueType.Error => error_gray,
_ => Color4.White
};
switch (Type)
{
case IssueType.Problem:
return problem_red;
case IssueType.Warning:
return warning_yellow;
case IssueType.Negligible:
return negligible_green;
case IssueType.Error:
return error_gray;
default:
return Color4.White;
}
}
}
}
}

View File

@ -97,7 +97,7 @@ namespace osu.Game.Screens.Edit.Verify
Text = issue.Template.Type.ToString(),
Font = OsuFont.GetFont(size: text_size, weight: FontWeight.Bold),
Margin = new MarginPadding { Right = 10 },
Colour = issue.Template.TypeColour()
Colour = issue.Template.Colour
},
new OsuSpriteText
{