Initial project import
CI / Format, lint, test, build (push) Waiting to run

This commit is contained in:
Rbanh committed 2026-06-05 21:44:45 -04:00
commit f29712d158
259 files changed
+52069

No files matched your search

+158
View File
@@ -0,0 +1,158 @@
//! Editor-visible component registry for actor inspector palettes.
use bevy::prelude::*;
use egui_phosphor_icons::icons;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum EditorComponentCategory {
Rendering,
Physics,
Gameplay,
Editor,
}
#[derive(Debug, Clone)]
pub struct EditorComponentDescriptor {
pub type_name: &'static str,
pub display_name: &'static str,
pub category: EditorComponentCategory,
pub addable: bool,
pub removable: bool,
pub reorderable: bool,
pub icon: &'static str,
pub search_terms: &'static [&'static str],
}
#[derive(Resource, Debug, Clone)]
pub struct EditorComponentRegistry {
pub descriptors: Vec<EditorComponentDescriptor>,
}
impl Default for EditorComponentRegistry {
fn default() -> Self {
Self {
descriptors: vec![
EditorComponentDescriptor {
type_name: "shared::components::StaticMeshRenderer",
display_name: "Static Mesh Renderer",
category: EditorComponentCategory::Rendering,
addable: true,
removable: true,
reorderable: true,
icon: icons::CUBE.as_str(),
search_terms: &["mesh", "renderer", "rendering", "model"],
},
EditorComponentDescriptor {
type_name: "shared::components::MaterialDesc",
display_name: "Authoring Material",
category: EditorComponentCategory::Rendering,
addable: true,
removable: true,
reorderable: true,
icon: icons::PALETTE.as_str(),
search_terms: &["material", "shader", "texture"],
},
EditorComponentDescriptor {
type_name: "shared::components::RigidBodyDesc",
display_name: "Rigid Body",
category: EditorComponentCategory::Physics,
addable: true,
removable: true,
reorderable: true,
icon: icons::SPHERE.as_str(),
search_terms: &["body", "physics", "rigidbody"],
},
EditorComponentDescriptor {
type_name: "shared::components::ColliderDesc",
display_name: "Collider",
category: EditorComponentCategory::Physics,
addable: true,
removable: true,
reorderable: true,
icon: icons::SELECTION.as_str(),
search_terms: &["collision", "trigger", "physics"],
},
EditorComponentDescriptor {
type_name: "shared::components::LightDesc",
display_name: "Light",
category: EditorComponentCategory::Rendering,
addable: true,
removable: true,
reorderable: true,
icon: icons::LIGHTBULB.as_str(),
search_terms: &["light", "lamp", "illumination"],
},
EditorComponentDescriptor {
type_name: "shared::components::Primitive",
display_name: "Primitive",
category: EditorComponentCategory::Rendering,
addable: true,
removable: true,
reorderable: true,
icon: icons::CUBE.as_str(),
search_terms: &["box", "sphere", "ramp", "primitive"],
},
EditorComponentDescriptor {
type_name: "shared::components::PlayerSpawn",
display_name: "Player Spawn",
category: EditorComponentCategory::Gameplay,
addable: true,
removable: true,
reorderable: true,
icon: icons::PERSON_SIMPLE_RUN.as_str(),
search_terms: &["player", "spawn", "start"],
},
EditorComponentDescriptor {
type_name: "shared::components::WeaponSpawn",
display_name: "Weapon Spawn",
category: EditorComponentCategory::Gameplay,
addable: true,
removable: true,
reorderable: true,
icon: icons::CROSSHAIR.as_str(),
search_terms: &["weapon", "spawn"],
},
EditorComponentDescriptor {
type_name: "shared::components::TriggerVolume",
display_name: "Trigger Volume",
category: EditorComponentCategory::Gameplay,
addable: true,
removable: true,
reorderable: true,
icon: icons::SELECTION.as_str(),
search_terms: &["trigger", "volume", "event"],
},
EditorComponentDescriptor {
type_name: "shared::components::TeamSpawn",
display_name: "Team Spawn",
category: EditorComponentCategory::Gameplay,
addable: true,
removable: true,
reorderable: true,
icon: icons::FLAG.as_str(),
search_terms: &["team", "spawn"],
},
EditorComponentDescriptor {
type_name: "shared::components::ObjectiveMarker",
display_name: "Objective Marker",
category: EditorComponentCategory::Gameplay,
addable: true,
removable: true,
reorderable: true,
icon: icons::FLAG.as_str(),
search_terms: &["objective", "marker", "gameplay"],
},
EditorComponentDescriptor {
type_name: "shared::components::InspectorOrder",
display_name: "Inspector Order",
category: EditorComponentCategory::Editor,
addable: false,
removable: false,
reorderable: false,
icon: icons::LIST_BULLETS.as_str(),
search_terms: &["editor", "order"],
},
],
}
}
}