Upgrade to Bevy 0.19 and harden editor workflows
CI / Format, lint, test, build (push) Has been cancelled

This commit is contained in:
Rbanh committed 2026-07-09 23:43:47 -04:00
1 parent 3f85d25cc7
commit b5e561904c
204 files changed
+6972 -29907

No files matched your search

+43 -40
View File
@@ -3,10 +3,9 @@ use std::path::{Path, PathBuf};
use bevy::ecs::entity::EntityHashMap;
use bevy::ecs::system::SystemState;
use bevy::prelude::*;
use bevy::scene::serde::SceneDeserializer;
use bevy::scene::DynamicScene;
use bevy::scene::DynamicSceneBuilder;
use bevy::window::PrimaryWindow;
use bevy::world_serialization::serde::WorldDeserializer;
use bevy::world_serialization::{DynamicWorld, DynamicWorldBuilder};
use scene::{document::SceneDocument, strip_schema_version, validate_level_text};
use serde::de::DeserializeSeed;
use shared::{
@@ -469,42 +468,42 @@ fn save_entities(world: &mut World, path: &Path, entities: Vec<Entity>) -> Resul
}
}
let scene = DynamicSceneBuilder::from_world(world)
.deny_all()
.allow_component::<Name>()
.allow_component::<Transform>()
.allow_component::<ChildOf>()
.allow_component::<LevelObject>()
.allow_component::<ActorId>()
.allow_component::<ActorName>()
.allow_component::<ActorKind>()
.allow_component::<InspectorOrder>()
.allow_component::<Primitive>()
.allow_component::<BrushDesc>()
.allow_component::<StaticMeshRenderer>()
.allow_component::<MaterialDesc>()
.allow_component::<MaterialOverride>()
.allow_component::<RigidBodyDesc>()
.allow_component::<ColliderDesc>()
.allow_component::<PhysicsBody>()
.allow_component::<LightDesc>()
.allow_component::<PlayerSpawn>()
.allow_component::<ModelRef>()
.allow_component::<PrefabRef>()
.allow_component::<PrefabInstance>()
.allow_component::<WeaponSpawn>()
.allow_component::<TriggerVolume>()
.allow_component::<PostProcessVolumeDesc>()
.allow_component::<TeamSpawn>()
.allow_component::<ObjectiveMarker>()
.allow_component::<HierarchySiblingIndex>()
.allow_component::<EditorVisibility>()
.extract_entities(entities.into_iter())
.remove_empty_entities()
.build();
let ron = {
let registry = world.resource::<AppTypeRegistry>().read();
let scene = DynamicWorldBuilder::from_world(world, &registry)
.deny_all()
.allow_component::<Name>()
.allow_component::<Transform>()
.allow_component::<ChildOf>()
.allow_component::<LevelObject>()
.allow_component::<ActorId>()
.allow_component::<ActorName>()
.allow_component::<ActorKind>()
.allow_component::<InspectorOrder>()
.allow_component::<Primitive>()
.allow_component::<BrushDesc>()
.allow_component::<StaticMeshRenderer>()
.allow_component::<MaterialDesc>()
.allow_component::<MaterialOverride>()
.allow_component::<RigidBodyDesc>()
.allow_component::<ColliderDesc>()
.allow_component::<PhysicsBody>()
.allow_component::<LightDesc>()
.allow_component::<PlayerSpawn>()
.allow_component::<ModelRef>()
.allow_component::<PrefabRef>()
.allow_component::<PrefabInstance>()
.allow_component::<WeaponSpawn>()
.allow_component::<TriggerVolume>()
.allow_component::<PostProcessVolumeDesc>()
.allow_component::<TeamSpawn>()
.allow_component::<ObjectiveMarker>()
.allow_component::<HierarchySiblingIndex>()
.allow_component::<EditorVisibility>()
.extract_entities(entities.into_iter())
.remove_empty_entities()
.build();
scene
.serialize(&registry)
.map_err(|err| format!("could not serialize scene: {err}"))?
@@ -536,10 +535,12 @@ fn load_level(world: &mut World, path: &Path) -> Result<(), String> {
clear_loaded_scene_roots(world);
clear_level_objects(world);
let dynamic_scene: DynamicScene = {
let dynamic_scene: DynamicWorld = {
let registry = world.resource::<AppTypeRegistry>().read();
let scene_deserializer = SceneDeserializer {
let mut asset_server = world.resource::<AssetServer>().clone();
let scene_deserializer = WorldDeserializer {
type_registry: &registry,
load_from_path: &mut asset_server,
};
let mut deserializer =
ron::de::Deserializer::from_str(&bevy_ron).map_err(|err| err.to_string())?;
@@ -590,7 +591,9 @@ fn finalize_scene_load(world: &mut World) {
)> = SystemState::new(world);
{
let (settings, scene_suns, project_suns) = state.get_mut(world);
let (settings, scene_suns, project_suns) = state
.get_mut(world)
.expect("finalize_scene_load system params should be valid");
game_hot::sync_project_sun_from_settings(settings, scene_suns, project_suns);
}
state.apply(world);