mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 05:02:55 +08:00
Merge pull request #17565 from smoogipoo/fix-gameplay-leaderboard-allocations
Remove ScoreInfo allocations in multiplayer leaderboard
This commit is contained in:
commit
ad14b7cac5
@ -227,15 +227,15 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
public int? Team => (User.MatchState as TeamVersusUserState)?.TeamID;
|
public int? Team => (User.MatchState as TeamVersusUserState)?.TeamID;
|
||||||
|
|
||||||
private readonly RulesetInfo ruleset;
|
private readonly ScoreInfo scoreInfo;
|
||||||
|
|
||||||
public TrackedUserData(MultiplayerRoomUser user, RulesetInfo ruleset, ScoreProcessor scoreProcessor)
|
public TrackedUserData(MultiplayerRoomUser user, RulesetInfo ruleset, ScoreProcessor scoreProcessor)
|
||||||
{
|
{
|
||||||
this.ruleset = ruleset;
|
|
||||||
|
|
||||||
User = user;
|
User = user;
|
||||||
ScoreProcessor = scoreProcessor;
|
ScoreProcessor = scoreProcessor;
|
||||||
|
|
||||||
|
scoreInfo = new ScoreInfo { Ruleset = ruleset };
|
||||||
|
|
||||||
ScoringMode.BindValueChanged(_ => UpdateScore());
|
ScoringMode.BindValueChanged(_ => UpdateScore());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,12 +253,10 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
var header = frame.Header;
|
var header = frame.Header;
|
||||||
|
|
||||||
Score.Value = ScoreProcessor.ComputePartialScore(ScoringMode.Value, new ScoreInfo
|
scoreInfo.MaxCombo = header.MaxCombo;
|
||||||
{
|
scoreInfo.Statistics = header.Statistics;
|
||||||
Ruleset = ruleset,
|
|
||||||
MaxCombo = header.MaxCombo,
|
Score.Value = ScoreProcessor.ComputePartialScore(ScoringMode.Value, scoreInfo);
|
||||||
Statistics = header.Statistics
|
|
||||||
});
|
|
||||||
|
|
||||||
Accuracy.Value = header.Accuracy;
|
Accuracy.Value = header.Accuracy;
|
||||||
CurrentCombo.Value = header.Combo;
|
CurrentCombo.Value = header.Combo;
|
||||||
|
Loading…
Reference in New Issue
Block a user