mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
...Only reset avatar cache on callback with AVATAR flag
This commit is contained in:
parent
6e30d5d0eb
commit
99273cb188
1 changed files with 8 additions and 6 deletions
|
@ -2,7 +2,7 @@ use std::{env, ops::Deref, sync::Arc, thread, time::Duration};
|
|||
|
||||
use dashmap::DashMap;
|
||||
use eframe::egui::{self, ColorImage, RichText, TextureHandle, TextureOptions, Ui};
|
||||
use steamworks::{PersonaStateChange, SteamAPIInitError, SteamId};
|
||||
use steamworks::{PersonaChange, PersonaStateChange, SteamAPIInitError, SteamId};
|
||||
use tracing::{error, info};
|
||||
|
||||
pub struct SteamUserAvatar {
|
||||
|
@ -58,11 +58,13 @@ impl SteamState {
|
|||
{
|
||||
let avatar_cache = avatar_cache.clone();
|
||||
client.register_callback(move |event: PersonaStateChange| {
|
||||
if event.flags.contains(PersonaChange::AVATAR) {
|
||||
info!(
|
||||
"Got PersonaStateChange for {:?}, removing from avatar cache.",
|
||||
event.steam_id
|
||||
);
|
||||
avatar_cache.remove(&event.steam_id);
|
||||
}
|
||||
});
|
||||
}
|
||||
Ok(SteamState {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue