From f9c2fe0da148e1658f79e21fc93daa0c85d173b2 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Mon, 24 Dec 2012 10:16:48 +0100 Subject: [PATCH] Show right position-nums on challenge-main. --- PartyModeChallenge/PartyModeChallenge.cs | 12 ++++++++++++ PartyModeChallenge/PartyScreenChallengeMain.cs | 5 +---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/PartyModeChallenge/PartyModeChallenge.cs b/PartyModeChallenge/PartyModeChallenge.cs index 776e8292..af6f6f22 100644 --- a/PartyModeChallenge/PartyModeChallenge.cs +++ b/PartyModeChallenge/PartyModeChallenge.cs @@ -33,6 +33,7 @@ namespace Vocaluxe.PartyModes public class ResultTableRow : IComparable { + public int Position; public int PlayerID; public int NumPlayed; public int NumRounds; @@ -632,6 +633,17 @@ namespace Vocaluxe.PartyModes } GameData.ResultTable.Sort(); + + //Update position-number + int pos = 1; + int last_points = 0; + for (int i = 0; i < GameData.ResultTable.Count; i++ ) + { + if (last_points > GameData.ResultTable[i].NumGamePoints) + pos++; + GameData.ResultTable[i].Position = pos; + last_points = GameData.ResultTable[i].NumGamePoints; + } } private List GetPointsForPlayer(SPlayer[] Results) diff --git a/PartyModeChallenge/PartyScreenChallengeMain.cs b/PartyModeChallenge/PartyScreenChallengeMain.cs index 70181a40..5cd97856 100644 --- a/PartyModeChallenge/PartyScreenChallengeMain.cs +++ b/PartyModeChallenge/PartyScreenChallengeMain.cs @@ -542,9 +542,6 @@ namespace Vocaluxe.PartyModes private void UpdatePlayerTable() { - if (NumPlayerVisible > GameState.ProfileIDs.Count) - NumPlayerVisible = GameState.ProfileIDs.Count; - SProfile[] profiles = _Base.Profiles.GetProfiles(); for (int i = 0; i < PlayerTable.Count; i++) @@ -560,7 +557,7 @@ namespace Vocaluxe.PartyModes row.SingPoints.Visible = true; row.GamePoints.Visible = true; - row.Pos.Text = (i + 1 + PlayerTableOffset).ToString(); + row.Pos.Text = GameState.ResultTable[i + PlayerTableOffset].Position.ToString(); row.Name.Text = profiles[GameState.ResultTable[i+PlayerTableOffset].PlayerID].PlayerName; row.Rounds.Text = GameState.ResultTable[i+PlayerTableOffset].NumRounds.ToString(); row.Won.Text = GameState.ResultTable[i+PlayerTableOffset].NumWon.ToString();