mirror of https://codeberg.org/topola/topola.git
egui: put debug visualization checkboxes in a dropdown menu
This commit is contained in:
parent
4e064439f9
commit
0552dd3f33
|
|
@ -23,6 +23,7 @@ pub struct Top {
|
||||||
pub show_ratsnest: bool,
|
pub show_ratsnest: bool,
|
||||||
pub show_navmesh: bool,
|
pub show_navmesh: bool,
|
||||||
pub show_bboxes: bool,
|
pub show_bboxes: bool,
|
||||||
|
pub show_origin_destination: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Top {
|
impl Top {
|
||||||
|
|
@ -32,6 +33,7 @@ impl Top {
|
||||||
show_ratsnest: false,
|
show_ratsnest: false,
|
||||||
show_navmesh: false,
|
show_navmesh: false,
|
||||||
show_bboxes: false,
|
show_bboxes: false,
|
||||||
|
show_origin_destination: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,9 +111,12 @@ impl Top {
|
||||||
|
|
||||||
ui.separator();
|
ui.separator();
|
||||||
|
|
||||||
ui.toggle_value(&mut self.show_ratsnest, "Show Ratsnest");
|
ui.menu_button("Debug", |ui| {
|
||||||
ui.toggle_value(&mut self.show_navmesh, "Show Navmesh");
|
ui.checkbox(&mut self.show_ratsnest, "Show Ratsnest");
|
||||||
ui.toggle_value(&mut self.show_bboxes, "Show Bboxes");
|
ui.checkbox(&mut self.show_navmesh, "Show Navmesh");
|
||||||
|
ui.checkbox(&mut self.show_bboxes, "Show BBoxes");
|
||||||
|
ui.checkbox(&mut self.show_origin_destination, "Show Origin–Destination");
|
||||||
|
});
|
||||||
|
|
||||||
ui.separator();
|
ui.separator();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -230,21 +230,23 @@ impl Viewport {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(navmesh) = execute.maybe_navmesh() {
|
if let Some(navmesh) = execute.maybe_navmesh() {
|
||||||
if let (origin, destination) = (navmesh.origin(), navmesh.destination()) {
|
if top.show_origin_destination {
|
||||||
painter.paint_dot(
|
if let (origin, destination) = (navmesh.origin(), navmesh.destination()) {
|
||||||
Circle {
|
painter.paint_dot(
|
||||||
pos: board.layout().drawing().primitive(origin).shape().center(),
|
Circle {
|
||||||
r: 150.0,
|
pos: board.layout().drawing().primitive(origin).shape().center(),
|
||||||
},
|
r: 150.0,
|
||||||
egui::Color32::from_rgb(255, 255, 100),
|
},
|
||||||
);
|
egui::Color32::from_rgb(255, 255, 100),
|
||||||
painter.paint_dot(
|
);
|
||||||
Circle {
|
painter.paint_dot(
|
||||||
pos: board.layout().drawing().primitive(destination).shape().center(),
|
Circle {
|
||||||
r: 150.0,
|
pos: board.layout().drawing().primitive(destination).shape().center(),
|
||||||
},
|
r: 150.0,
|
||||||
egui::Color32::from_rgb(255, 255, 100),
|
},
|
||||||
);
|
egui::Color32::from_rgb(255, 255, 100),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue