Commit Graph

61 Commits

Author SHA1 Message Date
Dustin Carlino
ae62bf082e Consolidate Slider and AreaSlider. They share most logic, just look different. 2020-10-27 12:13:20 -07:00
Dustin Carlino
6a8e01d4cd Remove an unnecessary slider from the polygon debugger, and lock down set_percent, which is causing some scrollabr dragging bugs. 2020-10-27 11:31:37 -07:00
Dustin Carlino
1a630c6361 Highlight categories of businesses in the osm viewer 2020-10-24 15:19:51 -07:00
Dustin Carlino
ad23da1f6c Workaround widgetry panel bug in the osm viewer, where scrollbars aren't
recomputed when panel contents change size.
2020-10-24 13:41:06 -07:00
Dustin Carlino
e55dfd68dd Document the state/transition system. #253 2020-10-22 18:27:25 -07:00
Dustin Carlino
c2b6c917ae Generalize the State/Transition GUI structure, moving it into widgetry.
Nothing about it is specific to A/B Street, and other apps built with
widgetry could organize themselves as a stack of states. This is also a
first step towards sharing more common code between A/B Street and a
future OSM viewer.

Mostly mechanical change. Some more cleanup / documentation coming up
next.
2020-10-22 17:34:59 -07:00
Dustin Carlino
d98c5bc6bc Better error message when the GPU doesn't support the requested mode. #103 2020-10-21 12:19:06 -07:00
Dustin Carlino
ead7960112 Collapse one case of possible nested loading screens. Slightly simpler
code, but this doesn't solve the bug of a second squished loading screen
for scenarios.
2020-10-20 18:24:37 -07:00
Dustin Carlino
d8910ad04f Build a quadtree of unzoomed agents while drawing, to later speedup mouseover. This seems to make performance fine in debug mode, so get rid of the flag guarding of this feature! [rebuild] 2020-10-20 11:38:38 -07:00
Dustin Carlino
af70904377 Document as much of geom as I can before my battery dies. And a mechanical API changes, Angle::new_degs -> Angle::degrees 2020-10-19 19:55:05 -05:00
Dustin Carlino
422882c03b Ditch cpuprofiler in favor of cargo flamegraph. Add a tool that just
runs a scenario headlessly, since that's easier than sending a few curl
commands to the API. #368
2020-10-15 17:12:38 -05: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
31854344ec Proper loading screen for web. #21 2020-10-08 15:07:23 -07:00
Dustin Carlino
69c8ce4cbe Before the .wasm loads, display "Loading" 2020-10-07 23:02:10 -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
41ecd62e69 Support textures on the web as well 2020-10-05 19:50:52 -07:00
Dustin Carlino
6cce3b1946 Make z-order changes work on web too, restoring tooltips 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
Michael Kirk
14cbb0f0c1
update panels and their scrollbars when window resizes (#358)
* match unfork to fork

TBH I don't know of problem currently being caused by this, but it
seemed wrong to unfork without a matching fork.

* variable rename (no behavior change)

"c" was holdover from when panels were called composites

* resize container dims when window resizes

* make panel.top_level private

* Show/Hide scrollbars as window is resized

* alignment demo

* Fix scrollbar positioning

* separate out scrollbar work so we can profile it easier

* mem::replace is more concise than mem::swap

* fixup size of MaxPercent

* restore scroll position after redrawing scroll bars
2020-10-05 17:46:50 -07:00
Dustin Carlino
e973d1e5a1 Organize abstutil io into a native and web crate 2020-10-05 14:16:29 -07:00
Dustin Carlino
533fca1f61 Upgrade winit and glutin [rebuild] 2020-10-02 21:31:56 -07:00
Dustin Carlino
9ca7ea6cc2 Improve the experiment to draw area names by fixing z-ordering. But
leave disabled; sizing is still way off.
2020-09-29 14:51:07 -07:00
Dustin Carlino
4916b10190 Small style cleanups after #346 (Import grouping, simplify Spinner logic) 2020-09-27 10:26:38 -07:00
NoSuchThingAsRandom
0921a4aae5
Pedestrian crossing time (#346)
* Fixed ui being able to select traffic light times that are shorter than the time it takes to walk across the crosswalk

* Fixing operands and renaming

* Fixed spinner out of bounds issue
Traffic light generation now, ensures that there is enough time to cross the crosswalk
And enforces the minimum time duration

* Cargo +nightly fmt

* Request fixes: https://github.com/dabreegster/abstreet/pull/346
Still need some things to clarify:
    Spinner checks on increment/decrement
    Calling enforce_minimum_crosswalk_time inside get_possible_policies, requires the removal or modification of the validation function

* Moved enforce_minimum_crosswalk_time inside get_possible_policies
Now runs stage_time_validation at the end of get_possible_policies and removes invalid policies
Could do the same with the validation function as well?

* Fixing import order

* Fixed ui being able to select traffic light times that are shorter than the time it takes to walk across the crosswalk

* Fixing operands and renaming

* Fixed spinner out of bounds issue
Traffic light generation now, ensures that there is enough time to cross the crosswalk
And enforces the minimum time duration

* Cargo +nightly fmt

* Request fixes: https://github.com/dabreegster/abstreet/pull/346
Still need some things to clarify:
    Spinner checks on increment/decrement
    Calling enforce_minimum_crosswalk_time inside get_possible_policies, requires the removal or modification of the validation function

* Moved enforce_minimum_crosswalk_time inside get_possible_policies
Now runs stage_time_validation at the end of get_possible_policies and removes invalid policies
Could do the same with the validation function as well?

* Fixing import order

* Moving stage validation inside validation function

Co-authored-by: Sam <a>
2020-09-27 10:21:30 -07:00
Michael Kirk
1079a899d6
fix doctest error (#350)
because I significantly indented the unicode diagram, doctest tried to
execute them, and exploded when parsing non-ascii "rust code"
2020-09-25 19:07:19 -07:00
Michael Kirk
f0be8dc0f0
Coalesce render flavors (#349) 2020-09-25 15:09:18 -07:00
Michael Kirk
e19bb42492
Clean up "trips" (info/person.rs) (#347)
* center pill

* padding insets

* use disclosure glyph instead of unicode arrows
2020-09-25 13:05:32 -07:00
Dustin Carlino
0f78920aeb Start overhauling th trip summary page. #331 2020-09-25 11:55:07 -07:00
Michael Kirk
241d2faad3 Apply a few more pop_up buttons
...rather than formatting text w/ unicode arrows

Addendum to 452fb06ae
2020-09-25 09:47:08 -07:00
Michael Kirk
d7e0225097 roll back lyon to fix crash in widgetry demo 2020-09-24 19:12:39 -07:00
Michael Kirk
00fb0ef8cd Cleanup dropdown - stop using unicode "down arrow"
We were drawing "pop-up" style buttons in several places, using
copy/pasted logic - which was simple enough when using a unicode glyph.

But we want to use a different glyph which isn't in our font. Further,
using an svg like this gives us finer grained control around the layout
around the button "handle" than we could get with just space characters.
2020-09-24 19:12:39 -07:00
Michael Kirk
8ad32c5cee separate widgetry assets
might be helpful for packing separate widgetry crate
2020-09-24 19:12:39 -07:00
Dustin Carlino
597ef473f2 Upgrade most dependencies 2020-09-24 09:36:26 -07:00
Dustin Carlino
6f1ffe66b5 Don't clip tooltip. #331 2020-09-23 12:02:59 -07:00
Dustin Carlino
fa0c5ee02c Multiple lane type transformations in bulk edit. #331 2020-09-23 11:55:19 -07:00
Michael Kirk
4a6ca209a5 fix tooltip z-level 2020-09-23 11:27:50 -07:00
Michael Kirk
8042ad414f
fix building overlap for isometric view (mostly) (#338) 2020-09-21 11:54:39 -07:00
Dustin Carlino
e1de43b75c Add a /map/set-edits API call 2020-09-21 10:18:02 -07:00
Dustin Carlino
a17ef9cc43 Get text rendering to work on WASM! #21
Just a few changes to make usvg not depend on Rustybuzz (which is still
in the middle of becoming a pure Rust library). It probably only works
with English fonts, but for the moment, it moves us forward.
2020-09-20 22:50:22 -07:00
Dustin Carlino
8e32314979 Style the loading screen and add tips/news. Closes #180 [rebuild] 2020-09-20 13:02:27 -07:00
Dustin Carlino
bb3342de27 Individual hitboxes for multiple signals in the sidebar. #331 2020-09-19 11:52:15 -07:00
Dustin Carlino
83ff6db16c Improve the signal demand dash with keys to change hour. And slightly
refactor styled keys in text.
2020-09-19 10:18:23 -07:00
Dustin Carlino
d9e50a7e38 Use .into() for specifying keys to widgetry more ergonomically. #253 2020-09-18 09:26:14 -07:00
Michael Kirk
2b36b9f03a
add textured theme (#335) 2020-09-18 07:43:05 -07:00
Michael Kirk
cb84b729f6
FancyColor -> Fill (#334) 2020-09-17 23:34:25 -07:00
Michael Kirk
c0e2a611a0
introduce textures to rendering pipeline (#333) 2020-09-17 18:38:55 -07:00
Dustin Carlino
7bd1d937f9 Some of Yuwen's cosmetic traffic signal editor changes 2020-09-15 09:32:46 -07:00
Dustin Carlino
fff75fa5ba Yuwen's new changelist UI (except for describing some of the changes in detail) 2020-09-14 17:40:04 -07:00