mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 03:35:51 +03:00
Exclude collisions.bin from KML viewer; it's not KML anymore.
And fix a crash on the challenges screen by not considering the actions of inactive buttons to count as duplicates.
This commit is contained in:
parent
65b1f24d5d
commit
0f1c30a889
@ -155,6 +155,7 @@ impl State<App> for ViewKML {
|
||||
.filter(|x| {
|
||||
(x.ends_with(".bin") || x.ends_with(".kml") || x.ends_with(".csv"))
|
||||
&& !x.ends_with("popdat.bin")
|
||||
&& !x.ends_with("collisions.bin")
|
||||
})
|
||||
.collect(),
|
||||
),
|
||||
|
@ -642,10 +642,12 @@ impl Widget {
|
||||
|
||||
fn get_all_click_actions(&self, actions: &mut HashSet<String>) {
|
||||
if let Some(btn) = self.widget.downcast_ref::<Button>() {
|
||||
if actions.contains(&btn.action) {
|
||||
panic!("Two buttons in one Panel both use action {}", btn.action);
|
||||
if btn.is_enabled() {
|
||||
if actions.contains(&btn.action) {
|
||||
panic!("Two buttons in one Panel both use action {}", btn.action);
|
||||
}
|
||||
actions.insert(btn.action.clone());
|
||||
}
|
||||
actions.insert(btn.action.clone());
|
||||
} else if let Some(container) = self.widget.downcast_ref::<Container>() {
|
||||
for w in &container.members {
|
||||
w.get_all_click_actions(actions);
|
||||
|
Loading…
Reference in New Issue
Block a user