Blacksite/crates/game/src/editor_ext.rs
Rbanh f29712d158
Some checks are pending
CI / Format, lint, test, build (push) Waiting to run
Initial project import
2026-06-05 21:44:45 -04:00

31 lines
962 B
Rust

//! Game-specific editor panel registration (no dependency on the `editor` crate).
//!
//! The in-process editor binary wraps these setups as [`EditorPlugin`] implementations
//! via `editor::register_game_editor_plugins`.
use bevy::prelude::*;
/// Bevy `App` hook registered by the editor at startup.
pub type EditorPanelSetup = fn(&mut App);
/// Panel hooks exported by the game crate for ADR 0007 dogfood.
pub fn editor_panel_setups() -> &'static [EditorPanelSetup] {
&[register_fps_demo_panel]
}
/// Actor inspector section ids implemented in `editor::ext::game_inspector`.
pub fn actor_inspector_section_ids() -> &'static [&'static str] {
&["game.fps_weapon_stats"]
}
/// Demo game panel state — UI is rendered by the editor adapter.
#[derive(Resource, Default, Debug)]
pub struct FpsDemoPanelState {
pub open: bool,
pub headline: String,
}
fn register_fps_demo_panel(app: &mut App) {
app.init_resource::<FpsDemoPanelState>();
}