mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Fix incorrect conditional for deciding whether scores can be deleted from UI
This commit is contained in:
parent
ae8f522c20
commit
f4a1fa85a1
@ -46,7 +46,7 @@ namespace osu.Game.Online.Leaderboards
|
||||
protected Container RankContainer { get; private set; }
|
||||
|
||||
private readonly int? rank;
|
||||
private readonly bool allowHighlight;
|
||||
private readonly bool isOnlineScope;
|
||||
|
||||
private Box background;
|
||||
private Container content;
|
||||
@ -68,12 +68,12 @@ namespace osu.Game.Online.Leaderboards
|
||||
[Resolved]
|
||||
private Storage storage { get; set; }
|
||||
|
||||
public LeaderboardScore(ScoreInfo score, int? rank, bool allowHighlight = true)
|
||||
public LeaderboardScore(ScoreInfo score, int? rank, bool isOnlineScope = true)
|
||||
{
|
||||
Score = score;
|
||||
|
||||
this.rank = rank;
|
||||
this.allowHighlight = allowHighlight;
|
||||
this.isOnlineScope = isOnlineScope;
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = HEIGHT;
|
||||
@ -111,7 +111,7 @@ namespace osu.Game.Online.Leaderboards
|
||||
background = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = user.OnlineID == api.LocalUser.Value.Id && allowHighlight ? colour.Green : Color4.Black,
|
||||
Colour = user.OnlineID == api.LocalUser.Value.Id && isOnlineScope ? colour.Green : Color4.Black,
|
||||
Alpha = background_alpha,
|
||||
},
|
||||
},
|
||||
@ -399,7 +399,7 @@ namespace osu.Game.Online.Leaderboards
|
||||
if (Score.Files.Count > 0)
|
||||
items.Add(new OsuMenuItem("Export", MenuItemType.Standard, () => new LegacyScoreExporter(storage).Export(Score)));
|
||||
|
||||
if (Score.IsManaged)
|
||||
if (!isOnlineScope)
|
||||
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(Score))));
|
||||
|
||||
return items.ToArray();
|
||||
|
@ -14,8 +14,8 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
|
||||
{
|
||||
private readonly APIUserScoreAggregate score;
|
||||
|
||||
public MatchLeaderboardScore(APIUserScoreAggregate score, int? rank, bool allowHighlight = true)
|
||||
: base(score.CreateScoreInfo(), rank, allowHighlight)
|
||||
public MatchLeaderboardScore(APIUserScoreAggregate score, int? rank, bool isOnlineScope = true)
|
||||
: base(score.CreateScoreInfo(), rank, isOnlineScope)
|
||||
{
|
||||
this.score = score;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user