From bf1effcf8e658c354c925eae6f427554d4ad64f9 Mon Sep 17 00:00:00 2001 From: Julia Naomi Date: Wed, 14 Feb 2024 11:47:45 -0600 Subject: [PATCH] Update all crates to latest versions (#194) Co-authored-by: rewin --- Cargo.toml | 30 +++++ assets/scenes/cubes_camera_test.scn.ron | 121 +++++++++--------- crates/editor_core/Cargo.toml | 4 +- crates/editor_ui/Cargo.toml | 40 +++--- crates/editor_ui/src/camera_view.rs | 13 +- crates/editor_ui/src/change_chain.rs | 4 +- crates/editor_ui/src/debug_panels.rs | 2 +- crates/editor_ui/src/editor_tab.rs | 2 +- crates/editor_ui/src/game_view.rs | 13 +- crates/editor_ui/src/hierarchy.rs | 4 +- crates/editor_ui/src/icons.rs | 34 ++--- .../src/inspector/events_dispatcher.rs | 2 +- crates/editor_ui/src/inspector/mod.rs | 2 +- crates/editor_ui/src/inspector/refl_impl.rs | 2 +- crates/editor_ui/src/inspector/resources.rs | 2 +- .../editor_ui/src/inspector/runtime_assets.rs | 2 +- crates/editor_ui/src/lib.rs | 8 +- crates/editor_ui/src/menu_toolbars.rs | 2 +- crates/editor_ui/src/mouse_check.rs | 2 +- crates/editor_ui/src/selection.rs | 1 + crates/editor_ui/src/settings.rs | 2 +- crates/editor_ui/src/tool.rs | 2 +- crates/editor_ui/src/tools/gizmo.rs | 7 +- crates/editor_ui/src/ui_plugin.rs | 2 +- crates/prefab/Cargo.toml | 7 +- crates/prefab/src/component/shape.rs | 1 - crates/shared/Cargo.toml | 8 +- crates/undo/Cargo.toml | 2 +- modules/bevy_xpbd_plugin/Cargo.toml | 1 + modules/bevy_xpbd_plugin/src/collider.rs | 1 - modules/bevy_xpbd_plugin/src/spatial_query.rs | 2 - src/main.rs | 2 +- 32 files changed, 181 insertions(+), 146 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index eb1d68c2..1c3498a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,11 +32,41 @@ space_undo = { version = "0.3.1", path = "crates/undo" } space_persistence = { version = "0.3.1", path = "crates/persistence"} space_editor_core = { version = "0.3.1", path = "crates/editor_core", features = ["persistence_editor"] } space_editor_ui = { version = "0.3.1", path = "crates/editor_ui", features = ["persistence_editor"] } + +# Crates inner libraries +anyhow = "1.0" +bevy_asset_loader = "0.19" +bevy_common_assets = { version = "0.8", features = ["ron"] } +bevy_debug_grid = "0.4" +bevy_egui_next = "0.26" +bevy-inspector-egui = { version = "0.22", features = [ + "bevy_pbr", + "highlight_changes", +] } +bevy_mod_billboard = "0.5.1" +bevy_mod_picking = { git = "https://github.com/dgriffith0/bevy_mod_picking.git", branch = "pick_hidden", default-features = false, features = [ + "backend_raycast", + "selection", +] } +bevy_panorbit_camera = "0.9" +bevy-scene-hook = "9" +convert_case = "0.6" +egui_dock = "0.11" +egui_extras = { version = "0.26", features = ["all_loaders"] } +egui_file = "0.15" +egui-gizmo = "0.16" +pretty-type-name = "1" ron = "0.8" +resvg = "0.37" serde = "1" +# Community Modules space_bevy_xpbd_plugin = { version = "0.3.1", path = "modules/bevy_xpbd_plugin"} +[patch.crates-io] +egui-gizmo = { git = "https://github.com/naomijub/egui-gizmo.git" } +bevy-inspector-egui ={ git = "https://github.com/naomijub/bevy-inspector-egui.git" } + [dependencies] bevy.workspace = true space_editor_ui.workspace = true diff --git a/assets/scenes/cubes_camera_test.scn.ron b/assets/scenes/cubes_camera_test.scn.ron index 7912e98c..710530e8 100644 --- a/assets/scenes/cubes_camera_test.scn.ron +++ b/assets/scenes/cubes_camera_test.scn.ron @@ -1,12 +1,63 @@ ( resources: {}, entities: { - 7: ( + 8589934601: ( components: { "bevy_transform::components::transform::Transform": ( translation: ( + x: -0.23666778, + y: 0.0, + z: 0.9822956, + ), + rotation: ( x: 0.0, - y: 0.012409747, + y: 0.0, + z: 0.0, + w: 1.0, + ), + scale: ( + x: 1.0, + y: 1.0, + z: 1.0, + ), + ), + "bevy_core::name::Name": ( + hash: 14571447366056269603, + name: "Camera3d", + ), + "bevy_render::view::visibility::Visibility": Inherited, + "bevy_render::camera::camera::Camera": ( + viewport: None, + order: 0, + is_active: false, + hdr: false, + msaa_writeback: true, + ), + "bevy_core_pipeline::core_3d::camera_3d::Camera3d": ( + clear_color: Default, + depth_load_op: Clear(0.0), + depth_texture_usages: (16), + screen_space_specular_transmission_steps: 1, + screen_space_specular_transmission_quality: Medium, + ), + "bevy_render::camera::projection::Projection": Perspective(( + fov: 0.7853982, + aspect_ratio: 1.9028741, + near: 0.1, + far: 1000.0, + )), + "space_prefab::component::camera::CameraPlay": (), + "space_prefab::save::ChildrenPrefab": ([ + 17179869198, + ]), + }, + ), + 8589934604: ( + components: { + "bevy_transform::components::transform::Transform": ( + translation: ( + x: -3.9199495, + y: 1.6674547, z: -5.0, ), rotation: ( @@ -61,61 +112,13 @@ )), }, ), - 8: ( - components: { - "bevy_transform::components::transform::Transform": ( - translation: ( - x: 0.0, - y: 0.0, - z: 0.0, - ), - rotation: ( - x: 0.0, - y: 0.0, - z: 0.0, - w: 1.0, - ), - scale: ( - x: 1.0, - y: 1.0, - z: 1.0, - ), - ), - "bevy_core::name::Name": ( - hash: 14571447366056269603, - name: "Camera3d", - ), - "bevy_render::view::visibility::Visibility": Inherited, - "bevy_render::camera::camera::Camera": ( - viewport: None, - order: 0, - is_active: false, - hdr: false, - msaa_writeback: true, - ), - "bevy_core_pipeline::core_3d::camera_3d::Camera3d": ( - clear_color: Default, - depth_load_op: Clear(0.0), - depth_texture_usages: (16), - screen_space_specular_transmission_steps: 1, - screen_space_specular_transmission_quality: Medium, - ), - "bevy_render::camera::projection::Projection": Perspective(( - fov: 0.7853982, - aspect_ratio: 1.9944445, - near: 0.1, - far: 1000.0, - )), - "space_prefab::component::camera::CameraPlay": (), - }, - ), - 9: ( + 12884901893: ( components: { "bevy_transform::components::transform::Transform": ( translation: ( - x: -3.9199495, - y: 1.8673916, - z: -5.0, + x: 4.105635, + y: -1.9975517, + z: -5.7572546, ), rotation: ( x: 0.0, @@ -169,13 +172,13 @@ )), }, ), - 10: ( + 12884901899: ( components: { "bevy_transform::components::transform::Transform": ( translation: ( - x: 4.0474353, - y: -2.240034, - z: -5.7572546, + x: 0.0, + y: 0.012409747, + z: -5.0, ), rotation: ( x: 0.0, @@ -229,7 +232,7 @@ )), }, ), - 12: ( + 17179869194: ( components: { "bevy_transform::components::transform::Transform": ( translation: ( diff --git a/crates/editor_core/Cargo.toml b/crates/editor_core/Cargo.toml index 914f8e84..1e4841ee 100644 --- a/crates/editor_core/Cargo.toml +++ b/crates/editor_core/Cargo.toml @@ -11,13 +11,13 @@ homepage.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +bevy.workspace = true + space_prefab.workspace = true space_undo.workspace = true space_persistence.workspace = true space_shared.workspace = true -bevy.workspace = true - [features] persistence_editor = [] diff --git a/crates/editor_ui/Cargo.toml b/crates/editor_ui/Cargo.toml index e57c004c..1a4cab56 100644 --- a/crates/editor_ui/Cargo.toml +++ b/crates/editor_ui/Cargo.toml @@ -15,33 +15,31 @@ persistence_editor = [] [dependencies] bevy.workspace = true + space_editor_core.workspace = true space_prefab.workspace = true space_undo.workspace = true space_persistence.workspace = true space_shared.workspace = true -serde.workspace = true - -bevy_egui = "0.24" -egui_extras = { version = "0.24", features = ["all_loaders"] } -resvg = "0.37" -egui-gizmo = "0.13" -egui_dock = "0.9" -bevy_debug_grid = "0.4" - -bevy_mod_picking = { git = "https://github.com/dgriffith0/bevy_mod_picking.git", branch = "pick_hidden", default-features = false, features = [ - "backend_raycast", - "selection", -] } -bevy_asset_loader = "0.19" -bevy_panorbit_camera = "0.9" -bevy_mod_billboard = "0.5.1" -pretty-type-name = "1.0.1" -convert_case = "0.6" - -anyhow = "1.0" -bevy_common_assets = { version = "0.8", features = ["ron"] } +serde.workspace = true +pretty-type-name.workspace = true +bevy_egui_next.workspace = true +egui-gizmo.workspace = true +egui_dock.workspace = true +bevy_debug_grid.workspace = true +bevy_mod_picking.workspace = true +bevy_asset_loader.workspace = true +bevy_panorbit_camera.workspace = true +bevy_mod_billboard.workspace = true +convert_case.workspace = true +anyhow.workspace = true +bevy_common_assets.workspace = true +egui_extras.workspace = true +resvg.workspace = true + +[patch.crates-io] +egui-gizmo = { git = "https://github.com/naomijub/egui-gizmo.git" } [lints] workspace = true \ No newline at end of file diff --git a/crates/editor_ui/src/camera_view.rs b/crates/editor_ui/src/camera_view.rs index d20d098f..95896941 100644 --- a/crates/editor_ui/src/camera_view.rs +++ b/crates/editor_ui/src/camera_view.rs @@ -8,7 +8,7 @@ use bevy::{ }, window::PrimaryWindow, }; -use bevy_egui::{egui, EguiContexts}; +use bevy_egui_next::{egui, EguiContexts}; use space_prefab::component::CameraPlay; use space_shared::*; @@ -77,7 +77,12 @@ fn create_camera_image(width: u32, height: u32) -> Image { } impl EditorTab for CameraViewTab { - fn ui(&mut self, ui: &mut bevy_egui::egui::Ui, commands: &mut Commands, world: &mut World) { + fn ui( + &mut self, + ui: &mut bevy_egui_next::egui::Ui, + commands: &mut Commands, + world: &mut World, + ) { if self.real_camera.is_none() { if world.resource::().is_3d() { self.real_camera = Some( @@ -219,7 +224,7 @@ impl EditorTab for CameraViewTab { } } - fn title(&self) -> bevy_egui::egui::WidgetText { + fn title(&self) -> bevy_egui_next::egui::WidgetText { "Camera view".into() } } @@ -253,7 +258,7 @@ fn set_camera_viewport( mut local: Local, mut ui_state: ResMut, primary_window: Query<&mut Window, With>, - egui_settings: Res, + egui_settings: Res, mut cameras: Query<(&mut Camera, &mut Transform), Without>, mut ctxs: EguiContexts, ) { diff --git a/crates/editor_ui/src/change_chain.rs b/crates/editor_ui/src/change_chain.rs index 1176d25c..a828c668 100644 --- a/crates/editor_ui/src/change_chain.rs +++ b/crates/editor_ui/src/change_chain.rs @@ -20,7 +20,7 @@ pub struct ChangeChainView; impl EditorTab for ChangeChainView { fn ui( &mut self, - ui: &mut bevy_egui::egui::Ui, + ui: &mut bevy_egui_next::egui::Ui, _commands: &mut bevy::prelude::Commands, world: &mut bevy::prelude::World, ) { @@ -31,7 +31,7 @@ impl EditorTab for ChangeChainView { } } - fn title(&self) -> bevy_egui::egui::WidgetText { + fn title(&self) -> bevy_egui_next::egui::WidgetText { "Change Chain".into() } } diff --git a/crates/editor_ui/src/debug_panels.rs b/crates/editor_ui/src/debug_panels.rs index 620cc5ea..645dad58 100644 --- a/crates/editor_ui/src/debug_panels.rs +++ b/crates/editor_ui/src/debug_panels.rs @@ -1,6 +1,6 @@ use super::editor_tab::*; use bevy::prelude::*; -use bevy_egui::egui; +use bevy_egui_next::egui; use space_shared::ext::bevy_inspector_egui; #[derive(Resource)] diff --git a/crates/editor_ui/src/editor_tab.rs b/crates/editor_ui/src/editor_tab.rs index f5246aa0..e029df86 100644 --- a/crates/editor_ui/src/editor_tab.rs +++ b/crates/editor_ui/src/editor_tab.rs @@ -1,7 +1,7 @@ // This module contains the implementation of the editor tabs use bevy::{prelude::*, utils::HashMap}; -use bevy_egui::egui::{self, WidgetText}; +use bevy_egui_next::egui::{self, WidgetText}; use convert_case::{Case, Casing}; use crate::colors::ERROR_COLOR; diff --git a/crates/editor_ui/src/game_view.rs b/crates/editor_ui/src/game_view.rs index 023ea8be..8ed54e92 100644 --- a/crates/editor_ui/src/game_view.rs +++ b/crates/editor_ui/src/game_view.rs @@ -1,5 +1,5 @@ use bevy::{prelude::*, window::PrimaryWindow}; -use bevy_egui::egui::{self}; +use bevy_egui_next::egui::{self}; use egui_gizmo::GizmoMode; use space_undo::UndoRedo; @@ -39,7 +39,12 @@ impl Default for GameViewTab { } impl EditorTab for GameViewTab { - fn ui(&mut self, ui: &mut bevy_egui::egui::Ui, commands: &mut Commands, world: &mut World) { + fn ui( + &mut self, + ui: &mut bevy_egui_next::egui::Ui, + commands: &mut Commands, + world: &mut World, + ) { if ui.input_mut(|i| i.key_released(egui::Key::Z) && i.modifiers.ctrl && !i.modifiers.shift) { world.send_event(UndoRedo::Undo); @@ -93,7 +98,7 @@ impl EditorTab for GameViewTab { }); } - fn title(&self) -> bevy_egui::egui::WidgetText { + fn title(&self) -> bevy_egui_next::egui::WidgetText { "Game view".into() } } @@ -129,7 +134,7 @@ pub fn set_camera_viewport( mut local: Local, ui_state: Res, primary_window: Query<&mut Window, With>, - egui_settings: Res, + egui_settings: Res, mut cameras: Query<&mut Camera, With>, ) { let Ok(mut cam) = cameras.get_single_mut() else { diff --git a/crates/editor_ui/src/hierarchy.rs b/crates/editor_ui/src/hierarchy.rs index bfdd4894..77a8d5f1 100644 --- a/crates/editor_ui/src/hierarchy.rs +++ b/crates/editor_ui/src/hierarchy.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use bevy::{ecs::query::ReadOnlyWorldQuery, prelude::*, utils::HashMap}; -use bevy_egui::{egui::collapsing_header::CollapsingState, *}; +use bevy_egui_next::{egui::collapsing_header::CollapsingState, *}; use space_editor_core::prelude::*; use space_prefab::editor_registry::EditorRegistry; use space_undo::{AddedEntity, NewChange, RemovedEntity, UndoSet}; @@ -174,7 +174,7 @@ fn draw_entity( }) }; - if label.clicked() { + if label.map_or(false, |label_response| label_response.response.clicked()) { if !is_selected { if !ui.input(|i| i.modifiers.shift) { for e in selected.iter() { diff --git a/crates/editor_ui/src/icons.rs b/crates/editor_ui/src/icons.rs index 3d39f623..04b90018 100644 --- a/crates/editor_ui/src/icons.rs +++ b/crates/editor_ui/src/icons.rs @@ -1,4 +1,4 @@ -use bevy_egui::egui; +use bevy_egui_next::egui; pub const TRANSLATE: &str = ""; pub const ROTATION: &str = ""; @@ -19,7 +19,7 @@ pub const PREFAB: &str = "(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("prefab.svg", crate::icons::PREFAB.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -29,7 +29,7 @@ pub fn prefab_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> pub fn scene_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("scene.svg", crate::icons::SCENE.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -39,7 +39,7 @@ pub fn scene_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> pub fn rotation_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("rotatio.svg", crate::icons::ROTATION.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -49,7 +49,7 @@ pub fn rotation_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<' pub fn scale_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("scale.svg", crate::icons::SCALE.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -59,7 +59,7 @@ pub fn scale_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> pub fn entity_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("entity.svg", crate::icons::ENTITY.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -69,7 +69,7 @@ pub fn entity_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> pub fn component_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("component.svg", crate::icons::COMPONENT.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -79,7 +79,7 @@ pub fn component_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button< pub fn delete_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("delete.svg", crate::icons::DELETE.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -89,7 +89,7 @@ pub fn delete_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> pub fn light_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("light.svg", crate::icons::LIGHT.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -99,7 +99,7 @@ pub fn light_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> pub fn camera_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("camera.svg", crate::icons::CAMERA.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -109,7 +109,7 @@ pub fn camera_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> pub fn mesh_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("mesh.svg", crate::icons::MESH.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -119,7 +119,7 @@ pub fn mesh_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { pub fn bundle_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("bundle.svg", crate::icons::BUNDLE.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -129,7 +129,7 @@ pub fn bundle_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> pub fn translate_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("translate.svg", crate::icons::TRANSLATE.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -139,7 +139,7 @@ pub fn translate_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button< pub fn add_bundle_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("add_bundle.svg", crate::icons::ADD_BUNDLE.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -149,7 +149,7 @@ pub fn add_bundle_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button pub fn add_entity_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("add_entity.svg", crate::icons::ADD_ENTITY.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -160,7 +160,7 @@ pub fn add_entity_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button pub fn add_component_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("add_component.svg", crate::icons::ADD_COMPONENT.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { @@ -171,7 +171,7 @@ pub fn add_component_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::But pub fn delete_entity_icon<'a>(x_size: f32, y_size: f32, text: &str) -> egui::Button<'a> { let image = egui::Image::from_bytes("delete_entity.svg", crate::icons::DELETE_ENTITY.as_bytes()) - .max_size(bevy_egui::egui::vec2(x_size, y_size)); + .max_size(bevy_egui_next::egui::vec2(x_size, y_size)); if text.is_empty() { egui::Button::image(image) } else { diff --git a/crates/editor_ui/src/inspector/events_dispatcher.rs b/crates/editor_ui/src/inspector/events_dispatcher.rs index 4044a8d3..54bdc24a 100644 --- a/crates/editor_ui/src/inspector/events_dispatcher.rs +++ b/crates/editor_ui/src/inspector/events_dispatcher.rs @@ -1,6 +1,6 @@ use bevy::{prelude::*, utils::HashMap}; -use bevy_egui::*; +use bevy_egui_next::*; use space_shared::ext::bevy_inspector_egui; use crate::{colors::ERROR_COLOR, prelude::*}; diff --git a/crates/editor_ui/src/inspector/mod.rs b/crates/editor_ui/src/inspector/mod.rs index 1b88cde3..f1d5cb56 100644 --- a/crates/editor_ui/src/inspector/mod.rs +++ b/crates/editor_ui/src/inspector/mod.rs @@ -14,7 +14,7 @@ use bevy::{ utils::HashMap, }; -use bevy_egui::*; +use bevy_egui_next::*; use space_editor_core::prelude::*; use space_prefab::{component::EntityLink, editor_registry::EditorRegistry}; diff --git a/crates/editor_ui/src/inspector/refl_impl.rs b/crates/editor_ui/src/inspector/refl_impl.rs index bb3c3353..7a3bfc92 100644 --- a/crates/editor_ui/src/inspector/refl_impl.rs +++ b/crates/editor_ui/src/inspector/refl_impl.rs @@ -4,7 +4,7 @@ use bevy::{ prelude::{AppTypeRegistry, ResMut}, reflect::Reflect, }; -use bevy_egui::egui; +use bevy_egui_next::egui; use space_shared::ext::bevy_inspector_egui::{ inspector_egui_impls::InspectorEguiImpl, reflect_inspector::InspectorUi, }; diff --git a/crates/editor_ui/src/inspector/resources.rs b/crates/editor_ui/src/inspector/resources.rs index ef7af497..0713a995 100644 --- a/crates/editor_ui/src/inspector/resources.rs +++ b/crates/editor_ui/src/inspector/resources.rs @@ -1,6 +1,6 @@ use bevy::{prelude::*, utils::HashMap}; -use bevy_egui::*; +use bevy_egui_next::*; use space_shared::ext::bevy_inspector_egui; use crate::prelude::*; diff --git a/crates/editor_ui/src/inspector/runtime_assets.rs b/crates/editor_ui/src/inspector/runtime_assets.rs index 99b331e8..92104bf2 100644 --- a/crates/editor_ui/src/inspector/runtime_assets.rs +++ b/crates/editor_ui/src/inspector/runtime_assets.rs @@ -1,6 +1,6 @@ use bevy::{asset::ReflectAsset, prelude::*, utils::HashMap}; -use bevy_egui::*; +use bevy_egui_next::*; use space_shared::ext::bevy_inspector_egui; use crate::prelude::*; diff --git a/crates/editor_ui/src/lib.rs b/crates/editor_ui/src/lib.rs index f442f929..0a021b76 100644 --- a/crates/editor_ui/src/lib.rs +++ b/crates/editor_ui/src/lib.rs @@ -80,7 +80,7 @@ use bevy::{ utils::HashMap, window::PrimaryWindow, }; -use bevy_egui::{egui, EguiContext}; +use bevy_egui_next::{egui, EguiContext}; use game_view::{has_window_changed, GameViewPlugin}; use prelude::{ @@ -125,7 +125,7 @@ pub mod prelude { /// External dependencies for editor crate pub mod ext { - pub use bevy_egui; + pub use bevy_egui_next; pub use bevy_mod_picking; pub use bevy_panorbit_camera; pub use space_shared::ext::*; @@ -155,7 +155,7 @@ impl PluginGroup for EditorPluginGroup { .add(EditorSetsPlugin) .add(EditorDefaultBundlesPlugin) .add(EditorDefaultCameraPlugin) - .add(bevy_egui::EguiPlugin) + .add(bevy_egui_next::EguiPlugin) .add(EventListenerPlugin::::default()) .add(DefaultInspectorConfigPlugin); res = EditorUiPlugin::default().add_plugins_to_group(res); @@ -389,7 +389,7 @@ pub fn game_mode_changed( } pub mod colors { - use bevy_egui::egui::{Color32, Stroke}; + use bevy_egui_next::egui::{Color32, Stroke}; pub fn stroke_default_color() -> Stroke { Stroke::new(1., STROKE_COLOR) diff --git a/crates/editor_ui/src/menu_toolbars.rs b/crates/editor_ui/src/menu_toolbars.rs index 4ece668b..ab4bde8e 100644 --- a/crates/editor_ui/src/menu_toolbars.rs +++ b/crates/editor_ui/src/menu_toolbars.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use bevy::prelude::*; -use bevy_egui::{ +use bevy_egui_next::{ egui::{Align, Align2, Margin, Pos2, Stroke, Widget}, *, }; diff --git a/crates/editor_ui/src/mouse_check.rs b/crates/editor_ui/src/mouse_check.rs index bbf37a49..d50d4b61 100644 --- a/crates/editor_ui/src/mouse_check.rs +++ b/crates/editor_ui/src/mouse_check.rs @@ -1,5 +1,5 @@ use bevy::{prelude::*, window::PrimaryWindow}; -use bevy_egui::EguiContexts; +use bevy_egui_next::EguiContexts; #[derive(Default)] pub struct MouseCheck; diff --git a/crates/editor_ui/src/selection.rs b/crates/editor_ui/src/selection.rs index 5174c402..bcbd74b2 100644 --- a/crates/editor_ui/src/selection.rs +++ b/crates/editor_ui/src/selection.rs @@ -62,6 +62,7 @@ pub fn select_listener( keyboard: Res>, ) { if !pan_orbit_state.0 { + events.clear(); return; } for event in events.read() { diff --git a/crates/editor_ui/src/settings.rs b/crates/editor_ui/src/settings.rs index 58b320ae..90ba061c 100644 --- a/crates/editor_ui/src/settings.rs +++ b/crates/editor_ui/src/settings.rs @@ -2,7 +2,7 @@ use bevy::{ prelude::*, utils::{HashMap, HashSet}, }; -use bevy_egui::*; +use bevy_egui_next::*; use space_editor_core::hotkeys::AllHotkeys; use space_undo::ChangeChainSettings; diff --git a/crates/editor_ui/src/tool.rs b/crates/editor_ui/src/tool.rs index 93e70fcd..de7a54e3 100644 --- a/crates/editor_ui/src/tool.rs +++ b/crates/editor_ui/src/tool.rs @@ -3,7 +3,7 @@ use bevy::prelude::*; use crate::prelude::GameViewTab; pub trait EditorTool { - fn ui(&mut self, ui: &mut bevy_egui::egui::Ui, commands: &mut Commands, world: &mut World); + fn ui(&mut self, ui: &mut bevy_egui_next::egui::Ui, commands: &mut Commands, world: &mut World); fn name(&self) -> &str; } diff --git a/crates/editor_ui/src/tools/gizmo.rs b/crates/editor_ui/src/tools/gizmo.rs index 3ed1f06b..830a922d 100644 --- a/crates/editor_ui/src/tools/gizmo.rs +++ b/crates/editor_ui/src/tools/gizmo.rs @@ -1,5 +1,5 @@ use bevy::{prelude::*, render::camera::CameraProjection}; -use bevy_egui::egui::{self, Key}; +use bevy_egui_next::egui::{self, Key}; use egui_gizmo::*; use space_editor_core::prelude::*; use space_shared::EditorCameraMarker; @@ -276,6 +276,7 @@ impl EditorTool for GizmoTool { .mode(self.gizmo_mode) .interact(ui) { + disable_pan_orbit = true; let new_transform = Transform { translation: Vec3::from(<[f32; 3]>::from( result.translation, @@ -303,7 +304,6 @@ impl EditorTool for GizmoTool { let new_transform = GlobalTransform::from(new_transform); *transform = new_transform.reparented_to(parent_global); transform.set_changed(); - disable_pan_orbit = true; } } continue; @@ -342,6 +342,9 @@ impl EditorTool for GizmoTool { } } } + if ui.ctx().wants_pointer_input() { + disable_pan_orbit = true; + } if disable_pan_orbit { unsafe { diff --git a/crates/editor_ui/src/ui_plugin.rs b/crates/editor_ui/src/ui_plugin.rs index 639c3523..46480043 100644 --- a/crates/editor_ui/src/ui_plugin.rs +++ b/crates/editor_ui/src/ui_plugin.rs @@ -1,6 +1,6 @@ use crate::*; use bevy::prelude::*; -use bevy_egui::egui::{ +use bevy_egui_next::egui::{ FontFamily::{Monospace, Proportional}, FontId, Margin, Rounding, TextStyle as ETextStyle, Vec2, }; diff --git a/crates/prefab/Cargo.toml b/crates/prefab/Cargo.toml index 8cb1e19d..9e17036e 100644 --- a/crates/prefab/Cargo.toml +++ b/crates/prefab/Cargo.toml @@ -20,11 +20,8 @@ serde.workspace = true space_shared.workspace = true space_undo.workspace = true -bevy-scene-hook = "9" -bevy-inspector-egui = { version = "0.22", features = [ - "bevy_pbr", - "highlight_changes", -] } +bevy-scene-hook.workspace = true +bevy-inspector-egui.workspace = true [lints] workspace = true \ No newline at end of file diff --git a/crates/prefab/src/component/shape.rs b/crates/prefab/src/component/shape.rs index 35b69ff4..a6e3516a 100644 --- a/crates/prefab/src/component/shape.rs +++ b/crates/prefab/src/component/shape.rs @@ -1,6 +1,5 @@ use bevy::prelude::*; -use space_shared::ext::bevy_inspector_egui; use space_shared::ext::bevy_inspector_egui::prelude::*; /// Component to setup mesh of prefab diff --git a/crates/shared/Cargo.toml b/crates/shared/Cargo.toml index 52a2aea6..21f85a43 100644 --- a/crates/shared/Cargo.toml +++ b/crates/shared/Cargo.toml @@ -14,12 +14,8 @@ homepage.workspace = true [dependencies] bevy.workspace = true - -bevy-inspector-egui = { version = "0.22", features = [ - "bevy_pbr", - "highlight_changes", -] } -egui_file = { git = "https://github.com/Barugon/egui_file.git", rev = "de5f8f41df160d67be328ab50974966ceb74e70f" } +bevy-inspector-egui.workspace = true +egui_file.workspace = true [lints] workspace = true \ No newline at end of file diff --git a/crates/undo/Cargo.toml b/crates/undo/Cargo.toml index d24c6644..622c80fe 100644 --- a/crates/undo/Cargo.toml +++ b/crates/undo/Cargo.toml @@ -12,7 +12,7 @@ homepage.workspace = true [dependencies] bevy.workspace = true -pretty-type-name = "1.0.1" +pretty-type-name.workspace = true [lints] workspace = true \ No newline at end of file diff --git a/modules/bevy_xpbd_plugin/Cargo.toml b/modules/bevy_xpbd_plugin/Cargo.toml index da8a8e0f..8da1d348 100644 --- a/modules/bevy_xpbd_plugin/Cargo.toml +++ b/modules/bevy_xpbd_plugin/Cargo.toml @@ -12,6 +12,7 @@ description = "Space XPBD plugin for space_editor crate" bevy.workspace = true space_editor_ui.workspace = true bevy_xpbd_3d = {version="0.3.2", default-features = false, features = ["3d", "f32", "collider-from-mesh", "debug-plugin"]} +bevy-inspector-egui.workspace = true [lints] workspace = true \ No newline at end of file diff --git a/modules/bevy_xpbd_plugin/src/collider.rs b/modules/bevy_xpbd_plugin/src/collider.rs index b242d6dd..bf57a021 100644 --- a/modules/bevy_xpbd_plugin/src/collider.rs +++ b/modules/bevy_xpbd_plugin/src/collider.rs @@ -2,7 +2,6 @@ use bevy::prelude::*; use bevy_xpbd_3d::math::*; use bevy_xpbd_3d::prelude::*; -use space_editor_ui::ext::bevy_inspector_egui; use space_editor_ui::ext::bevy_inspector_egui::prelude::*; use space_editor_ui::prelude::MeshPrimitivePrefab; diff --git a/modules/bevy_xpbd_plugin/src/spatial_query.rs b/modules/bevy_xpbd_plugin/src/spatial_query.rs index 2e673ccc..d3ace44d 100644 --- a/modules/bevy_xpbd_plugin/src/spatial_query.rs +++ b/modules/bevy_xpbd_plugin/src/spatial_query.rs @@ -3,8 +3,6 @@ use bevy_xpbd_3d::math::Vector; use bevy_xpbd_3d::{math::Quaternion, prelude::*}; use space_editor_ui::{ext::bevy_inspector_egui::prelude::*, prelude::*}; -use space_editor_ui::ext::bevy_inspector_egui; - use crate::collider::ColliderPrimitive; pub fn register_xpbd_spatial_types(app: &mut App) { diff --git a/src/main.rs b/src/main.rs index 8463d525..60c44ce2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ fn main() { focused: true, fit_canvas_to_parent: true, title: "Space Editor".into(), - resolution: WindowResolution::new(1920., 1080.), + resolution: WindowResolution::new(1600., 900.), visible: true, ..default() }),