Commit Graph

101 Commits

Author SHA1 Message Date
Dustin Carlino
3b21bf6e87 Lift PopupMsg to widgetry 2022-02-19 14:38:26 +00:00
Dustin Carlino
942c3ecdaf Make SimpleApps all manage their own CLI parsing, so they can add their own overrides. 2022-01-31 13:30:55 +00:00
Dustin Carlino
e542011614 More fluid UI for comparing traffic counts -- hotkeys
Had to change the API of on_click...
2022-01-27 15:13:24 +00:00
Dustin Carlino
7eba7a10cf Update map URL in the LTN tool. #766
It's increasingly lucrative to try refactoring this.
2021-12-05 14:13:57 +00:00
Dustin Carlino
d567366ee2 Fix crash in 15m tool. Some of the larger Seattle maps have pedestrian
pathfinding disabled to save space, so make the path calculation
optional.
2021-11-30 06:44:05 +00:00
Dustin Carlino
2fbc950da5 Switch to a consolidated title screen that switches between all the
apps. #780
2021-11-06 10:33:11 -07:00
Dustin Carlino
9f86365cf6 Upgrade to rust 1.56 and cutover to rust edition 2021 2021-10-21 09:38:06 -07:00
Dustin Carlino
41465c341b Convert the new bike routing tool to use World. #763
This one is the most complicated, and it's still not done, but it's not
any buggier than the ad-hoc implementation. I still need to figure out
how to merge the two worlds of waypoints and routes.

