Commit Graph

1853 Commits

Author SHA1 Message Date
Dustin Carlino
4a197fa13d Until there's a faster implementation, just flag-guard selecting unzoomed agents 2020-10-15 14:58:07 -05:00
Dustin Carlino
38394c4a08 Comment some code to clarify things in #365, and switch the color for
selecting unzoomed agents
2020-10-15 14:58:07 -05:00
Dustin Carlino
028d1df62c Allow selecting and clicking unzoomed agents. [rebuild] 2020-10-15 14:58:07 -05:00
Dustin Carlino
1e0d8536a4 Fix #367 by making all constructors of SandboxMode appropriately defer
work that must happen after the map/scenario are loaded.
2020-10-14 17:43:28 -05:00
Dustin Carlino
e7fb9b1a4a Handle the info panel rewind-sim case for #367. I'm increasingly happier
with how the async reactions to loading SandboxMode are.
2020-10-14 17:24:39 -05:00
Dustin Carlino
81dae1e39c Slightly simplify some plumbing of variables through nested closures, by
remembering that FnOnce exists
2020-10-14 15:36:08 -05:00
Dustin Carlino
5ef48a5d1c Express the SandboxMode constructor as a full state machine, with the
ability to defer things like pushing the time warp state onto the stack
of states. This fixes the edit mode case of #367, but other callers of
SandboxMode::new still need updating.
2020-10-14 15:13:10 -05:00
Dustin Carlino
84a65c293b Make it easier to test scenario modifiers by specifying them on the CLI 2020-10-14 12:16:38 -05:00
Dustin Carlino
bc856a4c2b Fix the signal demand dash, broken by 1906fb0913. And enable warp to ID for non-dev mode too. 2020-10-13 10:22:19 -05:00
Dustin Carlino
1906fb0913 Remove the GetDrawAgents indirection. Originally the UI could pull the
set of agents to draw either from the simulation or from this
"time-traveler" plugin, which would let you rewind sim time. That plugin
is long gone, and it never worked well, because much of the UI would use
the GetDrawAgents to select something, then query the live sim for lots
of details anyway. The plugin never served all of those calls, so the
results would be kind of out-of-sync anyway.

