Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code separate. (Move editor to editor crate folder) #113

Merged
merged 12 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 7 additions & 36 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ repository = "https://github.com/rewin123/space_editor"

[workspace.dependencies]
bevy = "0.12"
bevy_egui = "0.23"
egui-gizmo = "0.12"
bevy-scene-hook = "9"
ron = "0.8"
serde = "1"
bevy_panorbit_camera = "0.9"
bevy-inspector-egui = { version = "0.21", features = ["bevy_pbr", "highlight_changes"]}
pretty-type-name = "1.0"
bevy_mod_picking = {version = "0.17", default-features = false, features = ["backend_raycast", "selection"]}
bevy_debug_grid = "0.3"
egui_dock = "0.8"
egui_file = "0.11"

# Editor Crates
prefab = { path = "crates/prefab" }
Expand All @@ -33,34 +21,17 @@ undo = { path = "crates/undo" }
persistence = { path = "crates/persistence" }
editor_core = { path = "crates/editor_core", features = ["persistence_editor"] }
editor = { path = "crates/editor" }

# Community Modules
bevy_xpbd_plugin = { path = "modules/bevy_xpbd_plugin" }
ron = "0.8"
serde = "1"

[dependencies]
bevy.workspace = true
bevy_egui.workspace = true
egui-gizmo.workspace = true
bevy-scene-hook.workspace = true
ron.workspace = true
serde.workspace = true
bevy_panorbit_camera.workspace = true
bevy-inspector-egui.workspace = true
pretty-type-name.workspace = true
bevy_mod_picking.workspace = true
bevy_debug_grid.workspace = true
egui_dock.workspace = true
egui_file.workspace = true

prefab.workspace = true
shared.workspace = true
undo.workspace = true
persistence.workspace = true
editor_core.workspace = true
editor.workspace = true
prefab.workspace = true

# Modules for external crates
bevy_xpbd_plugin = { path = "modules/bevy_xpbd_plugin", optional = true }

bevy_xpbd_plugin = { workspace = true, optional = true }
bevy_xpbd_3d = {version="0.3", default-features = false, optional = true}

# For versions 1.74+
[lints.rust]
Expand All @@ -84,7 +55,7 @@ too_many_arguments = { level = "allow", priority = 2 }
opt-level = 3

[features]
bevy_xpbd_3d = ["dep:bevy_xpbd_3d", "bevy_xpbd_3d/debug-plugin", "bevy_xpbd_3d/3d", "bevy_xpbd_3d/collider-from-mesh", "bevy_xpbd_3d/f32", "dep:bevy_xpbd_plugin"]
bevy_xpbd_3d = ["dep:bevy_xpbd_plugin"]
persistence_editor = []
default = ["bevy_xpbd_3d", "persistence_editor"]

Expand Down
16 changes: 16 additions & 0 deletions crates/editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,19 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bevy.workspace = true
editor_core.workspace = true
prefab.workspace = true
undo.workspace = true
persistence.workspace = true
shared.workspace = true

bevy_egui = "0.23"
egui-gizmo = "0.12"
egui_dock = "0.8"

bevy_debug_grid = "0.3"

bevy_mod_picking = {version = "0.17", default-features = false, features = ["backend_raycast", "selection"]}
bevy_panorbit_camera = "0.9"
pretty-type-name = "1.0.1"
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ impl Plugin for AssetDetectorPlugin {
fn build(&self, app: &mut App) {
app.init_resource::<DetectedAssets>();

app.add_systems(
Startup,
detect_assets.before(crate::editor::ui_camera_block),
);
app.add_systems(Startup, detect_assets.before(crate::ui_camera_block));
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/editor/ui/bot_menu.rs → crates/editor/src/bot_menu.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use bevy::prelude::*;
use bevy_egui::*;
use editor_core::{BackgroundTask, BackgroundTaskStorage, EditorLoadSet, EditorLoader};
use editor_core::prelude::*;
use prefab::plugins::PrefabPlugin;
use shared::*;
use shared::{ext::egui_file, *};

/// Plugin to activate bot menu in editor UI
pub struct BotMenuPlugin;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::editor_tab::*;
use bevy::prelude::*;
use bevy_inspector_egui::*;
use bevy_egui::egui;
use shared::ext::bevy_inspector_egui;

#[derive(Resource)]
pub struct DebugWorldInspector {}
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/editor/ui/hierarchy.rs → crates/editor/src/hierarchy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use std::sync::Arc;

use bevy::{prelude::*, utils::HashMap};
use bevy_egui::*;
use editor_core::{Selected, SelectedPlugin};
use editor_core::prelude::*;
use prefab::editor_registry::EditorRegistry;
use undo::{AddedEntity, NewChange, RemovedEntity, UndoSet};

use crate::editor::ui_registration::BundleReg;
use crate::ui_registration::BundleReg;
use shared::*;

use super::{editor_tab::EditorTabName, EditorUiAppExt, EditorUiRef};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ use bevy::{

use bevy_egui::*;

use bevy_inspector_egui::{
inspector_egui_impls::InspectorEguiImpl, reflect_inspector::InspectorUi,
};
use editor_core::Selected;
use editor_core::prelude::*;
use prefab::{component::EntityLink, editor_registry::EditorRegistry};
use shared::ext::bevy_inspector_egui::{
self, inspector_egui_impls::InspectorEguiImpl, reflect_inspector::InspectorUi,
};

use self::{
components_order::{ComponentsOrder, ComponentsPriority},
Expand Down Expand Up @@ -310,6 +310,6 @@ pub fn inspect(ui: &mut egui::Ui, world: &mut World, open_components: &mut HashM
state.commands = commands;

if disable_pan_orbit {
world.resource_mut::<crate::editor::PanOrbitEnabled>().0 = false;
world.resource_mut::<crate::PanOrbitEnabled>().0 = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bevy::{
reflect::Reflect,
};
use bevy_egui::egui;
use bevy_inspector_egui::{
use shared::ext::bevy_inspector_egui::{
inspector_egui_impls::InspectorEguiImpl, reflect_inspector::InspectorUi,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use bevy::{prelude::*, utils::HashMap};

use bevy_egui::*;
use shared::ext::bevy_inspector_egui;

use crate::editor::ui::editor_tab::EditorTab;
use crate::prelude::*;

#[derive(Resource, Default)]
pub struct ResourceTab {
Expand Down
Loading