public static Color GetStatusColor( Friend steamid ) { Color inGame = Color.FromArgb( 177, 251, 80 ); Color online = Color.FromArgb( 111, 189, 255 ); Color offline = Color.FromArgb( 137, 137, 137 ); Color blocked = Color.FromArgb( 251, 80, 80 ); Color invited = Color.FromArgb( 250, 218, 94 ); Color requesting = Color.FromArgb( 135, 169, 107 ); if ( steamid.IsAcceptingFriendship() ) return invited; if ( steamid.IsRequestingFriendship() ) return requesting; if ( steamid.IsBlocked() ) return blocked; if ( steamid.IsInGame() ) return inGame; if ( !steamid.IsOnline() ) return offline; return online; }
private static int rankFriend(Friend x) { if (x.IsRequestingFriendship()) { return(0); } else if (x.IsAcceptingFriendship()) { return(99); } else if (x.IsInGame()) { return(1); } else if (x.IsOnline()) { return(2); } else if (x.GetState() == EPersonaState.Busy) { return(3); } else if (x.GetState() == EPersonaState.Away) { return(4); } else if (x.GetState() == EPersonaState.Snooze) { return(5); } return(10); }
public void UpdateFriend(Friend steamid) { Friend = steamid; nameLbl.Text = steamid.GetName(); statusLbl.Text = steamid.GetStatus(); gameLbl.Text = steamid.GetGameName(); if (steamid.IsRequestingFriendship()) { btnAccept.Visible = true; btnDeny.Visible = true; } else { btnAccept.Visible = false; btnDeny.Visible = false; } nameLbl.ForeColor = statusLbl.ForeColor = gameLbl.ForeColor = Util.GetStatusColor(steamid); byte[] avatarHash = Steam3.SteamFriends.GetFriendAvatar(steamid.SteamID); bool validHash = avatarHash != null && !Util.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(steamid.SteamID, avatarHash, AvatarDownloaded); } else { AvatarHash = null; avatarBox.Image = ComposeAvatar(this.Friend, null); } }
public static Color GetStatusColor(Friend steamid) { Color inGame = Color.FromArgb(177, 251, 80); Color online = Color.FromArgb(111, 189, 255); Color offline = Color.FromArgb(137, 137, 137); Color blocked = Color.FromArgb(251, 80, 80); Color invited = Color.FromArgb(250, 218, 94); Color requesting = Color.FromArgb(135, 169, 107); if (steamid.IsAcceptingFriendship()) { return(invited); } if (steamid.IsRequestingFriendship()) { return(requesting); } if (steamid.IsBlocked()) { return(blocked); } if (steamid.IsInGame()) { return(inGame); } if (!steamid.IsOnline()) { return(offline); } return(online); }
public void UpdateFriend( Friend steamid ) { Friend = steamid; nameLbl.Text = steamid.GetName(); statusLbl.Text = steamid.GetStatus(); gameLbl.Text = steamid.GetGameName(); if ( steamid.IsRequestingFriendship() ) { btnAccept.Visible = true; btnDeny.Visible = true; } else { btnAccept.Visible = false; btnDeny.Visible = false; } nameLbl.ForeColor = statusLbl.ForeColor = gameLbl.ForeColor = Util.GetStatusColor( steamid ); byte[] avatarHash = Steam3.SteamFriends.GetFriendAvatar( steamid.SteamID ); bool validHash = avatarHash != null && !Util.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(steamid.SteamID, avatarHash, AvatarDownloaded); } else { AvatarHash = null; avatarBox.Image = ComposeAvatar( this.Friend, null ); } }
private static int rankFriend(Friend x) { if (x.IsRequestingFriendship()) return 0; else if (x.IsAcceptingFriendship()) return 99; else if (x.IsInGame()) return 1; else if (x.IsOnline()) return 2; else if (x.GetState() == EPersonaState.Busy) return 3; else if (x.GetState() == EPersonaState.Away) return 4; else if (x.GetState() == EPersonaState.Snooze) return 5; return 10; }