mirror of
https://github.com/ppy/osu.git
synced 2026-06-03 19:24:24 +08:00
Address review comments
This commit is contained in:
@@ -256,6 +256,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
var score = TestResources.CreateTestScoreInfo();
|
||||
score.Rank = ScoreRank.D;
|
||||
|
||||
setUpTaggingRequests(() => score.BeatmapInfo);
|
||||
AddStep("load panel", () =>
|
||||
{
|
||||
Child = new PopoverContainer
|
||||
@@ -278,6 +279,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
var score = TestResources.CreateTestScoreInfo();
|
||||
score.Ruleset = new ManiaRuleset().RulesetInfo;
|
||||
|
||||
setUpTaggingRequests(() => score.BeatmapInfo);
|
||||
AddStep("load panel", () =>
|
||||
{
|
||||
Child = new PopoverContainer
|
||||
|
||||
@@ -100,8 +100,9 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
Child = new PopoverContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Child = new UserTagControl(Beatmap.Value.BeatmapInfo, true)
|
||||
Child = new UserTagControl(Beatmap.Value.BeatmapInfo)
|
||||
{
|
||||
Writable = true,
|
||||
Width = 700,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
||||
@@ -265,8 +265,9 @@ namespace osu.Game.Screens.Ranking.Statistics
|
||||
|
||||
if (preventTaggingReason == null)
|
||||
{
|
||||
yield return new StatisticItem("Tag the beatmap!", () => new UserTagControl(newScore.BeatmapInfo, true)
|
||||
yield return new StatisticItem("Tag the beatmap!", () => new UserTagControl(newScore.BeatmapInfo)
|
||||
{
|
||||
Writable = true,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
@@ -287,8 +288,9 @@ namespace osu.Game.Screens.Ranking.Statistics
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
},
|
||||
new UserTagControl(newScore.BeatmapInfo, false)
|
||||
new UserTagControl(newScore.BeatmapInfo)
|
||||
{
|
||||
Writable = false,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
||||
@@ -47,15 +47,14 @@ namespace osu.Game.Screens.Ranking
|
||||
/// <summary>
|
||||
/// Determines whether the user can modify the contained tags
|
||||
/// </summary>
|
||||
private readonly bool writable;
|
||||
public bool Writable { get; init; }
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; } = null!;
|
||||
|
||||
public UserTagControl(BeatmapInfo beatmapInfo, bool writable)
|
||||
public UserTagControl(BeatmapInfo beatmapInfo)
|
||||
{
|
||||
this.beatmapInfo = beatmapInfo;
|
||||
this.writable = writable;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@@ -94,7 +93,7 @@ namespace osu.Game.Screens.Ranking
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Direction = FillDirection.Full,
|
||||
Spacing = new Vector2(4),
|
||||
Children = writable
|
||||
Children = Writable
|
||||
?
|
||||
[
|
||||
addNewTagUserTag = new AddNewTagUserTag
|
||||
@@ -202,7 +201,7 @@ namespace osu.Game.Screens.Ranking
|
||||
case NotifyCollectionChangedAction.Reset:
|
||||
{
|
||||
tagFlow.Clear();
|
||||
if (writable) tagFlow.Add(addNewTagUserTag!);
|
||||
if (Writable) tagFlow.Add(addNewTagUserTag!);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -210,7 +209,7 @@ namespace osu.Game.Screens.Ranking
|
||||
|
||||
private void toggleVote(UserTag tag)
|
||||
{
|
||||
if (!writable)
|
||||
if (!Writable)
|
||||
return;
|
||||
|
||||
if (tag.Updating.Value)
|
||||
|
||||
Reference in New Issue
Block a user