Add material library and targeted surface drops
This commit is contained in:
1 parent
3931de1f0a
commit
02247f029a
24 files changed
+2794
-150
No files matched your search
@@ -21,6 +21,7 @@ use crate::viewport::ViewportDisplayMode;
|
||||
use crate::visualizers::EditorVisualizerProxy;
|
||||
use bevy_egui::egui;
|
||||
|
||||
use crate::viewport::material_drop::{MaterialDropSet, MaterialDropState};
|
||||
use crate::viewport::scene_view_ray;
|
||||
|
||||
#[derive(Resource, Default, Debug, Clone, Copy)]
|
||||
@@ -47,6 +48,7 @@ struct PickTargetQueries<'w, 's> {
|
||||
icon_proxies: Query<'w, 's, &'static ActorIconProxy>,
|
||||
parents: Query<'w, 's, &'static ChildOf>,
|
||||
editor_only: Query<'w, 's, (), With<EditorOnly>>,
|
||||
material_drop: Option<Res<'w, MaterialDropState>>,
|
||||
}
|
||||
|
||||
impl Plugin for EditorSelectionPlugin {
|
||||
@@ -68,6 +70,7 @@ impl Plugin for EditorSelectionPlugin {
|
||||
Last,
|
||||
(handle_pick_events, cycle_overlapping_viewport_pick)
|
||||
.chain()
|
||||
.after(MaterialDropSet)
|
||||
.run_if(scene_tools_active),
|
||||
);
|
||||
}
|
||||
@@ -110,6 +113,14 @@ fn handle_pick_events(
|
||||
gizmo_targets: Query<&GizmoTarget>,
|
||||
hierarchy: Option<Res<HierarchyPanelState>>,
|
||||
) -> Result {
|
||||
if pick_targets
|
||||
.material_drop
|
||||
.as_deref()
|
||||
.is_some_and(MaterialDropState::captures_viewport_input)
|
||||
{
|
||||
viewport_click.0 = None;
|
||||
return Ok(());
|
||||
}
|
||||
if ui_state.pointer_in_viewport
|
||||
&& !buttons.any_pressed([MouseButton::Right, MouseButton::Middle])
|
||||
&& keys.just_pressed(KeyCode::Escape)
|
||||
@@ -216,7 +227,14 @@ fn cycle_overlapping_viewport_pick(
|
||||
keys: Res<ButtonInput<KeyCode>>,
|
||||
buttons: Res<ButtonInput<MouseButton>>,
|
||||
display: Res<ViewportDisplayMode>,
|
||||
material_drop: Option<Res<MaterialDropState>>,
|
||||
) -> Result {
|
||||
if material_drop
|
||||
.as_deref()
|
||||
.is_some_and(MaterialDropState::captures_viewport_input)
|
||||
{
|
||||
return Ok(());
|
||||
}
|
||||
if display.clean_game_view {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user