Show right position-nums on challenge-main.
This commit is contained in:
1 parent
6cee84e473
commit
f9c2fe0da1
2 files changed
+13
-4
No files matched your search
@@ -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<Stats> GetPointsForPlayer(SPlayer[] Results)
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user