/// <summary> /// Called when a user's steam avatar is loaded. Updates the user's avatar. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <exception cref="NotImplementedException"></exception> private void OnSteamAvatarLoaded(object sender, SteamAvatarLoadedEventArgs e) { if (User == null || !User.HasUserInfo || e.SteamId != (ulong)User.OnlineUser.SteamId) { return; } SetAvatar(e.Texture); }
/// <summary> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnSteamAvatarLoaded(object sender, SteamAvatarLoadedEventArgs e) { if (e.SteamId != (ulong)Item.SteamId) { return; } Avatar.Image = e.Texture; Avatar.FadeTo(1, Easing.Linear, 400); }
/// <summary> /// Called when a Steam avatar has loaded. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <exception cref="NotImplementedException"></exception> private void OnAvatarLoaded(object sender, SteamAvatarLoadedEventArgs e) { if (e.SteamId != (ulong)LocalScore.SteamId) { return; } Avatar.Image = e.Texture; Avatar.ClearAnimations(); Avatar.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, Avatar.Alpha, 1, 600)); }
/// <summary> /// Updates the user's avatar. /// </summary> private void OnSteamAvatarLoaded(object sender, SteamAvatarLoadedEventArgs e) { if (e.SteamId != SteamUser.GetSteamID().m_SteamID) { return; } Avatar.Animations.Clear(); Avatar.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, 0, 1, 300)); Avatar.Image = e.Texture; }
/// <summary> /// Called when a new steam avatar is loaded. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnSteamAvatarLoaded(object sender, SteamAvatarLoadedEventArgs e) { // If it doesn't apply to this message. if (e.SteamId != (ulong)Message.Sender.OnlineUser.SteamId) { return; } try { Avatar.Animations.Clear(); Avatar.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, 0, 1, 300)); Avatar.Image = e.Texture; } catch (Exception exception) { Logger.Error(exception, LogType.Runtime); } }