1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-25 15:00:44 +08:00

Merge pull request #32478 from peppy/no-tag-on-convert

Disallow tagging beatmaps when playing as convert
This commit is contained in:
Dean Herbert
2025-03-20 19:54:47 +09:00
committed by GitHub
Unverified
2 changed files with 34 additions and 5 deletions
@@ -24,6 +24,7 @@ using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Mania;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Scoring;
@@ -243,6 +244,28 @@ namespace osu.Game.Tests.Visual.Ranking
});
}
[Test]
public void TestTaggingConvert()
{
var score = TestResources.CreateTestScoreInfo();
score.Ruleset = new ManiaRuleset().RulesetInfo;
AddStep("load panel", () =>
{
Child = new PopoverContainer
{
RelativeSizeAxes = Axes.Both,
Child = new StatisticsPanel
{
RelativeSizeAxes = Axes.Both,
State = { Value = Visibility.Visible },
Score = { Value = score },
AchievedScore = score,
}
};
});
}
private void loadPanel(ScoreInfo score) => AddStep("load panel", () =>
{
Child = new StatisticsPanel
@@ -235,10 +235,16 @@ namespace osu.Game.Screens.Ranking.Statistics
&& newScore.BeatmapInfo!.OnlineID > 0
&& api.IsLoggedIn)
{
if (
// We may want to iterate on this condition
AchievedScore.Rank >= ScoreRank.C
)
string? preventTaggingReason = null;
// We may want to iterate on the following conditions further in the future
if (AchievedScore.Ruleset.OnlineID != AchievedScore.BeatmapInfo!.Ruleset.OnlineID)
preventTaggingReason = "Play the beatmap in its original ruleset to contribute to beatmap tags!";
else if (AchievedScore.Rank < ScoreRank.C)
preventTaggingReason = "Set a better score to contribute to beatmap tags!";
if (preventTaggingReason == null)
{
yield return new StatisticItem("Tag the beatmap!", () => new UserTagControl(newScore.BeatmapInfo)
{
@@ -254,7 +260,7 @@ namespace osu.Game.Screens.Ranking.Statistics
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
TextAnchor = Anchor.Centre,
Text = "Set a better score to contribute to beatmap tags!",
Text = preventTaggingReason,
});
}
}