Skip to content

Commit

Permalink
Allow watching replay from multi/playlist results screens
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach committed Sep 7, 2023
1 parent 4ab7938 commit f9c8a46
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion osu.Game/Online/API/Requests/Responses/SoloScoreInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public ScoreInfo ToScoreInfo(Mod[] mods, IBeatmapInfo? beatmap = null)
Statistics = Statistics,
MaximumStatistics = MaximumStatistics,
Date = EndedAt,
Hash = HasReplay ? "online" : string.Empty, // TODO: temporary?
HasOnlineReplay = HasReplay,
Mods = mods,
PP = PP,
};
Expand Down
5 changes: 4 additions & 1 deletion osu.Game/Online/Rooms/MultiplayerScore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public class MultiplayerScore : IAPISubmittedScore
[JsonProperty("position")]
public int? Position { get; set; }

[JsonProperty("has_replay")]
public bool HasReplay { get; set; }

/// <summary>
/// Any scores in the room around this score.
/// </summary>
Expand All @@ -87,7 +90,7 @@ public ScoreInfo CreateScoreInfo(ScoreManager scoreManager, RulesetStore ruleset
User = User,
Accuracy = Accuracy,
Date = EndedAt,
Hash = string.Empty, // todo: temporary?
HasOnlineReplay = HasReplay,
Rank = Rank,
Mods = Mods?.Select(m => m.ToMod(rulesetInstance)).ToArray() ?? Array.Empty<Mod>(),
Position = Position,
Expand Down
5 changes: 4 additions & 1 deletion osu.Game/Scoring/ScoreInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ public class ScoreInfo : RealmObject, IHasGuidPrimaryKey, IHasRealmFiles, ISoftD

public double Accuracy { get; set; }

public bool HasReplay => !string.IsNullOrEmpty(Hash);
public bool HasReplay => !string.IsNullOrEmpty(Hash) || HasOnlineReplay;

[Ignored]
public bool HasOnlineReplay { get; set; }

public DateTimeOffset Date { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
public partial class MultiplayerResultsScreen : PlaylistsResultsScreen
{
public MultiplayerResultsScreen(ScoreInfo score, long roomId, PlaylistItem playlistItem)
: base(score, roomId, playlistItem, false, false)
: base(score, roomId, playlistItem, false)
{
}
}
Expand Down

0 comments on commit f9c8a46

Please sign in to comment.