Exemple #1
0
        private static void refreshFriendsList(ListViewController leftViewController)
        {
            friends = SteamAPI.GetOnlineFriends();
            leftViewController.Data.Clear();
            CGameID gameId = SteamAPI.GetGameID();

            foreach (KeyValuePair <CSteamID, string[]> entry in friends)
            {
                if ("" + gameId != entry.Value[1] || entry.Value[1] == "0")
                {
                    continue;
                }
                leftViewController.Data.Add(new CustomCellInfo(entry.Value[0], "Playing Beat Saber"));
            }
            foreach (KeyValuePair <CSteamID, string[]> entry in friends)
            {
                if ("" + gameId == entry.Value[1] || entry.Value[1] == "0")
                {
                    continue;
                }
                leftViewController.Data.Add(new CustomCellInfo(entry.Value[0], "Playing Other Game"));
            }
            foreach (KeyValuePair <CSteamID, string[]> entry in friends)
            {
                if ("0" != entry.Value[1])
                {
                    continue;
                }
                leftViewController.Data.Add(new CustomCellInfo(entry.Value[0], "Online"));
            }

            leftViewController._customListTableView.ReloadData();
            leftViewController._customListTableView.ScrollToRow(0, false);
            leftViewController.DidSelectRowEvent = (TableView view, int row) =>
            {
                selectedPlayer      = friends.Keys.ToArray()[row].m_SteamID;
                invite.interactable = true;
            };
        }