add tooltip warnings about the status of different maps.

This commit is contained in:
Dustin Carlino 2020-02-27 11:10:13 -08:00
parent 5e85eee935
commit e9468b8ebf
2 changed files with 15 additions and 1 deletions

View File

@ -167,6 +167,10 @@ impl<T: Clone> PopupMenu<T> {
txt.add(Line(&choice.label).fg(text::INACTIVE_CHOICE_COLOR));
}
}
if choice.tooltip.is_some() {
// TODO Ideally unicode info symbol, but the fonts don't seem to have it
txt.append(Line(" ⚠️"));
}
// TODO BG color should be on the TextSpan, so this isn't so terrible?
if idx == self.current_idx {

View File

@ -171,7 +171,17 @@ fn make_load_map(btn: ScreenRectangle, gameplay: GameplayMode) -> Box<dyn State>
abstutil::list_all_objects(abstutil::path_all_maps())
.into_iter()
.filter(|n| n != current_map)
.map(|n| Choice::new(nice_map_name(&n), n.clone()))
.map(|n| {
let c = Choice::new(nice_map_name(&n), n.clone());
// Hardcoded list for now.
if n == "montlake" || n == "23rd" {
c
} else {
c.tooltip(
"This map currently has bugs causing unrealistic traffic jams.",
)
}
})
.collect()
},
) {