fix selectagon hiding

This commit is contained in:
yuni 2024-04-24 20:02:51 +02:00
parent b5878802a3
commit b80cc9387f

View file

@ -798,6 +798,8 @@ fn update_poi_overlays (
fn update_overlay_visibility( fn update_overlay_visibility(
mut q_marker: Query<&mut Visibility, With<PointOfInterestMarker>>, mut q_marker: Query<&mut Visibility, With<PointOfInterestMarker>>,
mut q_hudelement: Query<&mut Visibility, (With<ToggleableHudElement>, Without<PointOfInterestMarker>)>, mut q_hudelement: Query<&mut Visibility, (With<ToggleableHudElement>, Without<PointOfInterestMarker>)>,
mut q_selectagon: Query<&mut Visibility, (With<Selectagon>, Without<ToggleableHudElement>, Without<PointOfInterestMarker>)>,
q_target: Query<&IsTargeted, (Without<Camera>, Without<Selectagon>, Without<PointOfInterestMarker>, Without<ToggleableHudElement>)>,
mut ambient_light: ResMut<AmbientLight>, mut ambient_light: ResMut<AmbientLight>,
er_target: EventReader<UpdateOverlayVisibility>, er_target: EventReader<UpdateOverlayVisibility>,
settings: Res<var::Settings>, settings: Res<var::Settings>,
@ -810,12 +812,16 @@ fn update_overlay_visibility(
}; };
let show_poi = check(settings.hud_active && settings.map_active); let show_poi = check(settings.hud_active && settings.map_active);
let show_hud = check(settings.hud_active); let show_hud = check(settings.hud_active);
let show_selectagon = check(settings.hud_active && !q_target.is_empty());
for mut vis in &mut q_marker { for mut vis in &mut q_marker {
*vis = show_poi; *vis = show_poi;
} }
for mut vis in &mut q_hudelement { for mut vis in &mut q_hudelement {
*vis = show_hud; *vis = show_hud;
} }
for mut vis in &mut q_selectagon {
*vis = show_selectagon;
}
ambient_light.brightness = if settings.hud_active { ambient_light.brightness = if settings.hud_active {
AMBIENT_LIGHT_AR AMBIENT_LIGHT_AR