Dustin Carlino
6e7a91ada1
Upgrade to Rust 1.50. Use the new f64 clamp instead of our own. [rebuild]
2021-02-11 10:32:13 -08:00
Michael Kirk
4b665c871d
update geo related deps. ( #508 )
...
geo-types to 0.7
geo to 0.17 which removes redundant old geo used by polylabel
geojson to 0.22
2021-02-08 16:34:56 -08:00
Michael Kirk
3449d49b6d
WebGL 1.0 support, with automatic fallback for Safari/iOS ( #504 )
...
#506
2021-02-06 19:04:43 -08:00
Dustin Carlino
3a7f39a6da
Downsample points on a line-series plot for drawing. Otherwise, the arrivals plot on a border intersection in downtown winds up with more than 2^16 points.
2021-02-04 11:27:57 -08:00
Dustin Carlino
fd423439b8
Upgrade tokio, hyper, and lru
2021-02-03 18:33:06 -08:00
Dustin Carlino
73e405e382
Upgrade most dependencies
2021-02-03 18:13:06 -08:00
Dustin Carlino
eebe7a098a
Start a UI with some sliders for tuning existing params of route cost functions. No effect yet. #494
2021-02-02 14:39:39 -08:00
Michael Kirk
38dc60fbea
Add method to GeomBatch to prefer cached flavor of loading svg. ( #493 )
...
It was my intention when introducing the cached vs uncached flavors that
we'd prefer the cached flavor for anything referencing bytes from a
file, like icons and UI glyphs, and that we'd only use the uncached
flavor for dynamic things like "face" generation.
2021-02-01 16:24:56 -08:00
Dustin Carlino
3e40686a6b
Fix a bunch of links after the repository renaming.
2021-01-31 15:50:48 -08:00
Dustin Carlino
8f0c027bb0
Fix critical bug causing a crash only in the .zip releases, where widgetry icons aren't present relative to the data/ directory.
2021-01-30 14:20:28 -08:00
Dustin Carlino
16124f3f3b
Include the vertical scrollbar when calculating panel size for horizontal alignment. Fixes #484
2021-01-28 10:31:47 -08:00
Dustin Carlino
e306a48994
Fix prev/next buttons on the trip table; the keybindings got inverted during the refactor.
2021-01-27 08:57:47 -08:00
Dustin Carlino
cbf0763327
Move 3 SVGs into widgetry icons, bundling them into the build. Discovered these missing by updating https://github.com/dabreegster/streetcad
2021-01-26 14:18:41 -08:00
Dustin Carlino
56101addcf
Remove the zcool font and Xi'an import. #377
...
The Xi'an map isn't being regularly used, and it has some issues
(boundary is too large, OSM is missing buildings in most of the area).
The zcool font enables Chinese characters to render, but costs 6MB in
the binary files, slowing down wasm loading time. Eventually, we can
support async loading fonts and passing them to widgetry when loading a
map requiring them. For now, cutting down wasm size is a bigger
priority.
game wasm from 18MB to 12MB. Not bad!
2021-01-24 20:30:20 -08:00
Michael Kirk
07738d2cef
popup and persistent split to spec ( #480 )
...
* introduce "pill" to be explicit about fully rounded, vs a "None" radius
* no-op transition to CornerRadii
* popup button to spec
* restore "fully rounded" layout behavior
* use plain light to better show highlight
* persistent split to spec (for day theme anyway)
* remove night-theme colors for speed panel
* fixup docs for pill
* CR: remove unnecessary `row`
* CR: remove outdated doc
* import order
2021-01-24 15:32:28 -08:00
Dustin Carlino
ab801b8ae1
Vertically line up the header for layer panels.
2021-01-24 13:23:30 -08:00
Dustin Carlino
7d8c818eea
Remove the last traces of the old orange hovering color.
2021-01-24 13:09:37 -08:00
Michael Kirk
f71176578f
stroke for non-colored checkboxes
2021-01-24 10:32:41 -08:00
Michael Kirk
8211329c6f
more contrast in hotkey color
2021-01-24 10:32:41 -08:00
Michael Kirk
1a3d1b4cdb
reconcile new button styles w/ dark theme ( #475 )
2021-01-22 21:21:38 -08:00
Dustin Carlino
4446d99fad
Merge branch 'mkirk/btn-fix' of https://github.com/michaelkirk/abstreet into michaelkirk-mkirk/btn-fix
2021-01-22 21:13:13 -08:00
Michael Kirk
3855f284b8
Fix hotkey conflict
...
Even though we *usually* want these hotkeys for next/prev, sometimes we
don't, and the damage of forgetting to add them to a new pager is less
than the damage done if we forget to remove them and clobber something
important like the speedup/slowdown controls.
2021-01-22 15:31:33 -06:00
Michael Kirk
1990642dee
More conventional button names
...
This was all done by search/replace, and should not affect
functionality.
Goals:
- be consistent with the figma terminology.
- consistently order:
"btn_{solid|outline|plain}_{dark|light}_{text|image|dropdown|back|etc}"
2021-01-22 13:11:42 -06:00
Michael Kirk
8579add567
better docs
2021-01-22 10:23:50 -06:00
Michael Kirk
1325c115a1
cache SVG's when reasonable. Clarify when they aren't cached.
2021-01-22 09:54:50 -06:00
Michael Kirk
202aec77cf
cleanup with include_labeled_bytes!
2021-01-22 09:54:50 -06:00
Michael Kirk
4e48de6185
compile in asset bytes for widgetry assets
2021-01-22 09:54:50 -06:00
Michael Kirk
7bc9145ce9
bake-in widgetry assets: image_path -> image_source::{Path, Bytes}
2021-01-22 09:54:50 -06:00
Dustin Carlino
dc19d11f64
Make the file management menu in edit mode occupy the center of the screen.
2021-01-21 15:36:21 -08:00
Michael Kirk
79b9d9f961
fix checkbox color for Info > Traffic > "Show before {}"
2021-01-21 15:25:46 -08:00
Michael Kirk
882de86661
Maybe fix weird toggle background
2021-01-21 15:25:46 -08:00
Michael Kirk
e10a8bd2a3
proper its
2021-01-21 15:25:46 -08:00
Michael Kirk
f9fdce9637
replace arrow text with arrow image
2021-01-21 15:25:46 -08:00
Michael Kirk
f218d72390
docs
2021-01-21 15:25:46 -08:00
Michael Kirk
4989887117
remove final references to Btn
2021-01-21 15:25:46 -08:00
Michael Kirk
de527bc9d8
remove unused imports
2021-01-21 15:25:46 -08:00
Michael Kirk
1f75145a8a
introduce btn_next/btn_prev, parameterize disabled
to simplify common usage
2021-01-21 15:25:46 -08:00
Michael Kirk
bfb190a730
manually update remaining Btn::text_bg2
2021-01-21 15:25:46 -08:00
Michael Kirk
a5b6dca62a
replace Btn::text_bg2 w/ regex
...
In case I have to revisit, here's the regex I used:
Btn::text_bg2\(([^)]*)\)*.build_def\(ctx, ([^()]*)\)
ctx.style().btn_primary_dark_text($1).hotkey($2).build_def(ctx)
And something like this for the "no hotkey" case
Btn::text_bg2\(([^)]*)\)*.build_def\(ctx, None\)
ctx.style().btn_primary_dark_text($1).build_def(ctx)
2021-01-21 15:25:46 -08:00
Michael Kirk
652c35b220
replace Btn::text_bg
2021-01-21 15:25:46 -08:00
Michael Kirk
54e937408a
remove remaining Btn::plaintext
2021-01-21 15:25:46 -08:00
Michael Kirk
3febbf2f81
destructive primary for destructive action
2021-01-21 15:25:46 -08:00
Michael Kirk
0f476b6a36
pagination uses icon button
2021-01-21 15:25:46 -08:00
Michael Kirk
fc6c18e608
replace Btn::SVG
2021-01-21 15:25:46 -08:00
Michael Kirk
69e31029ac
replace Btn::svg_def
2021-01-21 15:25:46 -08:00
Michael Kirk
ea39fecf03
replace Btn::pop_up
2021-01-21 15:25:46 -08:00
Michael Kirk
4e5443683b
CR: remove unused method
2021-01-21 09:08:41 -08:00
Michael Kirk
0a612601ca
icon buttons should be same height as text buttons
2021-01-21 09:08:41 -08:00
Michael Kirk
c013c8d342
replace remaining Btn::custom
2021-01-21 09:08:41 -08:00
Michael Kirk
52880c68d8
replace Btn::custom in switch and checkboxes
...
(also add SVG checkboxes!)
2021-01-21 09:08:41 -08:00
Michael Kirk
5b6c88d3b4
more button progress and fixups ( #465 )
...
* replace Btn::txt with new ButtonBuilder styles
* fixup! replace Btn::text_bg1 with ButtonBuilder (btn_primary_light)
2021-01-20 14:11:28 -08:00
Michael Kirk
11ffef5716
replace Btn::text_bg1 with ButtonBuilder (btn_primary_light)
2021-01-19 17:40:35 -08:00
Michael Kirk
e1ec69f9f7
Replace Btn::plaintext_custom with new ButtonBuilder
2021-01-19 17:40:35 -08:00
Michael Kirk
def3644eca
add "destructive" (red) button styles
2021-01-19 17:40:35 -08:00
Michael Kirk
743b74510d
replace Btn::close with new style ( #463 )
2021-01-19 16:17:11 -08:00
Michael Kirk
d7445d889e
button revamp groundwork ( #459 )
2021-01-19 10:10:18 -08:00
Michael Kirk
356a64ec87
rename INVISIBLE -> CLEAR
...
easier to type name
2021-01-16 21:16:14 -08:00
Michael Kirk
bbe94537ef
impl Debug for GeomBatch
2021-01-16 21:16:14 -08:00
Michael Kirk
a8cbda24e3
Copy/Clone/Debug/PartialEq for EdgeInsets
...
At the moment I just needed Debug, but these others seem likely.
2021-01-16 21:16:14 -08:00
Dustin Carlino
92423ef932
Fix previous change -- forgot to move a draw call into the conditional. For some reason, the problem is only reproducible in release mode on S3, not when serving locally.
...
Ahhh typo in the URL -- it happens when specifying a bad map name.
2021-01-11 16:02:50 -08:00
Dustin Carlino
556a8345bf
Sometimes loading a map on the web tries to draw the previous state when the stack only has one. Not totally sure why, but avoid crashing.
2021-01-11 15:21:27 -08:00
Dustin Carlino
fea3ebbe5b
Change the city picker UI to show cities on the left. After clicking one, open up the overview for that city.
2021-01-08 15:51:22 -08:00
Dustin Carlino
82c1495cc4
Seemingly fix the first screenshot of some maps by double drawing the first tile. Not sure what the problem is or why this appears to fix it.
2021-01-07 20:22:27 -08:00
Dustin Carlino
65b2b581fa
Attempt to take many screenshots of one map at different zoom levels for Leaflet. Various bugs, but progress. #440
2021-01-06 16:33:53 -08:00
Dustin Carlino
5b4a689125
Initial steps to internally refactor buttons. Name action/label/tooltip
...
consistently.
2021-01-06 11:07:24 -08:00
Dustin Carlino
92be9c57ed
Optionally tile screenshots at smaller dimensions than the window. #440
2021-01-06 10:52:22 -08:00
Dustin Carlino
4cf133cc32
Make the new screencaps preserve alpha properly by switching to
...
premultiplied alpha. See option 1 of
https://stackoverflow.com/a/24380226
Upload the "new" screenshots (and lakeslice map)!
2021-01-05 18:28:30 -08:00
Dustin Carlino
7f0cdace5a
Use OpenGL to take screenshots instead of scrot. Benefits:
...
- Simple -- one OpenGL call and feeding to the awesome image crate
- Faster -- seemingly don't need the sleep() for whatever vsync problems
- Portable -- doesn't use the Linux scrot tool
- I can switch windows and wiggle the cursor with impunity while this runs
One disadvantage: screencaps in S3 are now slightly larger PNGs, because
for some reason, the image/gif feature is super slow, even in release
mode.
For now, this makes the process of screenshot diffing map changes
easier. But it also might help with producing raster tiles for Leaflet. #440
Also, had to regenerate lakeslice because of the previous change --
it had an old adaptive signal baked in.
2021-01-05 14:58:31 -08:00
Dustin Carlino
dedb041bdb
Move CameraState to map_gui. Now widgetry has no dependency on abstio! #253
2021-01-04 10:39:15 -08:00
Dustin Carlino
bfa208ce6a
Parameterize widgetry on a way to read SVG files. This is one of the last steps to remove the dependency on abstio. #253
2021-01-04 09:53:24 -08:00
Dustin Carlino
d529ae2e5c
Upgrade usvg and rand
2021-01-04 09:19:54 -08:00
Dustin Carlino
965d999199
Upgrade misc other dependencies
2021-01-03 20:01:27 -08:00
Dustin Carlino
5c04923dff
Split abstio crate out from abstutil. #253
...
widgetry, geom, and abstutil may wind up on crates.io in some form to
let other projects use widgetry. abstio has A/B Street-specific tricks
for reading data on native/web. Note widgetry still depends on abstio,
will figure out how to clean that up next.
2021-01-02 10:28:00 -08:00
Dustin Carlino
795c6bebb1
When producing GeoJSON, represent Polygons that arent Rings (like from SVGs) as a MultiPolygon of every pre-calculated triangle. #440
2021-01-01 15:33:11 -08:00
Dustin Carlino
b7d025b6a6
Simplify DrawRoad a bit (center line and label in the same batch). Include it in GeoJSON export. #440
2021-01-01 15:18:01 -08:00
Dustin Carlino
302ec94e3d
Try exporting the zoomed-in rendering of a map to geojson. #440
...
This approach has some manual effort and it's not capturing everything
yet, but it's a start.
2021-01-01 12:46:25 -08:00
Dustin Carlino
cd43d94196
Fix uber turn viewer -- the panel in the SimpleState wasn't being
...
displayed
2020-12-28 15:37:05 -08:00
Dustin Carlino
001aa836d2
Organize assets that're baked into widgetry. They don't belong in the
...
data/ directory, because they're statically bundled; they're not
actually read from the filesystem. #253
Two SVGs get duplicated between widgetry and abst assets -- dont_walk
and arrow_drop_down.
2020-12-28 10:40:55 -08:00
Dustin Carlino
fdfa2dbe8c
Bundle some of the widgetry SVG assets in directly, so other users don't need to copy part of the data/ directory. [rebuild] [release]
2020-12-26 21:31:51 -08:00
Dustin Carlino
af5811c33c
Lift Cached to widgetry
2020-12-26 14:38:43 -08:00
Dustin Carlino
c1de1678b7
Record the path a player takes, and display that afterward
2020-12-20 12:58:11 -08:00
Dustin Carlino
34c45e562b
Use the table widget to improve 15 min amenity details. #393
2020-12-19 16:43:55 -08:00
Dustin Carlino
0bcf130b80
Lift the generic table to widgetry
2020-12-19 16:06:30 -08:00
Dustin Carlino
631b164cf8
Add a warning when low on time or blood sugar
2020-12-17 15:50:29 -08:00
Dustin Carlino
d917008f2e
Lift SimpleState to widgetry, since it doesn't depend on any details of
...
the App at all. Use it in the experiment a bit.
2020-12-17 12:23:57 -08:00
Dustin Carlino
524f42ab61
Make the title screen more legible, add full credits. [rebuild]
2020-12-15 13:43:33 -08:00
Dustin Carlino
16392a461f
Refactor: GeomBatch::load_svg directly takes EventCtx or GfxCtx. The prerender struct should ultimately not be exposed outside of widgetry.
2020-12-15 11:44:58 -08:00
Dustin Carlino
02dd3613cd
Refactor: Rename txt.render_to_batch to txt.render_autocropped, and make
...
it take EventCtx or GfxCtx
2020-12-15 11:35:40 -08:00
Dustin Carlino
524ea30faa
Fix inactive button style, by applying layouting hints in isolation and
...
then drawing the resulting batch. Before, the layouting hints caused the
inactive "buttons" to stretch out horizontally.
2020-12-15 11:08:00 -08:00
Dustin Carlino
f6db70b0e5
Nicer panel for picking a vehicle before a level
2020-12-14 16:02:18 -08:00
Dustin Carlino
7ffa7f73f8
- Tune sprite size
...
- Fix duplicate unlocked vehicles
- Tune the zoom in-game
- Distinguish goal for each level, vs max possible score
- New time left panel
2020-12-13 12:44:43 -08:00
Dustin Carlino
3b9246860a
Upgrade winit and glutin. No noticeable changes. [rebuild]
2020-12-11 20:47:00 -08:00
Dustin Carlino
87b4d1bb93
Performance optimization: don't update panels unnecessarily, and don't
...
do expensive updates unless time is passing. Before this, you could
introduce serious by wiggling the mouse!
2020-12-08 09:56:59 -08:00
Dustin Carlino
e03f356a0e
Depend on upstream usvg and fontdb, now with pure-Rust rustybuzz support
...
in web!
2020-12-07 10:30:50 -08:00
Dustin Carlino
b1811c21ab
Add a progress bar for the initial .wasm loading. #377
...
It's now easier to understand the possibly slow downloading of the 80MB
.wasm.
2020-12-05 20:55:07 -08:00
Dustin Carlino
12d0294692
Minimap tracker and new meters
2020-12-03 15:09:54 -08:00
Dustin Carlino
08d6f6987f
Figure out when we pass a building along a road
2020-12-02 18:00:51 -08:00
Dustin Carlino
69b14e444f
Simpler abstutil APIs: return string errors immediately, don't make callers transform. We don't need to distinguish different error types anywhere.
2020-12-02 08:44:07 -08:00
Michael Kirk
dab38e36ac
fixup! map_err -> or_else
2020-12-01 17:49:41 -08:00
Michael Kirk
9ebd939b3f
map_err -> or_else
2020-12-01 17:49:41 -08:00