dont print a newline in the OSD unless necessary

This commit is contained in:
Dustin Carlino 2018-05-16 19:01:06 -07:00
parent 0e672f9e09
commit 37b3909596
2 changed files with 8 additions and 5 deletions

View File

@ -2,7 +2,8 @@
## Map editor
- hover over road, start a search, press F
- still key overlap bugs with floodfilling
- master UI exclusive state -- one plugin at a time
- traffic signal editor
- button to reset intersection to original cycles

View File

@ -418,10 +418,12 @@ impl UI {
s.draw(&self.map, &self.canvas, &self.draw_map, g);
}
let mut osd_lines = Vec::new();
osd_lines.extend(self.sim_ctrl.get_osd_lines());
osd_lines.push(String::from(""));
osd_lines.extend(input.get_possible_actions());
let mut osd_lines = self.sim_ctrl.get_osd_lines();
let action_lines = input.get_possible_actions();
if !action_lines.is_empty() {
osd_lines.push(String::from(""));
osd_lines.extend(action_lines);
}
let search_lines = self.current_search_state.get_osd_lines();
if !search_lines.is_empty() {
osd_lines.push(String::from(""));