From 373f18cef22aa1e72891a6c2dccc2a6c381db3d3 Mon Sep 17 00:00:00 2001 From: Franklin Date: Wed, 8 Nov 2023 13:36:17 -0400 Subject: [PATCH] Back to editor_pls --- Cargo.lock | 155 +++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + src/setup/equipment.rs | 4 +- src/ui/editor/inspector.rs | 1 + src/ui/editor/plugin.rs | 8 +- 5 files changed, 165 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b7517d..28cf293 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -556,6 +556,47 @@ dependencies = [ "syn 2.0.32", ] +[[package]] +name = "bevy_editor_pls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad89c9f0101deb1740a0ed851230ebe358f4e8e2e8fa11e486fe3382d509db5f" +dependencies = [ + "bevy", + "bevy_editor_pls_core", + "bevy_editor_pls_default_windows", + "egui", + "egui-gizmo", +] + +[[package]] +name = "bevy_editor_pls_core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20ee315c228079cced43eff70f610d39808f15ec6856bb08f0179ed3421ac54" +dependencies = [ + "bevy", + "bevy-inspector-egui", + "egui_dock", + "indexmap 2.0.0", +] + +[[package]] +name = "bevy_editor_pls_default_windows" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d03b3131877fb7af66d7a3b9597b2bc05e02c6a978c91ead74a6c4bf3d01372b" +dependencies = [ + "bevy", + "bevy-inspector-egui", + "bevy_editor_pls_core", + "bevy_mod_debugdump", + "egui-gizmo", + "indexmap 2.0.0", + "opener", + "pretty-type-name", +] + [[package]] name = "bevy_egui" version = "0.22.0" @@ -779,6 +820,21 @@ dependencies = [ "glam", ] +[[package]] +name = "bevy_mod_debugdump" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85741df1a1a2aa03ecd2d9f70ba8787846c6b2b91b82ef85f71ed56f87591b15" +dependencies = [ + "bevy_app", + "bevy_ecs", + "bevy_render", + "bevy_utils", + "once_cell", + "petgraph", + "pretty-type-name", +] + [[package]] name = "bevy_pbr" version = "0.11.3" @@ -1202,6 +1258,17 @@ dependencies = [ "objc2-encode", ] +[[package]] +name = "bstr" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" +dependencies = [ + "memchr", + "regex-automata 0.4.3", + "serde", +] + [[package]] name = "bumpalo" version = "3.13.0" @@ -1579,6 +1646,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "duplicate" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de78e66ac9061e030587b2a2e75cc88f22304913c907b11307bca737141230cb" +dependencies = [ + "heck", + "proc-macro-error", +] + [[package]] name = "ecolor" version = "0.23.0" @@ -1599,6 +1676,27 @@ dependencies = [ "nohash-hasher", ] +[[package]] +name = "egui-gizmo" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f732ad247afe275d6cf901e0f134025ad735007c8f4d82e667a6871f1b4a5441" +dependencies = [ + "egui", + "glam", +] + +[[package]] +name = "egui_dock" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a52f67bcab0eb6050cf8051c614966c1c57129fab23dbeae9c157214779053c7" +dependencies = [ + "duplicate", + "egui", + "paste", +] + [[package]] name = "either" version = "1.9.0" @@ -1707,6 +1805,7 @@ version = "0.1.0" dependencies = [ "bevy", "bevy-inspector-egui", + "bevy_editor_pls", "bevy_hanabi", "bevy_rapier3d", ] @@ -2062,6 +2161,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "hexasphere" version = "9.1.0" @@ -2627,6 +2732,15 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "normpath" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec60c60a693226186f5d6edf073232bfb6464ed97eb22cf3b01c1e8198fd97f5" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "notify" version = "6.1.1" @@ -2870,6 +2984,17 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +[[package]] +name = "opener" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c62dcb6174f9cb326eac248f07e955d5d559c272730b6c03e396b443b562788" +dependencies = [ + "bstr", + "normpath", + "winapi", +] + [[package]] name = "optional" version = "0.5.0" @@ -3034,6 +3159,30 @@ dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" version = "1.0.66" @@ -3188,6 +3337,12 @@ dependencies = [ "regex-syntax 0.7.5", ] +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" + [[package]] name = "regex-syntax" version = "0.6.29" diff --git a/Cargo.toml b/Cargo.toml index 90f938e..002ab3c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,5 +17,6 @@ opt-level = 3 [dependencies] bevy = { version = "0.11", features = ["dynamic_linking"]} bevy-inspector-egui = "0.20.0" +bevy_editor_pls = "0.5" bevy_rapier3d = { version = "0.22.0", features = ["debug-render-3d"] } bevy_hanabi = { version = "0.7", default-features = false, features = [ "3d" ] } \ No newline at end of file diff --git a/src/setup/equipment.rs b/src/setup/equipment.rs index 78f9cfc..67126fc 100644 --- a/src/setup/equipment.rs +++ b/src/setup/equipment.rs @@ -26,7 +26,9 @@ pub fn change_equipment( ) { for equipment_change_event in equipment_change_event_reader.iter() { // TODO: Equipment change - let (mut player, player_firing_info) = player_query.single_mut() ; + let Ok((mut player, player_firing_info)) = player_query.get_single_mut() else { + return; + } ; // Primary firearm change if equipment_change_event.0.primary_firearm != player.0.equipment.primary_firearm { diff --git a/src/ui/editor/inspector.rs b/src/ui/editor/inspector.rs index 21b1e69..93805d2 100644 --- a/src/ui/editor/inspector.rs +++ b/src/ui/editor/inspector.rs @@ -1,6 +1,7 @@ use bevy::{prelude::*, window::PrimaryWindow}; use bevy_inspector_egui::{egui, bevy_egui::EguiContext, bevy_inspector}; +#[allow(unused)] pub fn inspector_ui(world: &mut World) { let mut egui_context = world .query_filtered::<&mut EguiContext, With>() diff --git a/src/ui/editor/plugin.rs b/src/ui/editor/plugin.rs index 41e419c..dfcdd40 100644 --- a/src/ui/editor/plugin.rs +++ b/src/ui/editor/plugin.rs @@ -1,9 +1,10 @@ use bevy::prelude::*; +use bevy_editor_pls::EditorPlugin; use bevy_inspector_egui::bevy_egui::EguiPlugin; use crate::{logic::core::{guns::{player_firing::PlayerFiringInfo, caliber::Caliber, firearm::Firearm, spray_pattern::FirearmSprayPattern}, player::{player_values_state::PlayerValuesState, camera_player_sync::MouseMovementSettings, player_movement::{PlayerLinearYState, PlayerLinearXZState, PlayerMovementInput}}}, comps::core::markers::{firearm::{FirearmData, MagazineData}, holdable::{HoldableObjectData, InPlayerHands}, player::{PlayerData, Player, PlayerHand}}, scenes::scene1::skybox::Cubemap, setup::{animations::{AllFirearmAnimations, FirearmAnimations}, assets::{GltfAssetType, GltfAssets}, equipment::Equipment, load_state::GameLoadState}}; -use super::inspector::inspector_ui; +//use super::inspector::inspector_ui; //use super::{panels::editor_ui, state::EditorUiState, camera::set_camera_viewport}; @@ -36,8 +37,9 @@ impl Plugin for MainEditorUiPlugin { .register_type::() .register_type::() .add_plugins(EguiPlugin) - .add_plugins(bevy_inspector_egui::DefaultInspectorConfigPlugin) // adds default options and `InspectorEguiImpl`s - .add_systems(Update, inspector_ui); + .add_plugins(EditorPlugin::default()); + //.add_plugins(bevy_inspector_egui::DefaultInspectorConfigPlugin) // adds default options and `InspectorEguiImpl`s + //.add_systems(Update, inspector_ui); //app.insert_resource(EditorUiState::new()); //app.add_systems(Update, editor_ui); //app.add_systems(PostUpdate, set_camera_viewport);