editor update
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user