nightshade 0.14.1

A cross-platform data-oriented game engine.
Documentation
//! Shared helper for gizmo overlay systems.
//!
//! Both the selection gizmo and the navigation gizmo render only when the
//! active camera's [`ViewportShading::show_overlays`] is true. Cameras
//! without a `ViewportShading` component fall back to "overlays on", so
//! apps that never attach the component see the historical behavior.

use crate::ecs::world::World;

pub(super) fn active_camera_overlays_enabled(world: &World) -> bool {
    let Some(camera_entity) = world.resources.active_camera else {
        return true;
    };
    world
        .core
        .get_viewport_shading(camera_entity)
        .map(|shading| shading.show_overlays)
        .unwrap_or(true)
}