mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 03:35:51 +03:00
make sure to draw modal menus last; noticed route preview was covering it
This commit is contained in:
parent
89b74b9137
commit
16c606c745
@ -140,6 +140,7 @@ impl PolygonDebugger {
|
||||
// True when done
|
||||
pub fn event(&mut self, ctx: &mut EventCtx) -> bool {
|
||||
self.menu.handle_event(ctx, None);
|
||||
ctx.canvas.handle_event(ctx.input);
|
||||
if self.menu.action("quit") {
|
||||
return true;
|
||||
} else if self.current != self.items.len() - 1 && self.menu.action("next item") {
|
||||
|
@ -219,7 +219,6 @@ impl EditMode {
|
||||
&ShowEverything::new(),
|
||||
);
|
||||
common.draw(g, &state.ui);
|
||||
menu.draw(g);
|
||||
|
||||
// TODO Similar to drawing areas with traffic or not -- would be convenient to just
|
||||
// supply a set of things to highlight and have something else take care of drawing
|
||||
@ -270,6 +269,8 @@ impl EditMode {
|
||||
opts.override_colors.insert(ID::Intersection(*i), color);
|
||||
state.ui.primary.draw_map.get_i(*i).draw(g, &opts, &ctx);
|
||||
}
|
||||
|
||||
menu.draw(g);
|
||||
}
|
||||
Mode::Edit(EditMode::Saving(ref wizard))
|
||||
| Mode::Edit(EditMode::Loading(ref wizard)) => {
|
||||
|
@ -260,8 +260,6 @@ impl TrafficSignalEditor {
|
||||
.ui
|
||||
.draw(g, opts, &state.ui.primary.sim, &ShowEverything::new());
|
||||
|
||||
self.menu.draw(g);
|
||||
|
||||
let ctx = DrawCtx {
|
||||
cs: &state.ui.cs,
|
||||
map: &state.ui.primary.map,
|
||||
@ -293,6 +291,7 @@ impl TrafficSignalEditor {
|
||||
wizard.draw(g);
|
||||
}
|
||||
|
||||
self.menu.draw(g);
|
||||
CommonState::draw_osd(g, &state.ui);
|
||||
}
|
||||
}
|
||||
|
@ -321,9 +321,9 @@ impl SandboxMode {
|
||||
&ShowEverything::new(),
|
||||
);
|
||||
mode.common.draw(g, &state.ui);
|
||||
mode.menu.draw(g);
|
||||
mode.route_viewer.draw(g, &state.ui);
|
||||
mode.show_activity.draw(g, &state.ui);
|
||||
mode.menu.draw(g);
|
||||
}
|
||||
},
|
||||
_ => unreachable!(),
|
||||
|
@ -265,12 +265,11 @@ impl AgentSpawner {
|
||||
opts.override_colors.insert(src, ui.cs.get("selected"));
|
||||
ui.draw(g, opts, &ui.primary.sim, &ShowEverything::new());
|
||||
|
||||
self.menu.draw(g);
|
||||
|
||||
if let Some((_, Some(ref trace))) = self.maybe_goal {
|
||||
g.draw_polygon(ui.cs.get("route"), &trace.make_polygons(LANE_THICKNESS));
|
||||
}
|
||||
|
||||
self.menu.draw(g);
|
||||
CommonState::draw_osd(g, ui);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user