From 9325c024bb08dcd468cc41a0f70d3df7f09f5d78 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sun, 4 Aug 2019 18:26:01 +0300 Subject: [PATCH] Add InitialPosition field --- osu.Game/Screens/Play/InGameScoreContainer.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Play/InGameScoreContainer.cs b/osu.Game/Screens/Play/InGameScoreContainer.cs index 2d45158095..36dbec7fce 100644 --- a/osu.Game/Screens/Play/InGameScoreContainer.cs +++ b/osu.Game/Screens/Play/InGameScoreContainer.cs @@ -61,19 +61,18 @@ namespace osu.Game.Screens.Play /// Adds a score item based off a with an initial position. /// /// The score info to use for this item. - /// The initial position of this item. + /// The initial position of this item. /// Returns the drawable score item of that player. - public InGameScoreItem AddScore(ScoreInfo score, int? position = null) => score != null ? addScore(score.TotalScore, score.User, position) : null; + public InGameScoreItem AddScore(ScoreInfo score, int? initialPosition = null) => score != null ? addScore(score.TotalScore, score.User, initialPosition) : null; private int maxPosition => this.Where(i => i.ScorePosition.HasValue).Max(i => i.ScorePosition) ?? 0; private InGameScoreItem addScore(double totalScore, User user = null, int? position = null) { - var scoreItem = new InGameScoreItem + var scoreItem = new InGameScoreItem(position) { User = user, TotalScore = totalScore, - ScorePosition = position, OnScoreChange = updateScores, }; @@ -117,6 +116,7 @@ namespace osu.Game.Screens.Play public Action OnScoreChange; private int? scorePosition; + public int? InitialPosition; public int? ScorePosition { @@ -159,7 +159,7 @@ namespace osu.Game.Screens.Play } } - public InGameScoreItem() + public InGameScoreItem(int? initialPosition) { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; @@ -219,6 +219,8 @@ namespace osu.Game.Screens.Play }, }, }; + + InitialPosition = ScorePosition = initialPosition; } [BackgroundDependencyLoader]