1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 23:00:52 +08:00

Add localisation usage to BeatmapStatistic and revert ShowDetailsMappedBy

This commit is contained in:
diquoks
2025-06-21 21:01:48 +03:00
Unverified
parent b89d38d19c
commit cad4382350
6 changed files with 85 additions and 12 deletions
@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Localisation;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Objects;
@@ -23,21 +24,21 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
{
new BeatmapStatistic
{
Name = @"Fruits",
Name = BeatmapStatisticStrings.Fruits,
Content = fruits.ToString(),
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Circles),
BarDisplayLength = fruits / (float)sum,
},
new BeatmapStatistic
{
Name = @"Juice Streams",
Name = BeatmapStatisticStrings.JuiceStreams,
Content = juiceStreams.ToString(),
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Sliders),
BarDisplayLength = juiceStreams / (float)sum,
},
new BeatmapStatistic
{
Name = @"Banana Showers",
Name = BeatmapStatisticStrings.BananaShowers,
Content = bananaShowers.ToString(),
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Spinners),
BarDisplayLength = Math.Min(bananaShowers / 10f, 1),
@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Localisation;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.UI;
@@ -42,14 +43,14 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
{
new BeatmapStatistic
{
Name = @"Notes",
Name = BeatmapStatisticStrings.Notes,
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Circles),
Content = notes.ToString(),
BarDisplayLength = notes / (float)sum,
},
new BeatmapStatistic
{
Name = @"Hold Notes",
Name = BeatmapStatisticStrings.HoldNotes,
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Sliders),
Content = holdNotes.ToString(),
BarDisplayLength = holdNotes / (float)sum,
+4 -3
View File
@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Localisation;
using osu.Game.Rulesets.Osu.Objects;
namespace osu.Game.Rulesets.Osu.Beatmaps
@@ -22,21 +23,21 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
{
new BeatmapStatistic
{
Name = "Circles",
Name = BeatmapStatisticStrings.Circles,
Content = circles.ToString(),
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Circles),
BarDisplayLength = circles / (float)sum,
},
new BeatmapStatistic
{
Name = "Sliders",
Name = BeatmapStatisticStrings.Sliders,
Content = sliders.ToString(),
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Sliders),
BarDisplayLength = sliders / (float)sum,
},
new BeatmapStatistic
{
Name = @"Spinners",
Name = BeatmapStatisticStrings.Spinners,
Content = spinners.ToString(),
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Spinners),
BarDisplayLength = Math.Min(spinners / 10f, 1),
@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Localisation;
using osu.Game.Rulesets.Taiko.Objects;
namespace osu.Game.Rulesets.Taiko.Beatmaps
@@ -22,21 +23,21 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
{
new BeatmapStatistic
{
Name = @"Hits",
Name = BeatmapStatisticStrings.Hits,
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Circles),
Content = hits.ToString(),
BarDisplayLength = hits / (float)sum,
},
new BeatmapStatistic
{
Name = @"Drumrolls",
Name = BeatmapStatisticStrings.Drumrolls,
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Sliders),
Content = drumRolls.ToString(),
BarDisplayLength = drumRolls / (float)sum,
},
new BeatmapStatistic
{
Name = @"Swells",
Name = BeatmapStatisticStrings.Swells,
CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Spinners),
Content = swells.ToString(),
BarDisplayLength = Math.Min(swells / 10f, 1),
@@ -0,0 +1,69 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Localisation;
namespace osu.Game.Localisation
{
public class BeatmapStatisticStrings
{
private const string prefix = @"osu.Game.Resources.Localisation.BeatmapStatisticStrings";
/// <summary>
/// "Circles"
/// </summary>
public static LocalisableString Circles => new TranslatableString(getKey(@"circles"), @"Circles");
/// <summary>
/// "Sliders"
/// </summary>
public static LocalisableString Sliders => new TranslatableString(getKey(@"sliders"), @"Sliders");
/// <summary>
/// "Spinners"
/// </summary>
public static LocalisableString Spinners => new TranslatableString(getKey(@"spinners"), @"Spinners");
/// <summary>
/// "Hits"
/// </summary>
public static LocalisableString Hits => new TranslatableString(getKey(@"hits"), @"Hits");
/// <summary>
/// "Drumrolls"
/// </summary>
public static LocalisableString Drumrolls => new TranslatableString(getKey(@"drumrolls"), @"Drumrolls");
/// <summary>
/// "Swells"
/// </summary>
public static LocalisableString Swells => new TranslatableString(getKey(@"swells"), @"Swells");
/// <summary>
/// "Fruits"
/// </summary>
public static LocalisableString Fruits => new TranslatableString(getKey(@"fruits"), @"Fruits");
/// <summary>
/// "Juice Streams"
/// </summary>
public static LocalisableString JuiceStreams => new TranslatableString(getKey(@"juice_streams"), @"Juice Streams");
/// <summary>
/// "Banana Showers"
/// </summary>
public static LocalisableString BananaShowers => new TranslatableString(getKey(@"banana_showers"), @"Banana Showers");
/// <summary>
/// "Notes"
/// </summary>
public static LocalisableString Notes => new TranslatableString(getKey(@"notes"), @"Notes");
/// <summary>
/// "Hold Notes"
/// </summary>
public static LocalisableString HoldNotes => new TranslatableString(getKey(@"hold_notes"), @"Hold Notes");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}
@@ -138,7 +138,7 @@ namespace osu.Game.Screens.SelectV2
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Text = BeatmapsetsStrings.ShowDetailsMappedBy(string.Empty),
Text = " mapped by ",
Font = OsuFont.Style.Body,
},
mapperLink = new MapperLinkContainer