Commit Graph

178 Commits

Author SHA1 Message Date
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
87a1a3f027 fix outline for spinner (without crashing!) and cache drawable 2021-02-27 15:29:03 -08:00
Dustin Carlino
603717a560 Remove the separate_cycleways experiment flag. Always import cyclepaths
mapped as separate OSM ways in all maps!!! #330
2021-02-26 14:58:57 -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
Michael Kirk
e6ed2e67de Collapse button styles to be theme specified (no visible changes).
Button colors are now determined by the color scheme, but for now all
schemes are hardcoded to use the same "night" button colors. Read on for
rationale...

Previously, which button colors to use (dark/light) was specified inline
while building the UI.

Eventually we want to live in a world where color scheme determines:
- panel colors
- button colors
- text colors

The theme could already choose panel colors easily enough, but because
the buttons and text were not determined by theme, choosing anything
other than a black or dark grey panel color makes the buttons and text
unreadable.

This PR tackled the themeable "button colors" portion, but all themes
continue to use the "night" colors for now, because using the actual
"day" colors would still make the text unreadable.

next up: themeable text!

The one intentional regression is within the pregame tutorial,
which has always been styled differently from the rest of the app. An
expeditious hack has caused the prev/next/continue buttons to lose their
visible hover state. I'll restore this upon completing the day theme
work.
2021-02-23 09:52:33 -08:00
Dustin Carlino
f4103cf1fe Redraw the intersection in map_editor when deleting or creating a road.
[rebuild] [release]
2021-02-21 10:17:38 -08:00
Dustin Carlino
add122549f Modernize map_editor code: EventCtx should always be the first param 2021-02-20 10:03:06 -08:00
Dustin Carlino
1ed5e7c444 Add a toggle in the map_editor to show all intersection geometry or not. Subsumes the confusing previous preview tool. 2021-02-20 09:57:06 -08:00
Dustin Carlino
2c0334a37d Make the map_editor read .osm directly 2021-02-20 09:31:52 -08:00
Dustin Carlino
15b154aa23 Explicitly draw the OSM boundary in the map_editor, so we can effectively create borders 2021-02-19 17:33:37 -08:00
Dustin Carlino
94c8a34804 More map_editor:
- toggle traffic signals / stop signs
- show the direction of a road when editing it, so left/right have
  context
2021-02-19 16:54:22 -08:00
Dustin Carlino
d74fa982b5 Context-sensitive instructions in the map_editor, once again 2021-02-19 16:31:57 -08:00
Dustin Carlino
cce43daecc Restore the map_editor to some of its former glory:
- start showing partial instructions again
- remove old debug popup
- start a new road editor
2021-02-19 16:24:13 -08:00
Dustin Carlino
39f5d50fcd The grand country split. #326
City names are now disambiguated by a two-letter country code. This
commit handles almost everything needed to make this transition. Main
next steps are fixing up map edits automatically and making the city
picker UI understand the extra level of hierarchy.

A little bit of fallout: lakeslice gridlocks again; this regression is
actually from the recent traffic signal changes, but I'm just now
regenerating everything. Will fix soon.
2021-02-13 15:45:59 -08:00
Dustin Carlino
73e405e382 Upgrade most dependencies 2021-02-03 18:13:06 -08:00
Dustin Carlino
341ce834e3 Based on startup params, display an extra 'study area' on the map. cyipt/actdev#44 2021-01-27 13:00:48 -08: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
Dustin Carlino
c9c6f240ae Remove timer.{note, warn, error} in favor of the log crate. #262
Originally, the intention of the deleted calls was to not interrupt
Timer progress bars with warnings. But the output of things like the
importer is impossible to read anyway. Strongly considering explicitly
sending logs and timing info to separate places and using something like
multitail for live progress.

