Added Friend.GetAvatar( size )

This commit is contained in:
Garry Newman 2017-12-06 11:58:36 +00:00
parent 6dc680cbab
commit 6e807c8e4d
2 changed files with 11 additions and 0 deletions

View File

@ -24,6 +24,8 @@ public void FriendList()
foreach ( var friend in client.Friends.All )
{
Console.WriteLine( "{0}: {1} (Friend:{2}) (Blocked:{3})", friend.Id, friend.Name, friend.IsFriend, friend.IsBlocked );
Assert.IsNotNull(friend.GetAvatar( Steamworks.Friends.AvatarSize.Medium ));
}
}
}

View File

@ -127,6 +127,15 @@ public void Refresh()
Client.native.friends.RequestFriendRichPresence( Id );
}
/// <summary>
/// This will return null if you don't have the target user's avatar in your cache.
/// Which usually happens for people not on your friends list.
/// </summary>
public Image GetAvatar( Friends.AvatarSize size )
{
return Client.Friends.GetCachedAvatar( size, Id );
}
}
/// <summary>