Upgrade to Bevy 0.19 and harden editor workflows
CI / Format, lint, test, build (push) Has been cancelled
CI / Format, lint, test, build (push) Has been cancelled
This commit is contained in:
1 parent
3f85d25cc7
commit
b5e561904c
204 files changed
+6972
-29907
No files matched your search
@@ -14,7 +14,7 @@ use crate::ui::hierarchy_ops::is_entity_locked;
|
||||
use crate::ui::hierarchy_state::HierarchyPanelState;
|
||||
use crate::ui::UiState;
|
||||
use crate::viewport::actor_icons::ActorIconProxy;
|
||||
use crate::viewport::brush_edit::BrushEditMode;
|
||||
use crate::viewport::brush_edit::{BrushEditMode, BrushElementGizmo};
|
||||
use crate::viewport::brush_tool::BrushToolState;
|
||||
use crate::viewport::ViewportDisplayMode;
|
||||
use crate::visualizers::EditorVisualizerProxy;
|
||||
@@ -238,6 +238,10 @@ fn cycle_overlapping_viewport_pick(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::too_many_arguments,
|
||||
reason = "viewport picking combines explicit camera, ray-cast, selection, and input state"
|
||||
)]
|
||||
fn apply_viewport_pick(
|
||||
hierarchy: Option<&HierarchyPanelState>,
|
||||
ui_state: &mut UiState,
|
||||
@@ -369,30 +373,40 @@ fn pick_target_for_entity(entity: Entity, pick_targets: &PickTargetQueries) -> O
|
||||
None
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::too_many_arguments,
|
||||
reason = "Bevy system parameters represent independent selection and gizmo state"
|
||||
)]
|
||||
fn sync_gizmo_targets(
|
||||
mut ui_state: ResMut<UiState>,
|
||||
mut selected: ResMut<SelectedEntity>,
|
||||
mut commands: Commands,
|
||||
targets: Query<Entity, With<GizmoTarget>>,
|
||||
targets: Query<(Entity, Option<&BrushElementGizmo>), With<GizmoTarget>>,
|
||||
level_objects: Query<(), (With<LevelObject>, Without<EditorOnly>)>,
|
||||
editor_only: Query<(), With<EditorOnly>>,
|
||||
transforms: Query<(), With<Transform>>,
|
||||
hierarchy: Option<Res<HierarchyPanelState>>,
|
||||
display: Res<ViewportDisplayMode>,
|
||||
brush_mode: Res<BrushEditMode>,
|
||||
) {
|
||||
ui_state
|
||||
.selected_entities
|
||||
.retain(|entity| transforms.contains(entity) && !editor_only.contains(entity));
|
||||
selected.0 = ui_state.selected_entities.as_slice().first().copied();
|
||||
|
||||
if display.clean_game_view {
|
||||
for entity in &targets {
|
||||
commands.entity(entity).remove::<GizmoTarget>();
|
||||
if display.clean_game_view || brush_mode.is_element_mode() {
|
||||
for (entity, brush_element_gizmo) in &targets {
|
||||
if brush_element_gizmo.is_none() {
|
||||
commands.entity(entity).remove::<GizmoTarget>();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
for entity in &targets {
|
||||
for (entity, brush_element_gizmo) in &targets {
|
||||
if brush_element_gizmo.is_some() {
|
||||
continue;
|
||||
}
|
||||
if !ui_state.selected_entities.contains(entity) {
|
||||
commands.entity(entity).remove::<GizmoTarget>();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user