Unplumb timer from LOADS of places that just needed it for logging.
2021-01-21 19:22:02 -08:00
Michael Kirk
b924d40daa regex update Btn::text_fg simple hotkeys, inline &str 2021-01-21 15:25:46 -08:00
Michael Kirk
a2c5ce0fb3 regex upgrade Btn::text_fg: No hotkeys, inline &str
Btn\:\:text_fg\("([^"]*)"\).build_def\(ctx, None\)
ctx.style().btn_secondary_light_text("$1").build_def(ctx)
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
Dustin Carlino
0a353f67f8 When importing external scenario data for cyipt/actdev#32, snap border endpoints based on the allowed modes of each border. Without this, some driving trips snap to the cycleway next to a road.
212 cancelled trips (that immediately failed) down to 140.
2021-01-15 21:45:42 -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
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
64ef2f025a Restore the ability to merge short roads at the RawMap layer and in the
map_editor. It was nuked in 182f5139a5,
when I decided the MapFixes approach wasn't worth it. #114

The restored version doesn't attempt to handle turn restrictions again
yet.
2020-12-28 17:21:20 -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
607a8757dd Use widgetry to handle quitting things, so we don't just blow up on the
web.
2020-12-11 13:18:20 -08:00
Dustin Carlino
abf3dbc859 Don't specify a widgetry backend by default; force every user to set the feature explicitly. 2020-11-22 18:35:03 -08:00
Dustin Carlino
f656468580 widgetry refactor: store all keys currently held down, let anyone query 2020-11-22 13:24:08 -08:00
Dustin Carlino
a3bcf5181c Make the map editor be able to produce synthetic .osm, and use it to
create a map exemplifying the lane-changing problems of #382.
2020-11-11 10:44:45 -08:00
Dustin Carlino
67530bec07 Future-proof file organization by changing map_name from a string to a
struct. Whatever choices we make next about naming cities hierarchially
or not can be managed in just one place. #326

This is a pretty huge change, but the compiler gives reasonable
confidence it's correct. More bugs are likely to crop up in the next
step, when filenames start being namespaced by the city too.
2020-11-04 17:26:32 -08:00
Dustin Carlino
4624baad0b Woops, binary format of MapConfig changed, so regenerate all maps 2020-10-31 10:08:05 -07:00
Dustin Carlino
3b838c1225 Finish formatting distance/duration/speed units nicely. And remove the
number of lanes from trip info; it's misleading and not useful. #331
2020-10-28 11:33:48 -07:00
Dustin Carlino
806d5d59db Just regenerate Cargo.lock; the format changed in rust 1.47, and I don't want a later diff updating deps to create a huge diff 2020-10-26 15:07:51 -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
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
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
d9e50a7e38 Use .into() for specifying keys to widgetry more ergonomically. #253 2020-09-18 09:26:14 -07:00
Dustin Carlino
de6a12e472 After much deliberation, rename Composite -> Panel (#253) 2020-08-27 12:12:44 -07:00
Dustin Carlino
2935d2379b Mechanical rename of ezgui -> widgetry, a much better name to enchant the Rust community. #253 [rebuild] 2020-08-27 10:37:04 -07:00
Dustin Carlino
ad423b22e9 Remove the glium backend, now that @michaelkirk has gotten the glow native/wasm backends ship-shape. Got rid of the glutin fallback behavior for now; need to ideally upstream something there for #103 2020-08-20 16:59:54 -07:00
Dustin Carlino
11cefb118a And the same thing for OriginalIntersection
Actually, don't need to regenerate map data. Thanks to the magic of
zero-cost wrapper types, the binary format is the same.
2020-08-13 11:48:13 -07:00
Dustin Carlino
843d24b6ed Refactor: OriginalBuilding should just be OsmID. The purpose of
OriginalBuilding was to refer to buildings in a stable way across
different maps and across OSM updates. Recently, OsmID and friends
appeared. The double layer of wrapping is an annoying API.

Not regenerating map data yet; about to do the same thing for
OriginalIntersection
2020-08-13 11:37:06 -07:00
Dustin Carlino
d1e9e38e82 refactor for #231: use typed OSM IDs everywhere, dedupe URL code
have to regen, the binary format has changed
2020-08-08 16:09:36 -07:00
Dustin Carlino
cd712009ec whittle down old stuff from map_editor. i think it still has value as a RawMap viewer with an easy way to move points and quickly iterate on intersection geometry, but things like lane editing and turn restriction viewing aren't useful anymore. 2020-08-05 08:38:04 -07:00