diff --git a/Cargo.lock b/Cargo.lock index ac732d1aa..05ea7c117 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -24,12 +24,6 @@ version = "1.0.2" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "adler32" -version = "1.2.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" - [[package]] name = "aead" version = "0.5.1" @@ -137,17 +131,18 @@ dependencies = [ [[package]] name = "arboard" -version = "2.1.1" +version = "3.2.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "dc120354d1b5ec6d7aaf4876b602def75595937b5e15d356eb554ab5177e08bb" +checksum = "d6041616acea41d67c4a984709ddab1587fd0b10efe5cc563fee954d2f011854" dependencies = [ "clipboard-win", "core-graphics", - "image 0.23.14", + "image", "log", "objc", "objc-foundation", "objc_id", + "once_cell", "parking_lot", "thiserror", "winapi", @@ -245,22 +240,36 @@ dependencies = [ [[package]] name = "bevy-inspector-egui" -version = "0.15.0" +version = "0.17.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "cd4c06a380d02588eac43f8a56d2d370614fe6b2e7467041e57b064e93ec7620" +checksum = "8be4f9fa859e4840e7cbcc0ddf2c8a1441ff8f663c317769c5ccc70cdf13bcf2" dependencies = [ - "bevy", "bevy-inspector-egui-derive", + "bevy_app", + "bevy_asset", + "bevy_core", + "bevy_core_pipeline", + "bevy_ecs", "bevy_egui", - "image 0.24.5", + "bevy_hierarchy", + "bevy_log", + "bevy_math", + "bevy_pbr", + "bevy_reflect", + "bevy_render", + "bevy_utils", + "egui", + "image", + "once_cell", "pretty-type-name", + "smallvec", ] [[package]] name = "bevy-inspector-egui-derive" -version = "0.15.0" +version = "0.17.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "2c6a0ceb52115321ef304a5a875e975bba5bbf2ceb802e1dfa07221e8bbc8178" +checksum = "97826e6225a5b56e77683e7b99418171f7531d48682b8531252dc6b8ef3e8113" dependencies = [ "proc-macro2", "quote", @@ -328,6 +337,30 @@ dependencies = [ "web-sys", ] +[[package]] +name = "bevy_atmosphere" +version = "0.5.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "02d0fb49de99c783686315bace987bbee486204a5757b9b7963fd7d8f7874515" +dependencies = [ + "bevy", + "bevy_atmosphere_macros", + "cfg-if", +] + +[[package]] +name = "bevy_atmosphere_macros" +version = "0.1.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "3e84e7a73a93169b0a23952996c846faeca2e177f3badc1d2298bad030f62cd7" +dependencies = [ + "bevy_macro_utils", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "bevy_audio" version = "0.9.1" @@ -439,9 +472,9 @@ dependencies = [ [[package]] name = "bevy_egui" -version = "0.18.0" +version = "0.19.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "f93fab81b00d664b7fd09c74eadcc8ab4a608649af1fb355647cd43f95f38ec6" +checksum = "fbb8036050af170243e803eb68e0b5d34f549828a8de92479619fb6dac842f85" dependencies = [ "arboard", "bevy", @@ -722,7 +755,7 @@ dependencies = [ "futures-lite", "hex", "hexasphere", - "image 0.24.5", + "image", "naga", "once_cell", "parking_lot", @@ -1304,11 +1337,12 @@ version = "0.0.2" dependencies = [ "bevy", "bevy-inspector-egui", + "bevy_atmosphere", "bevy_rapier3d", "bevy_renet", "bincode", "cosmos_core", - "image 0.24.5", + "image", "iyes_loopless", "local-ip-address", "noise", @@ -1326,7 +1360,7 @@ dependencies = [ "bevy_rapier3d", "bevy_renet", "bincode", - "image 0.24.5", + "image", "iyes_loopless", "local-ip-address", "noise", @@ -1527,16 +1561,6 @@ dependencies = [ "syn", ] -[[package]] -name = "deflate" -version = "0.8.6" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" -dependencies = [ - "adler32", - "byteorder", -] - [[package]] name = "discard" version = "1.0.4" @@ -2062,22 +2086,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "image" -version = "0.23.14" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" -dependencies = [ - "bytemuck", - "byteorder", - "color_quant", - "num-iter", - "num-rational 0.3.2", - "num-traits", - "png 0.16.8", - "tiff", -] - [[package]] name = "image" version = "0.24.5" @@ -2087,10 +2095,11 @@ dependencies = [ "bytemuck", "byteorder", "color_quant", - "num-rational 0.4.1", + "num-rational", "num-traits", - "png 0.17.7", + "png", "scoped_threadpool", + "tiff", ] [[package]] @@ -2223,9 +2232,9 @@ dependencies = [ [[package]] name = "jpeg-decoder" -version = "0.1.22" +version = "0.3.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" +checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" [[package]] name = "js-sys" @@ -2424,25 +2433,6 @@ version = "0.2.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.3.7" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" -dependencies = [ - "adler32", -] - -[[package]] -name = "miniz_oxide" -version = "0.4.4" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" -dependencies = [ - "adler", - "autocfg", -] - [[package]] name = "miniz_oxide" version = "0.5.4" @@ -2506,7 +2496,7 @@ dependencies = [ "matrixmultiply", "nalgebra-macros", "num-complex", - "num-rational 0.4.1", + "num-rational", "num-traits", "serde", "simba", @@ -2617,9 +2607,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.22.3" +version = "0.23.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" +checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" dependencies = [ "bitflags", "cc", @@ -2630,12 +2620,11 @@ dependencies = [ [[package]] name = "nix" -version = "0.23.1" +version = "0.24.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags", - "cc", "cfg-if", "libc", "memoffset", @@ -2741,28 +2730,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.3.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.1" @@ -3006,18 +2973,6 @@ version = "0.3.26" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" -[[package]] -name = "png" -version = "0.16.8" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" -dependencies = [ - "bitflags", - "crc32fast", - "deflate", - "miniz_oxide 0.3.7", -] - [[package]] name = "png" version = "0.17.7" @@ -3681,12 +3636,12 @@ dependencies = [ [[package]] name = "tiff" -version = "0.6.1" +version = "0.8.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "9a53f4706d65497df0c4349241deddf35f84cee19c87ed86ea8ca590f4464437" +checksum = "7449334f9ff2baf290d55d73983a7d6fa15e01198faef72af07e2a8db851e471" dependencies = [ + "flate2", "jpeg-decoder", - "miniz_oxide 0.4.4", "weezl", ] @@ -4358,14 +4313,24 @@ dependencies = [ [[package]] name = "x11rb" -version = "0.9.0" +version = "0.10.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6e99be55648b3ae2a52342f9a870c0e138709a3493261ce9b469afe6e4df6d8a" +checksum = "592b4883219f345e712b3209c62654ebda0bb50887f330cbd018d0f654bfd507" dependencies = [ "gethostname", - "nix 0.22.3", + "nix 0.24.3", "winapi", "winapi-wsapoll", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.10.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "56b245751c0ac9db0e006dc812031482784e434630205a93c73cfefcaabeac67" +dependencies = [ + "nix 0.24.3", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 2fb32250f..971ba7544 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,9 @@ iyes_loopless = "0.9.1" image = { version = "0.24.5", default-features = false, features = ["png"]} -bevy-inspector-egui = "0.15.0" +bevy-inspector-egui = "0.17.0" + +bevy_atmosphere = "0.5.0" # For any non workspace package [profile.dev.package."*"] diff --git a/cosmos_client/Cargo.toml b/cosmos_client/Cargo.toml index 0e55da388..c715e3673 100644 --- a/cosmos_client/Cargo.toml +++ b/cosmos_client/Cargo.toml @@ -18,6 +18,7 @@ rand = { workspace = true } local-ip-address = { workspace = true } iyes_loopless = { workspace = true } bevy_rapier3d = { workspace = true } +bevy_atmosphere = { workspace = true } image = { workspace = true } diff --git a/cosmos_client/src/main.rs b/cosmos_client/src/main.rs index f24d17011..74516084d 100644 --- a/cosmos_client/src/main.rs +++ b/cosmos_client/src/main.rs @@ -40,7 +40,6 @@ use crate::plugin::client_plugin::ClientPluginGroup; use crate::rendering::structure_renderer::monitor_block_updates_system; use crate::rendering::uv_mapper::UVMapper; use bevy::prelude::*; -use bevy_inspector_egui::WorldInspectorPlugin; use bevy_rapier3d::prelude::{RapierConfiguration, Vect, Velocity}; use bevy_renet::RenetClientPlugin; use cosmos_core::plugin::cosmos_core_plugin::CosmosCorePluginGroup; @@ -262,7 +261,6 @@ fn main() { )) .add_plugins(ClientPluginGroup::default()) .add_plugin(RenetClientPlugin::default()) - .add_plugin(WorldInspectorPlugin::new()) // .add_plugin(RapierDebugRenderPlugin::default()) .add_system_set( SystemSet::on_enter(GameState::Connecting).with_system(connect::establish_connection), diff --git a/cosmos_client/src/structure/systems/player_interactions.rs b/cosmos_client/src/structure/systems/player_interactions.rs index 99791bda3..ec40bedfc 100644 --- a/cosmos_client/src/structure/systems/player_interactions.rs +++ b/cosmos_client/src/structure/systems/player_interactions.rs @@ -1,8 +1,10 @@ -use bevy::prelude::{ - Added, App, Commands, Component, Entity, Input, KeyCode, MouseButton, Query, RemovedComponents, - Res, ResMut, SystemSet, With, +use bevy::{ + prelude::{ + Added, App, Commands, Component, Entity, Input, KeyCode, MouseButton, Query, + RemovedComponents, Res, ResMut, SystemSet, With, + }, + reflect::{FromReflect, Reflect}, }; -use bevy_inspector_egui::{Inspectable, RegisterInspectable}; use bevy_renet::renet::RenetClient; use cosmos_core::{ netty::{client_unreliable_messages::ClientUnreliableMessages, NettyChannel}, @@ -15,7 +17,7 @@ use crate::{ state::game_state::GameState, }; -#[derive(Component, Default, Inspectable)] +#[derive(Component, Default, Reflect, FromReflect)] struct HoveredSystem { system_index: usize, active: bool, @@ -106,5 +108,5 @@ pub fn register(app: &mut App) { .with_system(check_removed_pilot) .with_system(swap_selected), ) - .register_inspectable::(); + .register_type::(); } diff --git a/cosmos_core/src/block/mod.rs b/cosmos_core/src/block/mod.rs index 9067e10ba..0be26c123 100644 --- a/cosmos_core/src/block/mod.rs +++ b/cosmos_core/src/block/mod.rs @@ -1,8 +1,8 @@ use bevy::{ ecs::schedule::StateData, prelude::{App, Vec3}, + reflect::{FromReflect, Reflect}, }; -use bevy_inspector_egui::Inspectable; use crate::registry::identifiable::Identifiable; @@ -18,7 +18,7 @@ pub enum BlockProperty { ShipOnly, } -#[derive(Debug, PartialEq, Eq, Inspectable, Default, Copy, Clone)] +#[derive(Debug, PartialEq, Eq, Reflect, FromReflect, Default, Copy, Clone)] pub enum BlockFace { #[default] Front, @@ -171,4 +171,6 @@ pub fn register( ) { blocks::register(app, pre_loading_state, loading_state); hardness::register(app, pre_loading_state, loading_state, post_loading_state); + + app.register_type::(); } diff --git a/cosmos_core/src/inventory/itemstack.rs b/cosmos_core/src/inventory/itemstack.rs index daec0fa65..c6c6607be 100644 --- a/cosmos_core/src/inventory/itemstack.rs +++ b/cosmos_core/src/inventory/itemstack.rs @@ -1,10 +1,12 @@ -use bevy::prelude::App; -use bevy_inspector_egui::{Inspectable, RegisterInspectable}; +use bevy::{ + prelude::App, + reflect::{FromReflect, Reflect}, +}; use serde::{Deserialize, Serialize}; use crate::{item::Item, registry::identifiable::Identifiable}; -#[derive(Serialize, Deserialize, Debug, Inspectable)] +#[derive(Serialize, Deserialize, Debug, Reflect, FromReflect)] pub struct ItemStack { item_id: u16, quantity: u16, @@ -80,5 +82,5 @@ impl ItemStack { } pub fn register(app: &mut App) { - app.register_inspectable::(); + app.register_type::(); } diff --git a/cosmos_core/src/inventory/mod.rs b/cosmos_core/src/inventory/mod.rs index 8214a0df7..822f67759 100644 --- a/cosmos_core/src/inventory/mod.rs +++ b/cosmos_core/src/inventory/mod.rs @@ -1,5 +1,7 @@ -use bevy::prelude::{App, Component}; -use bevy_inspector_egui::{Inspectable, RegisterInspectable}; +use bevy::{ + prelude::{App, Component}, + reflect::{FromReflect, Reflect}, +}; use serde::{Deserialize, Serialize}; use crate::{item::Item, registry::identifiable::Identifiable}; @@ -14,7 +16,7 @@ pub mod itemstack; // NormalInventory, // These inventories are organizable by the player // } -#[derive(Default, Component, Serialize, Deserialize, Debug, Inspectable)] +#[derive(Default, Component, Serialize, Deserialize, Debug, Reflect, FromReflect)] pub struct Inventory { items: Vec>, } @@ -138,5 +140,5 @@ impl Inventory { pub fn register(app: &mut App) { itemstack::register(app); - app.register_inspectable::(); + app.register_type::(); } diff --git a/cosmos_core/src/plugin/cosmos_core_plugin.rs b/cosmos_core/src/plugin/cosmos_core_plugin.rs index bf27a9e8f..0b8eb9b97 100644 --- a/cosmos_core/src/plugin/cosmos_core_plugin.rs +++ b/cosmos_core/src/plugin/cosmos_core_plugin.rs @@ -11,7 +11,7 @@ use bevy::render::RenderPlugin; use bevy::scene::ScenePlugin; use bevy::time::TimePlugin; use bevy::window::WindowPlugin; -use bevy_inspector_egui::InspectableRegistry; +use bevy_inspector_egui::quick::WorldInspectorPlugin; use bevy_rapier3d::prelude::{NoUserData, RapierPhysicsPlugin}; use crate::{block, inventory, projectiles}; @@ -79,8 +79,6 @@ impl CosmosCorePluginGroup { impl Plugin for CosmosCorePlugin { fn build(&self, app: &mut App) { - app.insert_resource(InspectableRegistry::default()); - loader::register( app, self.pre_loading_state, @@ -123,6 +121,7 @@ impl PluginGroup for CosmosCorePluginGroup { .add(CorePipelinePlugin::default()) .add(RapierPhysicsPlugin::::default()) .add(ImagePlugin::default_nearest()) + .add(WorldInspectorPlugin) .add(CosmosCorePlugin::new( self.pre_loading_state, self.loading_state, diff --git a/cosmos_core/src/structure/mod.rs b/cosmos_core/src/structure/mod.rs index c63b5c80f..e6e4f4d1c 100644 --- a/cosmos_core/src/structure/mod.rs +++ b/cosmos_core/src/structure/mod.rs @@ -515,4 +515,5 @@ pub fn register( events::register(app); loading::register(app); block_health::register(app); + structure_block::register(app); } diff --git a/cosmos_core/src/structure/ship/pilot.rs b/cosmos_core/src/structure/ship/pilot.rs index bd353a071..fc7d1cefe 100644 --- a/cosmos_core/src/structure/ship/pilot.rs +++ b/cosmos_core/src/structure/ship/pilot.rs @@ -1,8 +1,10 @@ -use bevy::prelude::{App, Component, Entity}; -use bevy_inspector_egui::{Inspectable, RegisterInspectable}; +use bevy::{ + prelude::{App, Component, Entity}, + reflect::{FromReflect, Reflect}, +}; /// A pilot component is bi-directional, if a player has the component then the entity it points to also has this component which points to the player. -#[derive(Component, Inspectable)] +#[derive(Component, FromReflect, Reflect)] pub struct Pilot { /// This will either be the ship the player is piloting, or the pilot of the ship /// @@ -11,5 +13,5 @@ pub struct Pilot { } pub fn regiter(app: &mut App) { - app.register_inspectable::(); + app.register_type::(); } diff --git a/cosmos_core/src/structure/ship/ship_movement.rs b/cosmos_core/src/structure/ship/ship_movement.rs index 8cac40f33..6e66c71fd 100644 --- a/cosmos_core/src/structure/ship/ship_movement.rs +++ b/cosmos_core/src/structure/ship/ship_movement.rs @@ -1,12 +1,14 @@ use std::fmt::Display; -use bevy::prelude::{App, Component, Query, Vec3, Without}; -use bevy_inspector_egui::{Inspectable, RegisterInspectable}; +use bevy::{ + prelude::{App, Component, Query, Vec3, Without}, + reflect::{FromReflect, Reflect}, +}; use serde::{Deserialize, Serialize}; use super::pilot::Pilot; -#[derive(Component, Inspectable, Default, Serialize, Deserialize, Debug, Clone)] +#[derive(Component, Default, Serialize, Deserialize, Debug, Clone, FromReflect, Reflect)] pub struct ShipMovement { pub movement: Vec3, pub torque: Vec3, @@ -42,6 +44,6 @@ fn clear_movement_when_no_pilot(mut query: Query<&mut ShipMovement, Without() + app.register_type::() .add_system(clear_movement_when_no_pilot); } diff --git a/cosmos_core/src/structure/structure_block.rs b/cosmos_core/src/structure/structure_block.rs index 2a7c67947..c021edf7a 100644 --- a/cosmos_core/src/structure/structure_block.rs +++ b/cosmos_core/src/structure/structure_block.rs @@ -1,11 +1,16 @@ -use bevy_inspector_egui::Inspectable; +use bevy::{ + prelude::App, + reflect::{FromReflect, Reflect}, +}; use serde::{Deserialize, Serialize}; use crate::{block::Block, registry::Registry}; use super::{chunk::CHUNK_DIMENSIONS, Structure}; -#[derive(Clone, Debug, Inspectable, Copy, PartialEq, Eq, Default, Serialize, Deserialize)] +#[derive( + Clone, Debug, FromReflect, Reflect, Copy, PartialEq, Eq, Default, Serialize, Deserialize, +)] pub struct StructureBlock { pub x: usize, pub y: usize, @@ -67,3 +72,7 @@ impl StructureBlock { self.z / CHUNK_DIMENSIONS } } + +pub(crate) fn register(app: &mut App) { + app.register_type::(); +} diff --git a/cosmos_core/src/structure/systems/energy_generation_system/mod.rs b/cosmos_core/src/structure/systems/energy_generation_system/mod.rs index 9fbb119b6..8a2c18e67 100644 --- a/cosmos_core/src/structure/systems/energy_generation_system/mod.rs +++ b/cosmos_core/src/structure/systems/energy_generation_system/mod.rs @@ -1,5 +1,4 @@ use bevy::{ecs::schedule::StateData, prelude::*, utils::HashMap}; -use bevy_inspector_egui::{Inspectable, RegisterInspectable}; use iyes_loopless::prelude::*; use crate::{ @@ -33,7 +32,7 @@ impl EnergyGenerationBlocks { } } -#[derive(Component, Default, Inspectable)] +#[derive(Component, Default, Reflect, FromReflect)] struct EnergyGenerationSystem { generation_rate: f32, } @@ -145,5 +144,5 @@ pub fn register( ) .add_system_set(SystemSet::on_update(playing_state).with_system(update_energy)) .add_system_set(SystemSet::on_update(playing_state).with_system(structure_loaded_event)) - .register_inspectable::(); + .register_type::(); } diff --git a/cosmos_core/src/structure/systems/energy_storage_system/mod.rs b/cosmos_core/src/structure/systems/energy_storage_system/mod.rs index 573fd7c29..4b34dc7a6 100644 --- a/cosmos_core/src/structure/systems/energy_storage_system/mod.rs +++ b/cosmos_core/src/structure/systems/energy_storage_system/mod.rs @@ -3,9 +3,9 @@ use bevy::{ prelude::{ App, Commands, Component, CoreStage, EventReader, Query, Res, ResMut, Resource, SystemSet, }, + reflect::{FromReflect, Reflect}, utils::HashMap, }; -use bevy_inspector_egui::{Inspectable, RegisterInspectable}; use iyes_loopless::prelude::*; use crate::{ @@ -36,7 +36,7 @@ impl EnergyStorageBlocks { } } -#[derive(Component, Default, Inspectable)] +#[derive(Component, Default, Reflect, FromReflect)] pub struct EnergyStorageSystem { energy: f32, capacity: f32, @@ -136,5 +136,5 @@ pub fn register( block_update_system.run_in_bevy_state(playing_state), ) .add_system_set(SystemSet::on_update(playing_state).with_system(structure_loaded_event)) - .register_inspectable::(); + .register_type::(); } diff --git a/cosmos_core/src/structure/systems/laser_cannon_system/mod.rs b/cosmos_core/src/structure/systems/laser_cannon_system/mod.rs index 2daf8816e..b34d6bf8f 100644 --- a/cosmos_core/src/structure/systems/laser_cannon_system/mod.rs +++ b/cosmos_core/src/structure/systems/laser_cannon_system/mod.rs @@ -3,8 +3,12 @@ use std::{ ops::{Add, AddAssign, SubAssign}, }; -use bevy::{ecs::schedule::StateData, prelude::*, utils::HashMap}; -use bevy_inspector_egui::{Inspectable, RegisterInspectable}; +use bevy::{ + ecs::schedule::StateData, + prelude::*, + reflect::{FromReflect, Reflect}, + utils::HashMap, +}; use iyes_loopless::prelude::*; use crate::{ @@ -16,7 +20,7 @@ use crate::{ use super::Systems; -#[derive(Default, Inspectable, Clone, Copy)] +#[derive(Default, FromReflect, Reflect, Clone, Copy)] pub struct LaserCannonProperty { pub energy_per_shot: f32, } @@ -58,7 +62,7 @@ impl LaserCannonBlocks { } } -#[derive(Inspectable, Default)] +#[derive(FromReflect, Reflect, Default)] pub struct Line { pub start: StructureBlock, pub direction: BlockFace, @@ -115,7 +119,7 @@ impl Line { } } -#[derive(Component, Default, Inspectable)] +#[derive(Component, Default, FromReflect, Reflect)] pub struct LaserCannonSystem { pub lines: Vec, pub last_shot_time: f32, @@ -378,5 +382,5 @@ pub fn register( block_update_system.run_in_bevy_state(playing_state), ) .add_system_set(SystemSet::on_update(playing_state).with_system(structure_loaded_event)) - .register_inspectable::(); + .register_type::(); } diff --git a/cosmos_core/src/structure/systems/thruster_system/mod.rs b/cosmos_core/src/structure/systems/thruster_system/mod.rs index 1e9c7cef8..a03fb54bd 100644 --- a/cosmos_core/src/structure/systems/thruster_system/mod.rs +++ b/cosmos_core/src/structure/systems/thruster_system/mod.rs @@ -4,10 +4,10 @@ use bevy::{ App, Commands, Component, CoreStage, EventReader, Query, Res, ResMut, Resource, SystemSet, Transform, Vec3, With, }, + reflect::{FromReflect, Reflect}, time::Time, utils::HashMap, }; -use bevy_inspector_egui::{Inspectable, RegisterInspectable}; use bevy_rapier3d::prelude::{ExternalImpulse, ReadMassProperties, Velocity}; use iyes_loopless::prelude::*; @@ -45,7 +45,7 @@ impl ThrusterBlocks { } } -#[derive(Component, Default, Inspectable)] +#[derive(Component, Default, Reflect, FromReflect)] pub struct ThrusterSystem { thrust_total: f32, energy_consumption: f32, @@ -214,5 +214,5 @@ pub fn register( ) .add_system_set(SystemSet::on_update(playing_state).with_system(structure_loaded_event)) .add_system_set(SystemSet::on_update(playing_state).with_system(update_movement)) - .register_inspectable::(); + .register_type::(); } diff --git a/cosmos_server/src/main.rs b/cosmos_server/src/main.rs index c74de95d0..bac536c3a 100644 --- a/cosmos_server/src/main.rs +++ b/cosmos_server/src/main.rs @@ -1,6 +1,5 @@ use bevy::prelude::*; use bevy::winit::WinitPlugin; -use bevy_inspector_egui::WorldInspectorPlugin; use bevy_rapier3d::prelude::RapierConfiguration; use bevy_renet::RenetServerPlugin; use cosmos_core::plugin::cosmos_core_plugin::CosmosCorePluginGroup; @@ -36,6 +35,5 @@ fn main() { .add_plugin(RenetServerPlugin::default()) .add_plugin(WinitPlugin::default()) .add_plugin(ServerPlugin) - .add_plugin(WorldInspectorPlugin::new()) .run(); }