From df7cb756663c6e83305b4b0a3f7ccf315530f02b Mon Sep 17 00:00:00 2001 From: yuni Date: Sat, 5 Oct 2024 03:27:05 +0200 Subject: [PATCH] fix menu not updating sometimes when changing avatar from asteroid to none --- src/hud.rs | 2 ++ src/menu.rs | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hud.rs b/src/hud.rs index 89cb671..c4351d8 100644 --- a/src/hud.rs +++ b/src/hud.rs @@ -1290,6 +1290,7 @@ fn update_avatar( asset_server: Res, q_avatar: Query<(Entity, &SceneInstance), With>, q_player: Query>, + mut ew_updatemenu: EventWriter, mut scene_spawner: ResMut, ) { if settings.ar_avatar >= PLAYER_AR_AVATARS.len() { @@ -1297,6 +1298,7 @@ fn update_avatar( } prefs.avatar = settings.ar_avatar; prefs.save(); + ew_updatemenu.send(menu::UpdateMenuEvent); let ava = if let Some(ava) = PLAYER_AR_AVATARS.get(settings.ar_avatar) { ava diff --git a/src/menu.rs b/src/menu.rs index 407087d..82f6a32 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -630,7 +630,6 @@ pub fn handle_input( MenuAction::ChangeARAvatar => { settings.ar_avatar += 1; ew_updateavatar.send(hud::UpdateAvatarEvent); - ew_updatemenu.send(UpdateMenuEvent); } MenuAction::ModLightAmp => { prefs.light_amp += 1;