public RankControl(LeaderboardEntry001_t entry) { InitializeComponent(); rankLabel.Text = string.Format("#{0}", entry.m_nGlobalRank); nameLabel.Text = LBContext.Friends.GetFriendPersonaName(entry.m_steamIDUser); scoreBox.Text = string.Format("{0:n0}", entry.m_nScore); }
public static LeaderboardEntry001_t GetLBEntry(ulong hEntry, int index) { LeaderboardEntry001_t entry = new LeaderboardEntry001_t(); int ignored = 0; UserStats.GetDownloadedLeaderboardEntry(hEntry, index, ref entry, ref ignored, 0); return(entry); }
void ScoresDownloaded_OnRun(ulong callHandle, LeaderboardScoresDownloaded_t param) { if (callHandle == personalCall) { try { this.Invoke(new MethodInvoker(() => { LeaderboardEntry001_t entry = LBContext.GetLBEntry(param.m_hSteamLeaderboardEntries, 0); rankLabel.Text = string.Format("#{0}", entry.m_nGlobalRank); rankBox.Text = entry.m_nScore.ToString(); })); LoadLeaderboard(param.m_hSteamLeaderboard); } finally { personalCall = 0; } } else if (callHandle == leaderCall) { try { this.Invoke(new MethodInvoker(() => { leaderPanel.Controls.Clear(); for (int x = 0; x < param.m_cEntryCount; ++x) { RankControl rc = new RankControl(LBContext.GetLBEntry(param.m_hSteamLeaderboardEntries, x)); leaderPanel.Controls.Add(rc); } })); } finally { leaderCall = 0; } } }