예제 #1
0
        void OnTimerElapsed(object sender, ElapsedEventArgs e)
        {
            byte[] avatarHash = bot.SteamFriends.GetFriendAvatar(bot.SteamUser.SteamID);
            bool   validHash  = avatarHash != null && !IsZeros(avatarHash);

            if ((AvatarHash == null && !validHash && avatarBox.Image != null) || (AvatarHash != null && AvatarHash.SequenceEqual(avatarHash)))
            {
                // avatar is already up to date, no operations necessary
            }
            else if (validHash)
            {
                AvatarHash = avatarHash;
                CDNCache.DownloadAvatar(bot.SteamUser.SteamID, avatarHash, AvatarDownloaded);
            }
            else
            {
                AvatarHash      = null;
                avatarBox.Image = ComposeAvatar(null);
            }
            bot.LoadFriends();
            if (Application.OpenForms.Count < 1)
            {
                Friends friends = new Friends(bot, steam_name.Text);
                friends.Show();
                friends.Activate();
            }
            friends_list.SetObjects(ListFriends.Get(showOnlineFriendsOnlyToolStripMenuItem.Checked));
            Console.WriteLine("Friends list refreshed.");
        }
예제 #2
0
        private void showOnlineFriendsOnlyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool checkState = showOnlineFriendsOnlyToolStripMenuItem.Checked;

            Properties.Settings.Default.OnlineOnly = checkState;
            Properties.Settings.Default.Save();
            friends_list.SetObjects(ListFriends.Get(checkState));
        }
예제 #3
0
 private void text_search_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 27)
     {
         text_search.Clear();
         this.friends_list.SetObjects(ListFriends.Get(showOnlineFriendsOnlyToolStripMenuItem.Checked));
     }
 }
예제 #4
0
 private void text_search_Leave(object sender, EventArgs e)
 {
     if (text_search.Text == "")
     {
         text_search.Font      = new Font(text_search.Font, FontStyle.Italic);
         text_search.ForeColor = SystemColors.ControlDark;
         text_search.Text      = "Search";
         this.friends_list.SetObjects(ListFriends.Get(showOnlineFriendsOnlyToolStripMenuItem.Checked));
     }
 }
예제 #5
0
 private void text_search_TextChanged(object sender, EventArgs e)
 {
     if (text_search.Text == "")
     {
         this.friends_list.SetObjects(ListFriends.Get(showOnlineFriendsOnlyToolStripMenuItem.Checked));
     }
     else
     {
         this.friends_list.SetObjects(ListFriends.Get(text_search.Text));
     }
 }
예제 #6
0
 private void Friends_Leave(object sender, EventArgs e)
 {
     text_search.Text = "";
     this.friends_list.SetObjects(ListFriends.Get(showOnlineFriendsOnlyToolStripMenuItem.Checked));
     label1.Select();
 }