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

Add max performance beatmap attribute text

This commit is contained in:
Dan Balasescu 2024-10-17 19:43:34 +09:00
parent bfcf6693ca
commit 6749768b9e
No known key found for this signature in database
2 changed files with 19 additions and 4 deletions

View File

@ -12,23 +12,28 @@ namespace osu.Game.Localisation.SkinComponents
/// <summary> /// <summary>
/// "Attribute" /// "Attribute"
/// </summary> /// </summary>
public static LocalisableString Attribute => new TranslatableString(getKey(@"attribute"), "Attribute"); public static LocalisableString Attribute => new TranslatableString(getKey(@"attribute"), @"Attribute");
/// <summary> /// <summary>
/// "The attribute to be displayed." /// "The attribute to be displayed."
/// </summary> /// </summary>
public static LocalisableString AttributeDescription => new TranslatableString(getKey(@"attribute_description"), "The attribute to be displayed."); public static LocalisableString AttributeDescription => new TranslatableString(getKey(@"attribute_description"), @"The attribute to be displayed.");
/// <summary> /// <summary>
/// "Template" /// "Template"
/// </summary> /// </summary>
public static LocalisableString Template => new TranslatableString(getKey(@"template"), "Template"); public static LocalisableString Template => new TranslatableString(getKey(@"template"), @"Template");
/// <summary> /// <summary>
/// "Supports {{Label}} and {{Value}}, but also including arbitrary attributes like {{StarRating}} (see attribute list for supported values)." /// "Supports {{Label}} and {{Value}}, but also including arbitrary attributes like {{StarRating}} (see attribute list for supported values)."
/// </summary> /// </summary>
public static LocalisableString TemplateDescription => new TranslatableString(getKey(@"template_description"), @"Supports {{Label}} and {{Value}}, but also including arbitrary attributes like {{StarRating}} (see attribute list for supported values)."); public static LocalisableString TemplateDescription => new TranslatableString(getKey(@"template_description"), @"Supports {{Label}} and {{Value}}, but also including arbitrary attributes like {{StarRating}} (see attribute list for supported values).");
private static string getKey(string key) => $"{prefix}:{key}"; /// <summary>
/// "Max PP"
/// </summary>
public static LocalisableString MaxPP => new TranslatableString(getKey(@"max_pp"), @"Max PP");
private static string getKey(string key) => $@"{prefix}:{key}";
} }
} }

View File

@ -21,6 +21,7 @@ using osu.Game.Localisation;
using osu.Game.Localisation.SkinComponents; using osu.Game.Localisation.SkinComponents;
using osu.Game.Resources.Localisation.Web; using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Utils; using osu.Game.Utils;
@ -167,6 +168,9 @@ namespace osu.Game.Skinning.Components
case BeatmapAttribute.BPM: case BeatmapAttribute.BPM:
return BeatmapsetsStrings.ShowStatsBpm; return BeatmapsetsStrings.ShowStatsBpm;
case BeatmapAttribute.MaxPP:
return BeatmapAttributeTextStrings.MaxPP;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }
@ -217,6 +221,11 @@ namespace osu.Game.Skinning.Components
? starDifficulty.Stars.ToLocalisableString(@"F2") ? starDifficulty.Stars.ToLocalisableString(@"F2")
: @"..."; : @"...";
case BeatmapAttribute.MaxPP:
return difficultyBindable?.Value?.PerformanceAttributes is PerformanceAttributes attributes
? attributes.Total.ToLocalisableString(@"F2")
: @"...";
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }
@ -269,5 +278,6 @@ namespace osu.Game.Skinning.Components
RankedStatus, RankedStatus,
BPM, BPM,
Source, Source,
MaxPP
} }
} }