editor update

This commit is contained in:
Jonas H
2026-03-28 10:31:05 +01:00
parent c37a9fd5dd
commit 4c3ebca96e
2 changed files with 51 additions and 7 deletions

View File

@@ -15,6 +15,7 @@ pub struct EditorState
pub active: bool,
pub right_mouse_held: bool,
pub selected_entity: Option<EntityHandle>,
pub show_player_state: bool,
inspector: Inspector,
}
@@ -30,6 +31,7 @@ impl EditorState
active: false,
right_mouse_held: false,
selected_entity: None,
show_player_state: false,
inspector: Inspector::new(device, queue, surface_format),
}
}
@@ -60,6 +62,11 @@ impl EditorState
self.inspector.wants_mouse()
}
pub fn build_hud(&mut self, world: &World)
{
self.inspector.build_minimal_ui(world);
}
pub fn render(&mut self, encoder: &mut wgpu::CommandEncoder, view: &wgpu::TextureView)
{
self.inspector.render(encoder, view);
@@ -79,5 +86,8 @@ pub fn editor_loop(
camera_noclip_system(world, input_state, delta);
}
let selected = editor.selected_entity;
editor.inspector.build_ui(stats, world, selected);
let show_player_state = editor.show_player_state;
editor
.inspector
.build_ui(stats, world, selected, show_player_state);
}