This one also required a large, but mechanical, refactor to lift
ToggleZoomed and the concept of unzoomed/zoomed from map_gui to
widgetry.
2021-10-03 14:28:44 -07:00
Dustin Carlino
2c6f218b22 Refactor a button to change maps 2021-09-27 12:16:01 -07:00
Dustin Carlino
4068986c58 Refactor URLManager -- on errors, always warn 2021-09-07 11:14:31 -07:00
Dustin Carlino
570cd2de84 Make map_editor more web-friendly:
- adjust the panel
- hide some controls on the web
- keep the URL up-to-date with the map and camera
2021-09-07 11:00:27 -07:00
Dustin Carlino
442523ae6c Simplify some lane lookups that just needed to find the parent 2021-09-05 19:53:10 -07:00
Dustin Carlino
112bc38e0c Get rid of the now redundant lanes_ltr 2021-09-05 19:53:10 -07:00
Dustin Carlino
4c46510342 Cleaning up a few APIs, now that lanes belong to roads... 2021-09-05 19:53:10 -07:00
Dustin Carlino
51367088df Adding a 'nearby houses and shops' feature to the bike network tool
Results have major issues, probably going to leave this out of v1.
2021-08-06 20:05:04 -07:00
Rémi Lauzier
1a4b997818 Fix some clippy warnings 2021-06-16 16:21:35 -07:00
Trevor Nederlof
4e150dcab0
Generalized connectivity to use Spot and added BorderIsochrone (#668) 2021-06-11 10:06:53 -07:00
Dustin Carlino
889c500eb1 Force geojson to use geo-types feature everywhere. This lets different
binaries properly share workspace dependencies.

See
https://www.reddit.com/r/rust/comments/nvd6y7/common_crates_in_cargo_workspace_recompiled_due/
for the full story behind this mess.

I'm going to keep repeating this process until I get game and importer
to share dependencies again.
2021-06-09 09:48:53 -07:00
Dustin Carlino
5aa00955f9 Clean up the timer.parallelize API, getting rid of the weird enum to
toggle how many CPUs to thrash. We always use all of them, except for
one case, where a separately named method is more clear. Also make that
variation use all but 1 CPU, instead of just half.
2021-05-27 17:47:22 -07:00
Dustin Carlino
a6e707eb8a Upgrade more dependencies.
(Can't upgrade winit yet, because glutin doesn't have a crates.io
release that's caught up)
2021-05-22 16:36:57 -07:00
Vinzent Steinberg
a1899e29f8
Update dependencies (#656)
* Update dependencies

* Use github for polylabel, to make all dependencies use geo 0.18, not a mix of 0.18 and 0.17

* Downgrade lyon to avoid a crash

Co-authored-by: Dustin Carlino <dabreegster@gmail.com>
2021-05-22 16:23:06 -07:00
Michael Kirk
94501e4699 size horizontal-divider WRT its parent size, not absolute window size 2021-05-17 18:19:06 -07:00
Dustin Carlino
1e3ed254a9 Reorganize canvas settings, so that they can actually be saved. #216 2021-05-17 13:12:45 -07:00
Dustin Carlino
1fe60eb8bb Automatically save/restore user settings. #216
On a best-effort basis, of course. If the format changes, just start
fresh.
2021-05-17 10:34:13 -07:00
Dustin Carlino
72d0e53fdc Make ChooseSomething take a FnOnce callback, so we can avoid cloning at a few call-sites 2021-05-16 08:41:37 -07:00
Vinzent Steinberg
446a21696d
Fix most clippy warnings (#646)
* More conventional spelling of acronym identifiers

* `new` -> `new_state`

* Remove redundant field name

* Remove needless `collect`

* `to_controls` -> `make_controls`

* Simplify long if statement

* Fix module inception

* Simplify chained if let

* Return directly instead of creating a binding

* Disable clippy warning about `borrow` method

Implementing the `Borrow` trait instead would result in excessive type
annotations.

* Fix most remaining clippy warnings

* Allow clippy::type_complexity

* Fix bad merge from web editor

* Run cargo fmt

* Suppress large_enum_variant warnings

* Rename FYI state to ShowMessage

* Fix upper_case_acronyms warnings

Co-authored-by: Dustin Carlino <dabreegster@gmail.com>
2021-05-14 17:31:32 -07:00
Dustin Carlino
efd10ac9b0 Fix build errors not caught by merge conflicts from #642 2021-05-14 08:37:46 -07:00
Vinzent Steinberg
fd3b0e2a14
Fix compilation failures and most clippy warnings (#642)
* abstutil: Fix compilation failure

* map_gui: Fix compilation

* traffic_signal_data: Fix compilation failure

* map_model: Fix compilation failure

* abstutil: Fix doctests

* abstio: Fix most clippy warnings

* abstutil: Fix most clippy warnings

* collisions: Fix clippy warning

* convert_osm: Fix clippy warnings

* sim: Fix most clippy warnings

* geom: Fix clippy warnings

* kml: Fix clippy warnings

* map_model: Fix most clippy warnings

* fifteen_min: Fix clippy warnings

* game: Fix many clippy warnings

* Disable some noisy clippy warnings

* headless: Fix clippy warnings

* importer: Fix clippy warnings

* map_editor: Fix clippy warnings

* map_gui: Fix clippy warnings

* osm_viewer: Fix clippy warnings

* parking_mapper: Fix most clippy warnings

* popdat: Fix clippy warnings

* santa: Fix clippy warnings

* sumo: Fix clippy warnings

* traffic_seitan: Fix clippy warning

* updater: Fix clippy warnings

* widgetry: Fix clippy warnings

* tests: Fix some clippy warnings

* Fix compilation on stable Rust

* Simplify unwrapping

* Make use of `Entry` more readable

* Fix formatting

* Fix code that was broken in the refactoring

* Apply cargo +stable fmt

* Fix code that was broken in the refactoring, second try

* Remove `Default` impls that are equivalent to `new`

* Remove obsolete clippy wrapper

* Avoid turbofish

* Prefer `unwrap_or_else` over allowing `clippy::or_fun_call`

* Remove redundant `into_iter`

* Fix typo

* Prefer `&& false` over commenting code out

* Fix some clippy warnings

Co-authored-by: Dustin Carlino <dabreegster@gmail.com>
2021-05-14 08:32:56 -07:00
Trevor Nederlof
af309bcd56
Add a search by amenity mode to 15min using multi start points (#643) 2021-05-13 11:35:39 -07:00
Dustin Carlino
2c5e0dae03 Fix static trait object method warning that we're now hitting in Rust 1.52
The <dyn ...> syntax is gross, but I don't think there's a way to avoid
this without defining a differently named empty struct and putting the
static method on that
2021-05-11 12:31:58 -07:00
Dustin Carlino
8c09f33761 Also implement multi-source Dijkstra's for vehicles. Had to give up on petgraph. 2021-05-06 10:48:32 -07:00
Dustin Carlino
8d6a184a1f Speed up the 'find perfect home' tool by starting Dijkstra's floodfill with multiple sources. Only implemented for walking right now. 2021-05-06 10:48:32 -07:00
Trevor Nederlof
4080d0d130
Add craft and office to import and add/reorg AmenityType (#638)
* Add craft and office to import and add/reorg AmenityType

* Remove bike rental/parking and rename BikeShop to Bike

* add in leisure and tourism tags, add more categories to AmenityType and remove lesser used tags

* add dependency on strum and strum_macros and removed some manual code for text display of Enum and Enum into string

* include lock file, fix color of buildings for amenity layer, fix formatting and use orders
2021-05-06 08:43:52 -07:00
Dustin Carlino
bc591c1b5f Plumb back the widget name in Outcome::Changed 2021-04-22 13:09:32 -07:00
Michael Kirk
4f81f186af
embed mode and reworked web build system (#592)
* root element id from Settings, respect element size

* Plumb assets root via settings

* adapt crates to new wasm api

* more FileLoader cleanup

* use tsc bin from node_modules

* avoid spurious unlink errors

GNU Make considers the src/*/wasm_pkg targets as intermediate build
files and attempted to `rm` them. We can stop that my marking them as
`.PRECIOUS`

https://www.gnu.org/software/make/manual/html_node/Special-Targets.html

* `open` doesn't work on Linux

We could do something with xdg-open, but meh, not worth having platform
dependent logic for this.

* fix typo, clarify instructions

* make server compatible with older python install on linux

* revert change - we dont want to include music on web

the leading "-" means exclude a subdir of an included dir.

* better wrap of comments

* fix misfire in copy/pasted comment

* update docs
2021-04-01 19:31:02 -07:00
Dustin Carlino
c1ac3cf39d Make Polygon::from_geojson preserve rings. This fixes the WIP elevation contours. #82 2021-03-25 15:15:53 -07:00
Michael Kirk
affd582093 more concise Text / tooltip() 2021-03-19 16:48:54 -07:00
Michael Kirk
e493c02d83 convert trip tables to new tabs
The GenericTable machinery lost a lot of it's utility now that we have
proper tabs. I've left a couple of free functions to be shared, and
inlined the remaining simple functionality.
2021-03-19 11:56:22 -07:00
Dustin Carlino
8be24bf007 Use AsRef<str> in more widgetry methods, getting rid of &format at many
call-sites. #253

To make some of these work, changed Label to store a String. Ultimately
it gets transformed into Text, so we need to allocate eventually.
2021-03-11 11:29:18 -08:00
Dustin Carlino
65d7bc5c8e Rename {Text,TextSpan}::draw to into_widget, for consistency. #253 2021-03-09 09:59:30 -08:00
Dustin Carlino
a4a20ce1e5 draw_text renamed to text_widget, for consistency. #253 2021-03-09 09:56:41 -08:00
Dustin Carlino
0e5f2c3098 Fix problem where two Hangry Pandas crashed the 15m tool, because button labels wound up the same. 2021-03-06 10:24:02 -08:00
Dustin Carlino
42bd63e79b Lift URL and viewport code from game to map_gui. Also use it for OSM viewer and the 15min tool. 2021-03-04 13:22:09 -08:00
Michael Kirk
86799e2832 Remove StyledButtons - instead implement everything on the individual
ButtonStyle
2021-02-27 21:08:26 -08:00
Michael Kirk
cee0e5dbbd Use btn_primary.* methods instead of btn_primary_* 2021-02-27 21:08:26 -08:00
Michael Kirk
4b2f3888ed replace btn_solid w/ primary/outline as appropriate 2021-02-26 14:05:19 -08:00
Michael Kirk
d774aeae44 rename toggle/checkbox 2021-02-24 14:59:47 -08:00
Michael Kirk
3ab7fc4361
Fix tooltips and hotkey for day-theme (#528) 2021-02-24 10:52:57 -08:00
Dustin Carlino
0344e51170
Merge pull request #525 from a-b-street/prefetch
Make a web loader that can 'prefetch' abst in the background. cyipt/a…
2021-02-23 13:34:55 -08:00
Dustin Carlino
4c97687a5b Make a web loader that can 'prefetch' abst in the background. cyipt/actdev-ui#15 2021-02-23 11:45:39 -08:00