コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: bmk10/hl2sb-src-1
        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;
                }
            }
        }