mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 03:35:51 +03:00
Download city.bin if needed
This commit is contained in:
parent
7004cd7af2
commit
4212b200d1
@ -447,6 +447,23 @@ impl<A: AppLike + 'static> State<A> for CitiesInCountryPicker<A> {
|
||||
if maps.len() == 1 {
|
||||
return chose_city(ctx, app, maps.pop().unwrap(), &mut self.on_load);
|
||||
}
|
||||
|
||||
// We may need to grab city.bin
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
{
|
||||
let path = format!("system/{}/{}/city.bin", city.country, city.city);
|
||||
if Manifest::load()
|
||||
.entries
|
||||
.contains_key(&format!("data/{}", path))
|
||||
&& !abstio::file_exists(abstio::path(path))
|
||||
{
|
||||
return crate::tools::prompt_to_download_missing_data(
|
||||
ctx,
|
||||
maps.pop().unwrap(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return Transition::Replace(CityPicker::new_in_city(
|
||||
ctx,
|
||||
self.on_load.take().unwrap(),
|
||||
|
@ -63,7 +63,7 @@ async fn download_updates(version: String, minimal: bool) {
|
||||
if local.entries.get(&path).map(|x| &x.checksum) != Some(&entry.checksum) {
|
||||
// For the Github Actions build, only include a few files to get started. The UI will
|
||||
// download more data when the player tries to open another map.
|
||||
if minimal && !path.contains("montlake") {
|
||||
if minimal && !path.contains("montlake") && path != "data/system/us/seattle/city.bin" {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user