Build production-ready editor authoring workflows
CI / Format, lint, test, build (push) Waiting to run

This commit is contained in:
Rbanh committed 2026-07-11 12:41:04 -04:00
1 parent cc1fa6ea3b
commit 0553a85220
163 files changed
+34547 -1565

No files matched your search

+82 -3
View File
@@ -1,8 +1,11 @@
use std::path::PathBuf;
use bevy::prelude::*;
use shared::{
ActorId, ActorKind, ActorName, BrushDesc, ColliderDesc, EditorVisibility, InspectorOrder,
LightDesc, MaterialDesc, MaterialOverride, ModelRef, ObjectiveMarker, PhysicsBody,
PostProcessVolumeDesc, PrefabInstance, PrefabRef, Primitive, RigidBodyDesc, StaticMeshRenderer,
ActorId, ActorKind, ActorName, AnimationControllerDesc, AudioListenerDesc, AudioSourceDesc,
BrushDesc, ColliderDesc, EditorVisibility, InspectorOrder, LightDesc, MaterialDesc,
MaterialOverride, ModelRef, ObjectiveMarker, PhysicsBody, PostProcessVolumeDesc,
PrefabInstance, PrefabRef, Primitive, RigidBodyDesc, SceneComposition, StaticMeshRenderer,
TeamSpawn, TriggerVolume, WeaponSpawn,
};
#[derive(Debug, Clone)]
@@ -21,6 +24,9 @@ pub struct EditorEntitySnapshot {
pub collider: Option<ColliderDesc>,
pub physics: Option<PhysicsBody>,
pub light: Option<LightDesc>,
pub animation_controller: Option<AnimationControllerDesc>,
pub audio_source: Option<AudioSourceDesc>,
pub audio_listener: Option<AudioListenerDesc>,
pub player_spawn: bool,
pub model: Option<ModelRef>,
pub prefab: Option<PrefabRef>,
@@ -42,6 +48,17 @@ pub struct SiblingChange {
pub new_parent: Option<Entity>,
pub old_index: i32,
pub new_index: i32,
pub old_transform: Option<Transform>,
pub new_transform: Option<Transform>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct PrefabEditState {
pub instance: Option<PrefabInstance>,
pub prefab_ref: Option<PrefabRef>,
pub blocked_reason: Option<String>,
pub transform: Option<Transform>,
pub material: Option<MaterialDesc>,
}
#[derive(Debug, Clone)]
@@ -77,6 +94,11 @@ pub enum EditorCommand {
old: Option<MaterialDesc>,
new: MaterialDesc,
},
SetMaterialGroup {
entities: Vec<Entity>,
olds: Vec<Option<MaterialDesc>>,
news: Vec<MaterialDesc>,
},
SetMaterialOverride {
entity: Entity,
old: Option<MaterialOverride>,
@@ -87,6 +109,21 @@ pub enum EditorCommand {
old: Option<LightDesc>,
new: LightDesc,
},
SetAnimationController {
entity: Entity,
old: Option<AnimationControllerDesc>,
new: AnimationControllerDesc,
},
SetAudioSource {
entity: Entity,
old: Option<AudioSourceDesc>,
new: AudioSourceDesc,
},
SetAudioListener {
entity: Entity,
old: Option<AudioListenerDesc>,
new: AudioListenerDesc,
},
SetPhysics {
entity: Entity,
old: Option<PhysicsBody>,
@@ -165,6 +202,35 @@ pub enum EditorCommand {
old: Option<InspectorOrder>,
new: InspectorOrder,
},
SetSceneComposition {
old: SceneComposition,
new: SceneComposition,
},
SetPrefabState {
entity: Entity,
old: PrefabEditState,
new: PrefabEditState,
},
ApplyPrefabToSource {
entity: Entity,
source_path: PathBuf,
before_source: String,
after_source: String,
old: PrefabEditState,
new: PrefabEditState,
},
UnpackPrefab {
entity: Entity,
instance: PrefabInstance,
prefab_ref: PrefabRef,
linked_actor_kind: ActorKind,
fully_local: bool,
linked_local_snapshots: Vec<EditorEntitySnapshot>,
linked_local_roots: Vec<Entity>,
unpacked_snapshots: Vec<EditorEntitySnapshot>,
unpacked_parented_to_anchor: Vec<bool>,
unpacked_roots: Vec<Entity>,
},
AddComponent {
entity: Entity,
snapshot: EditorEntitySnapshot,
@@ -185,8 +251,12 @@ impl EditorCommand {
EditorCommand::Rename { .. } => "Rename",
EditorCommand::SetTransform { .. } => "Move",
EditorCommand::SetMaterial { .. } => "Set Material",
EditorCommand::SetMaterialGroup { .. } => "Apply Material to Selection",
EditorCommand::SetMaterialOverride { .. } => "Set Material Override",
EditorCommand::SetLight { .. } => "Set Light",
EditorCommand::SetAnimationController { .. } => "Set Animation Controller",
EditorCommand::SetAudioSource { .. } => "Set Audio Source",
EditorCommand::SetAudioListener { .. } => "Set Audio Listener",
EditorCommand::SetPhysics { .. } => "Set Physics",
EditorCommand::SetRigidBody { .. } => "Set Rigid Body",
EditorCommand::SetCollider { .. } => "Set Collider",
@@ -202,6 +272,15 @@ impl EditorCommand {
EditorCommand::ReorderSibling { .. } => "Reorder Hierarchy",
EditorCommand::SetEditorVisibility { .. } => "Set Visibility",
EditorCommand::SetInspectorOrder { .. } => "Set Component Order",
EditorCommand::SetSceneComposition { .. } => "Set Scene Composition",
EditorCommand::SetPrefabState { .. } => "Edit Prefab Instance",
EditorCommand::ApplyPrefabToSource { .. } => "Apply Prefab to Source",
EditorCommand::UnpackPrefab {
fully_local: true, ..
} => "Convert Prefab to Local",
EditorCommand::UnpackPrefab {
fully_local: false, ..
} => "Unpack Prefab Layer",
EditorCommand::AddComponent { .. } => "Add Component",
EditorCommand::RemoveComponent { .. } => "Remove Component",
}