Commit Graph

215 Commits

Author SHA1 Message Date
Michael Kirk
cf69dd0370 slightly better approach to get the cut-scene looking better 2021-02-26 16:30:14 -08:00
Michael Kirk
bcba72cddf enable new day theme, but retain legacy theme for pregame 2021-02-26 16:30:14 -08:00
Michael Kirk
4b2f3888ed replace btn_solid w/ primary/outline as appropriate 2021-02-26 14:05:19 -08:00
Michael Kirk
6156311576 add btn_primary style 2021-02-26 14:05:19 -08:00
Michael Kirk
143fdc3fd5 label_underlined_text for "link" buttons 2021-02-26 14:05:19 -08:00
Michael Kirk
7e3d8bded9 per design: outline style for dropdowns 2021-02-26 14:05:19 -08:00
Michael Kirk
f5b52073fc shade dropdown/text-fields in night mode
Consistent with other themes, fields in night mode should be distinct
from the panel color, a shade darker.
2021-02-26 14:05:19 -08:00
Michael Kirk
3019a6fff1
Introduce Image component to handle themed icons (#537) 2021-02-25 18:06:19 -08:00
Michael Kirk
46593b01ed theme text field (and fixup layout) 2021-02-25 17:42:04 -08:00
Michael Kirk
6b8211c3ba theme dividers 2021-02-25 17:42:04 -08:00
Dustin Carlino
357ba15afe Add back the zcool font so the Taipei map renders names. But this time, asynchronously load the font instead of bundling it in system assets and increasing the .wasm size. #535
Temporarily take on some technical debt with the new RawFileLoader...
2021-02-25 15:25:47 -08:00
Dustin Carlino
6bfa569923
Support changing fonts in the middle of a line. Use this to draw numeric (#533)
IDs in the status bar as bold, not red.
2021-02-25 08:57:42 -08:00
Michael Kirk
5d7875d5be theme spinner 2021-02-24 20:17:18 -08:00
Michael Kirk
fc4a4d1071 Fix loading screen legibility
long-term we should probably get all the colors from Style, but until
then just hardcode White text since all other colors are hardcoded.
2021-02-24 20:17:18 -08:00
Michael Kirk
ac30774b06 theme dropdowns and menus 2021-02-24 18:10:06 -08:00
Michael Kirk
c6d361c4b0 remove take_menu 2021-02-24 18:10:06 -08:00
Michael Kirk
9533c10137 Theme switches
The main button API only allows re-writing one color of the image.

Since we need to rewrite multiple colors for the switch, I introduced a
`image_batch` for buttons which lets you do all kinds of manual
fanciness, and pass the result into the button API.
2021-02-24 14:59:47 -08:00
Michael Kirk
f34f6ab315 theme checkbox 2021-02-24 14:59:47 -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
1387a8c11f
Text gets default color from Style (#526) 2021-02-23 19:30:50 -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
316dcd7d06
themed buttons (#524)
* cargo fmt

* rename ButtonStyle to ButtonTheme to avoid ambiguity

widgetry::styles::button:ButtonStyle -> ButtonTheme is a collection of
colors

vs. widgetry::widgets::button::ButtonStyle which is a per-state styling
(hover vs. disabled etc.)

* 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.

* rethink rename... keep Style.ButtonStyle, rename button::ButtonStyle->ButtonStateStyle

* btn_solid_panel is the same as btn_solid
2021-02-23 11:49:28 -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
Michael Kirk
657887e90f stray mut 2021-02-23 11:32:20 -08:00
Dustin Carlino
8bee003808 Fix a few stray warnings from rustc, and improve a panic error message when data/system gets unexpected directory names 2021-02-23 11:16:43 -08:00
Michael Kirk
62a433ed8d btn_solid_panel is the same as btn_solid 2021-02-23 10:17:49 -08:00
Michael Kirk
dde3ca9f67 rethink rename... keep Style.ButtonStyle, rename button::ButtonStyle->ButtonStateStyle 2021-02-23 09:56:58 -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
Michael Kirk
cfaf441b89 rename ButtonStyle to ButtonTheme to avoid ambiguity
widgetry::styles::button:ButtonStyle -> ButtonTheme is a collection of
colors

vs. widgetry::widgets::button::ButtonStyle which is a per-state styling
(hover vs. disabled etc.)
2021-02-23 07:24:48 -08:00
Dustin Carlino
ecf7c0c836
On HiDPI screens with low resolution, allow widgetry applications to (#521)
* On HiDPI screens with low resolution, allow widgetry applications to
override the default scale factor in order to achieve a minimum width.
2021-02-22 15:59:57 -08:00
Dustin Carlino
b11cd48fb3 On the web, constantly update the --cam param in the URL with the current viewport. 2021-02-20 11:10:14 -08:00
Dustin Carlino
3f23a3c57c Remove hotkey buttons entirely, to get closer to Yuwen's button spec. 2021-02-15 13:02:29 -08:00
Dustin Carlino
0f1c30a889 Exclude collisions.bin from KML viewer; it's not KML anymore.
And fix a crash on the challenges screen by not considering the actions
of inactive buttons to count as duplicates.
2021-02-13 17:06:06 -08:00
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