Skip to content

Commit 57eaee4

Browse files
committed
delete all button
1 parent 35ceded commit 57eaee4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/ui/draw.rs

+17
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,23 @@ pub fn draw_egui(
512512
mic.clear();
513513
}
514514
}
515+
516+
if ui.button("Delete All").clicked() {
517+
for (e, _) in source_set.p0().iter() {
518+
commands.entity(e).despawn();
519+
}
520+
for (e, _) in rect_wall_set.p0().iter() {
521+
commands.entity(e).despawn();
522+
}
523+
for (e, _) in circ_wall_set.p0().iter() {
524+
commands.entity(e).despawn();
525+
}
526+
for (e, _) in mic_set.p0().iter() {
527+
commands.entity(e).despawn();
528+
}
529+
530+
grid.reset_cells(ui_state.boundary_width);
531+
}
515532
});
516533

517534
ui.add(

0 commit comments

Comments
 (0)