There are some parts of the UI that need to temporarily not draw agents.
Use the same suspended_sim trick that edit mode does.
2020-10-12 11:52:05 -05:00
Dustin Carlino
b9efdaef20 Refactor the trip timeline code, fixing the icon spacing. Temporarily
take out the delays from the timeline -- they complicate the code. Will
add back in later, once the code's a little more clear.
2020-10-11 11:35:00 -07:00
Dustin Carlino
a1c53d5e1c Humble start to adjusting how distances and durations are printed in the UI. #331
Also trimmed out a few old UI settings; they kind of started as
experiments, but now the alternative feels useless to maintain.
2020-10-11 10:45:13 -07:00
Dustin Carlino
a2d36274a2 Prep for release [rebuild] 2020-10-10 13:11:11 -07:00
Dustin Carlino
1791ef70a5 More cleanup of https://github.com/dabreegster/abstreet/pull/363: fix the build break in info/trip 2020-10-10 12:31:52 -07:00
Dustin Carlino
e38858129b Cleanups after https://github.com/dabreegster/abstreet/pull/363:
- cargo +nightly fmt
- upload new prebaked data
2020-10-10 12:24:42 -07:00
Sam
4c5a858238
Delay highlighting (#363)
* Initial storing of intersection delays

* Initial highlighting of delays on route

* Added label of delay

* Info overlay works

* Added supoprt for pedestrian delays (only intersection delay currently)
Bike also works, but is treated as a car, so the avg speed is flagged as very slow (Needs fix)

* Capitalised describe trip phase
Now uses min of (speed limit and vehicle max speed) for the maximum speed check
Added trip blocked time query
Lots of work on tool tips
Icons are broke

* Nearly complete, just fmting and a crash to fix
Color assertion?

* Fixed text font colour crash
Added new custom TextSpan size function

* Cargo +nightly fmt

* Cargo +nightly fmt

* Clion auto import formatting
Doesn't quite match the existing "changes"

* Fixing merge issues

* Fixing icon placement issues

* Requested changes (Part 1)

* Requested changes (Part 2)

Co-authored-by: Sam <a>
Co-authored-by: Dustin Carlino <dabreegster@gmail.com>
2020-10-10 12:23:02 -07:00
Dustin Carlino
94449e49e0 Launch the web version! #21 2020-10-09 22:55:13 -07:00
Dustin Carlino
34e95dd861 WIP load scenarios 2020-10-09 22:31:31 -07:00
Dustin Carlino
d4358586d6 Refactor the MapLoader into a more generic file loader... 2020-10-09 17:26:11 -07:00
Dustin Carlino
fbf651f1c2 Give up on generic_prebake_all, an unused method that would very generically crawl all challenges, calculate their scenario, and prebake results for them. It forces GameplayMode -> Scenario to have a certain form, which seemingly blocks transitioning to an asyncish loading screen. 2020-10-09 16:36:31 -07:00
Dustin Carlino
be3b2e8abb Finally, cut over the last app.switch_map caller 2020-10-09 16:27:28 -07:00
Dustin Carlino
2cd59ead37 Remove the special handling for synthetic maps, which were JSON RawMaps
that could directly be loaded. The few examples have been long broken
and unused. They complicate map loading, because they have a weird path.
2020-10-09 16:08:11 -07:00
Dustin Carlino
3feb9d6dbe Make the proposals picker use the new map loading mechanism 2020-10-09 15:57:20 -07:00
Dustin Carlino
03eac377d6 Convert ScreenshotTest away from app.switch_map 2020-10-09 15:07:35 -07:00
Dustin Carlino
2ad832d01a Whittle down callers of app.switch_map: changing color scheme. (As a
bonus, now this doesn't reset the sim and everything!)
2020-10-09 14:51:35 -07:00
Dustin Carlino
a8b41370bc Refactor the CityPicker HTTP trick into a native/web loading screen
state for switching maps. Use it just from the CityPicker for the
moment...
2020-10-09 14:35:02 -07:00
Dustin Carlino
e4707ca223 Ehem, fix build break in web from last commit. Hard to test a single commit against both native/web, because switching targets clears the entire build cache... 2020-10-09 14:04:56 -07:00
Dustin Carlino
1ae4c6e41f Make the web CityPicker do all of the same stuff that app.switch_map does 2020-10-09 14:02:08 -07:00
Dustin Carlino
1de7065562 Move a few things from App down to PerMap: layer, suspended_sim,
prebaked
2020-10-09 13:50:30 -07:00
Dustin Carlino
906dc0a8e5 Rearrange responsibilities of App::new and PerMap::new, to prepare for
cleaning up switch_map
2020-10-09 13:35:51 -07:00
Dustin Carlino
dd0df29571 Suppress the trip summaries tab if we have no prebaked data to compare to 2020-10-09 13:04:36 -07:00
Dustin Carlino
b9d3052c87 Show the elapsed time in the web loading screen, to kind of reassure people things aren't frozen 2020-10-09 09:14:24 -07:00
Dustin Carlino
7236fa558f Fix clicking on regions in citypicker. #21 2020-10-08 17:02:08 -07:00
Dustin Carlino
17416d9fd6 Start deploying the web build to s3... #21 2020-10-08 16:29:06 -07:00
Dustin Carlino
31854344ec Proper loading screen for web. #21 2020-10-08 15:07:23 -07:00
Dustin Carlino
62b3af324b Bundle data/MANIFEST.json in wasm. Now loading all maps from HTTP works! #21 2020-10-08 14:41:02 -07:00
Dustin Carlino
4d66e4e91d Make the city picker list maps from the manifest, not local files. #21 2020-10-08 14:26:35 -07:00
Dustin Carlino
d1d1d1532c Silence warnings when compiling wasm 2020-10-08 12:26:54 -07:00
Dustin Carlino
64bc4ee318
On the web, load different maps by making asynchronous HTTP calls. #21 (#364)
* On the web, load different maps by making asynchronous HTTP calls. #21

This is a very strange, specializd approach; it's unclear how it'll
generalize to reading scenarios and prebaked results. Ideally we could
call abstutil::read_binary as we currently do and somehow hide this async
trickery underneath, but I'm not sure how yet. In the meantime, this
moves us forward with the hack well-contained.

Next steps for web: stop bundling in all of data/system in the .wasm,
now that we can load from HTTP.
2020-10-08 10:51:13 -07:00
Dustin Carlino
69c8ce4cbe Before the .wasm loads, display "Loading" 2020-10-07 23:02:10 -07:00
Dustin Carlino
79e313da24 When crashing, dump edits to a file instead of STDOUT. They take too much space and sometimes overflow the terminal's buffer. 2020-10-07 15:53:27 -07:00
Michael Kirk
2ed916e89f
show parking intent (#362) 2020-10-07 14:16:58 -07:00
Dustin Carlino
a3b7ed18cd Cache the unedited map, for #361 2020-10-06 16:58:48 -07:00
Dustin Carlino
84e50d561d Workaround one case of #361 in an expensive way: temporarily revert
map edits when viewing the "before" version of a trip.
2020-10-06 15:35:11 -07:00
Dustin Carlino
24c20e1599 Add a layer to visualize congestion caps. #325 2020-10-06 13:47:53 -07:00
Dustin Carlino
f258c50595 Organize import blocks using https://github.com/dabreegster/organize_rust_imports 2020-10-05 20:29:22 -07:00
Dustin Carlino
27d94945c6 Manually move mod block after the use block, to match what CLion does. 2020-10-05 20:29:22 -07:00
Dustin Carlino
b9eda7305a Fix the web canvas size. I was mixing examples improperly; our code appends a canvas to the DOM dynamically, so we don't need to hardcode one. 2020-10-05 19:50:52 -07:00
Dustin Carlino
982b0bc194 Support opening new browser tabs on web. The webbrowser crate claims it's experimental, but works fine for me, and the impl is pretty much what I'd try anyway. 2020-10-05 19:50:52 -07:00
Dustin Carlino
bb6dbb0731 Switch from stdweb to websys for #21.
When I added web support in February, it was easier to get started with
stdweb, since it has the nice cargo web tool. However, stdweb is
unmaintained, winit is deprecating support for it, and the next steps
for web (downloading maps dynamically) have better support for web-sys.

With Alvin's guidance, I got
https://github.com/dabreegster/minimal_websys_winit_glow_demo working
first. This PR cuts A/B Street over too.

I tested abst and the widgetry demo in both native and web. The only
major regression from stdweb is the canvas placement and size. I
attempted some fixes, but at this point, I'll leave it as a smaller
followup instead.
2020-10-05 19:50:52 -07:00