use string.Empty, use base SettingDescription for [Osu/Catch]ModDifficultyAdjust

This commit is contained in:
Liam DeVoe
2020-03-22 18:49:45 -04:00
parent 4907fb8fd1
commit 63e9b2a299
7 changed files with 54 additions and 26 deletions

View File

@ -7,6 +7,7 @@ using osu.Framework.Graphics.Sprites;
using System;
using System.Collections.Generic;
using osu.Game.Configuration;
using System.Linq;
namespace osu.Game.Rulesets.Mods
{
@ -56,13 +57,14 @@ namespace osu.Game.Rulesets.Mods
{
get
{
string drainRate = DrainRate.IsDefault ? "" : $"HP {DrainRate.Value}";
string overallDifficulty = OverallDifficulty.IsDefault ? "" : $"OD {OverallDifficulty.Value}";
string drainRate = DrainRate.IsDefault ? string.Empty : $"HP {DrainRate.Value}";
string overallDifficulty = OverallDifficulty.IsDefault ? string.Empty : $"OD {OverallDifficulty.Value}";
string[] settings = { drainRate, overallDifficulty };
// filter out empty strings so we don't have orphaned commas
settings = Array.FindAll(settings, s => !string.IsNullOrEmpty(s));
return string.Join(", ", settings);
return string.Join(", ", new[]
{
drainRate,
overallDifficulty
}.Where(s => !string.IsNullOrEmpty(s)));
}
}