Commit Graph

763 Commits

Author SHA1 Message Date
Dustin Carlino
37bcfab7af whoa, tspan exists and is magical. simplify things... 2020-02-08 10:36:44 -08:00
Dustin Carlino
bd20d61500 use my own enum for font. remove glium-glyph dependency completely 2020-02-08 10:36:44 -08:00
Dustin Carlino
95c1f47047 clean up text_dims, then unplumb a BUNCH of stuff 2020-02-08 10:36:44 -08:00
Dustin Carlino
9355bcf5fd cutover mapspace text quickly (without doing the scaling down yet.
delete lots of stuff.
2020-02-08 10:36:44 -08:00
Dustin Carlino
234689533a woohoo, dismantle screenspace glyphs entirely 2020-02-08 10:36:44 -08:00
Dustin Carlino
7f0539bcac cutting over more internal callers to new thing 2020-02-08 10:36:44 -08:00
Dustin Carlino
ab1652aa77 cutover text_dims to the new thing. fixes lots of buttons. 2020-02-08 10:36:44 -08:00
Dustin Carlino
613fa73a32 offset negative dims. doesnt quite work but kinda leaving this in... 2020-02-08 10:36:44 -08:00
Dustin Carlino
a9ef443c17 handle empty lines 2020-02-08 10:36:44 -08:00
Dustin Carlino
ec08a9177e custom font families 2020-02-08 10:36:44 -08:00
Dustin Carlino
3eea1f2a45 changing DrawBoth internally to use the new thing. this actually gets
most callers!
2020-02-08 10:36:44 -08:00
Dustin Carlino
fa6cbea28c be able to handle generic Text 2020-02-08 10:36:44 -08:00
Dustin Carlino
b6b1be7d18 starting a way to add some text to a GeomBatch 2020-02-08 10:36:44 -08:00
Dustin Carlino
59686dddbc can we render svg text directly? need harfbuzz. [rebuild] 2020-02-08 10:36:44 -08:00
Dustin Carlino
bdb4ba43ba less terrible stop sign editor [rebuild] 2020-02-05 16:54:10 -08:00
Dustin Carlino
a878f57a42 refactor rotating colors, and use a different palette for the 10 bucket case 2020-02-05 14:53:22 -08:00
Dustin Carlino
10ef4057a0 make buttons in sandbox dash look more like tabs 2020-02-05 13:01:35 -08:00
Dustin Carlino
2d73513b0c flexbox trick to make sure plot axes arent stretched out too much when embedded in larger panels 2020-02-05 12:44:05 -08:00
Dustin Carlino
b0a56abb6e no more prompt in some of the popups, adjust the menu coloring, cancel
popups by clicking on the map
2020-02-04 13:41:09 -08:00
Dustin Carlino
7f82241ed9 put some popup menus beneath their buttons 2020-02-04 13:25:53 -08:00
Dustin Carlino
28d593797a overhaul fullscreen layouts: splash menu, about, challenge picker,
sandbox dashboards. I think I understand enough of the tricks now.
2020-02-03 16:13:40 -08:00
Dustin Carlino
92c2fca55e make the details button in signal challenge inactivate 2020-02-03 12:01:13 -08:00
Dustin Carlino
acef70add0 draw after update events [rebuild] 2020-02-02 22:16:02 -08:00
Dustin Carlino
abba4be202 filter out overlays intelligently 2020-02-01 11:39:48 -08:00
Dustin Carlino
8228f53d02 make it easier to debug objects by warping to them, draw turn cycler
arrows a little more successfully
2020-01-31 14:06:37 -08:00
Dustin Carlino
800008dc03 making the histogram more clear about same trips 2020-01-30 15:33:27 -08:00
Dustin Carlino
da92518d62 align all overlay panels above the minimap 2020-01-30 14:38:26 -08:00
Dustin Carlino
78344ee2a4 simplify traffic signal challenge's communication of main score. move
count/duration comparators to a more general place.
2020-01-30 10:49:20 -08:00
Dustin Carlino
cfbaf80fe3 autoscroll signal editor to show the current phase 2020-01-29 15:59:56 -08:00
Dustin Carlino
d54384742a tune minimap controls. also avoid the brief flash of a loading screen
when it's very fast [rebuild]
2020-01-29 13:35:36 -08:00
Dustin Carlino
43ea723111 tune lane editor style, and refactor some widget centering patterns
[rebuild]
2020-01-29 12:16:18 -08:00
Dustin Carlino
8a966395af prevent a crash with spawning agents around intersections. tiny tutorial tweaks 2020-01-28 14:33:55 -08:00
Dustin Carlino
e733fe9d94 plumb real time passed through Update event, just base off of that 2020-01-28 09:39:44 -08:00
Dustin Carlino
bef513ec8b inactive buttons in tutorial mode 2020-01-27 15:22:53 -08:00
Dustin Carlino
52e921ff66 tune miter explosion threshold for plots 2020-01-25 14:30:28 -08:00
Dustin Carlino
dea77369a5 fix crash when an info panel becomes smaller in a direction and scroll offset was too big 2020-01-25 14:25:47 -08:00
Dustin Carlino
d3b2055b8f plot grid lines 2020-01-25 13:28:50 -08:00
Dustin Carlino
6d016cd01b stop blindly plumbing through no-op events after any input is used. do
it more explicitly in just a few places.

fixes crash when cycling through turns while sim is running.

this makes modal menus appear laggy, but that's fine; phasing those out
anyway.
2020-01-23 17:11:29 -08:00
Dustin Carlino
89a269a59e consolidating other button styles, and adjusting signal editor colors 2020-01-23 16:05:35 -08:00
Dustin Carlino
76f5cde433 nicer text button style for the top bar 2020-01-23 15:35:08 -08:00
Dustin Carlino
fd0cdb4fdb skip empty warps 2020-01-22 15:42:10 -08:00
Dustin Carlino
bdd05ee1a7 point out the car to follow 2020-01-22 15:36:17 -08:00
Dustin Carlino
75281ed354 when we change states, immediately run through a round of no-op event(). this lets us immediately draw a WizardState without having to flail the mouse a bit to trigger a first event.
(also, fix release script again)
2020-01-22 11:47:06 -08:00
Dustin Carlino
95a84fd26a tweaking rustfmt options; the long literal string vecs in tutorial look awful 2020-01-21 15:20:02 -08:00
Dustin Carlino
318faacbdb less silly scrollbar colors 2020-01-21 15:06:40 -08:00
Dustin Carlino
dfd8d43b83 tutorial stage introducing the minimap. point to widgets more precisely. 2020-01-21 15:01:10 -08:00
Dustin Carlino
73680948b5 use top-center panel for more things in all challenge modes. remove help
functions in favor of putting more info in the challenge description
2020-01-20 13:52:11 -08:00
Dustin Carlino
67ebb76f94 tiny refactor of rounded_rectangle. pad time panel 2020-01-20 12:36:27 -08:00
Dustin Carlino
2c5030926c add outline to any widget. use to outline popup menus a bit 2020-01-19 14:18:38 -08:00
Dustin Carlino
1e49d4b6eb adjust parking heatmap color. start changing sandbox mode's top-center
panel
2020-01-19 14:04:59 -08:00
Dustin Carlino
901b938b31 dont let screenspace things see cursor if it's in mapspace. fixes clicking buttons hidden by clipping. 2020-01-17 14:11:07 -08:00
Dustin Carlino
1c3b7fe52b cut down the places populating covered_areas. mainly Composite should do it, being aware of clipping. some temporary exceptions remain. 2020-01-17 13:58:33 -08:00
Dustin Carlino
14596d00ea lock down many widgets from being used outside of Composites 2020-01-17 13:50:13 -08:00
Dustin Carlino
3cf916a2bc adjust info panel dims slightly [rebuild] 2020-01-16 18:19:30 -08:00
Dustin Carlino
aff092776e fix hidpi issue ONCE AND FOR ALL. tested successfully on linux and
windows. [rebuild]
2020-01-16 10:38:01 -08:00
Dustin Carlino
bb01c30b9d scale scrollbar length to show how much stuff is actually scrollable 2020-01-15 12:07:25 -08:00
Dustin Carlino
a349eb330b fix flex wrapping and other weird issues 2020-01-15 11:21:32 -08:00
Dustin Carlino
c1f35aca46 simplify size management -- minimal size by default, can limit max size 2020-01-15 10:33:08 -08:00
Dustin Carlino
5af9c7e17b every composite will automatically be scrollable if needed. simplify API. 2020-01-15 10:19:21 -08:00
Dustin Carlino
ffb8270b10 treat the percentage as a max, not a set limit 2020-01-14 16:53:11 -08:00
Dustin Carlino
8eecb6e190 draw the scrollbars outside the clip 2020-01-14 16:50:26 -08:00
Dustin Carlino
b348e5d393 position the scrollbars so that theyre always visible. is kind of
broken.
2020-01-14 16:46:45 -08:00
Dustin Carlino
851e12f432 simplify some code without changing behavior 2020-01-14 15:57:21 -08:00
Dustin Carlino
d637243f2a support horizontal scrolling 2020-01-14 15:47:35 -08:00
Dustin Carlino
6db84efdae WIP clip composites 2020-01-14 15:18:27 -08:00
Dustin Carlino
f613b003a4 fix scissor DPI issue once and for all? the math was backwards [rebuild] 2020-01-14 10:50:18 -08:00
Dustin Carlino
3482d61c0d attempt to detect hidpi changes? [rebuild] 2020-01-13 19:13:00 -08:00
Dustin Carlino
cca6ce48a6 creep towards floating info panels, by moving it away from the corner of the screen 2020-01-13 18:52:44 -08:00
Dustin Carlino
bb141c7026 also clip text. not used quite yet. 2020-01-13 18:26:24 -08:00
Dustin Carlino
61e8003cca upgrade glutin (and thus winit). maybe will help dpi issues on some
platforms? [rebuild]
2020-01-13 17:07:31 -08:00
Dustin Carlino
8a7e3cecff make clipping be a stateful API, as prep for clipping composites 2020-01-13 16:57:09 -08:00
Dustin Carlino
90300c655e switch remaining signal editor stuff to a top-center panel 2020-01-13 15:56:25 -08:00
Dustin Carlino
af76ad9d60 wrap text in signal diagram to limit width 2020-01-13 14:57:46 -08:00
Dustin Carlino
1ab3c5200a limit max unzoom based on actual map dims 2020-01-13 14:39:02 -08:00
Dustin Carlino
0a771404ea make the zoom in/out fully feature actually smoothly zoom 2020-01-13 14:01:56 -08:00
Dustin Carlino
30664d9791 stop listing edits in main edit mode too 2020-01-13 09:51:35 -08:00
Dustin Carlino
ec1e3f435b make it easy to dump raw events for debugging on windows/mac [rebuild] 2020-01-12 09:35:38 -08:00
Dustin Carlino
f1b42ecdb9 consolidate composite layouting... just need to know alignment and percentage of screen 2020-01-11 14:59:27 -06:00
Dustin Carlino
0023002935 proof of concept: max size for composites! 2020-01-11 14:32:41 -06:00
Dustin Carlino
abe89d65f8 center popup menus 2020-01-11 14:02:47 -06:00
Dustin Carlino
60c20230ec align X button to the right. flexbox is so unintuitive. 2020-01-11 13:54:42 -06:00
Dustin Carlino
6469664b5f dont crash when changing phases without a scrollbar 2020-01-10 12:28:13 -06:00
Dustin Carlino
511c451e8a totally ditch the fixed Composite positioning 2020-01-10 12:01:05 -06:00
Dustin Carlino
e2de6b24d9 start windows maximized 2020-01-10 11:23:52 -06:00
Dustin Carlino
c64b445bd9 clicking a menu entry in a wizard was double-using the event 2020-01-10 09:30:37 -06:00
Dustin Carlino
11ece6b188 no more log scroller. have an OK button 2020-01-09 17:54:07 -06:00
Dustin Carlino
1d379e8315 zoom limits 2020-01-09 15:57:34 -06:00
Dustin Carlino
45c7ee08e1 remove speed slider, use the 3 settings instead 2020-01-08 10:55:34 -06:00
Dustin Carlino
5ae2557b2c adjusting some speed panel buttons. the new triangles dont do anything
yet.
2020-01-07 12:52:56 -06:00
Dustin Carlino
24565cfe49 refactoring composite builder API 2020-01-07 12:08:39 -06:00
Dustin Carlino
0ad371525b after clicking a button, figure out if we're hovering over any new buttons that're created. kind of an invasive refactor to get to this, but worth it. 2020-01-07 11:43:34 -06:00
Dustin Carlino
9aac76ee39 draw less terrible bus stops 2020-01-04 09:50:03 -06:00
Dustin Carlino
4ae7a04d79 last commit broke wizard menus, fix it 2020-01-03 09:28:29 -06:00
Dustin Carlino
27912bdaf0 elide scrollbar if it's not needed 2020-01-02 12:26:24 -06:00
Dustin Carlino
3bd4a7220d make popup menus use scrolling 2020-01-02 11:35:41 -06:00
Dustin Carlino
642084c595 rotate walk icons 2020-01-02 10:24:12 -06:00
Dustin Carlino
1ad3dfd634 always draw crosswalks, draw walk / dont walk icons 2020-01-01 13:47:55 -06:00
Dustin Carlino
863e239c98 turning histogram into a proper ManagedWidget 2019-12-29 10:16:38 -06:00
Dustin Carlino
71553cbc70 make time jump textbox start with the current time, so the format is a bit more clear. addresses #24 2019-12-26 18:30:51 -06:00
Dustin Carlino
517a35775f adding pan buttons to minimap. they dont do anything yet, but the hard
part was positioning the minimap using all the new layouting
2019-12-25 12:01:51 -08:00
Dustin Carlino
ebd405e2ef make the scrollbar slider work! also, stop wasting github resources 2019-12-23 15:00:22 -08:00
Dustin Carlino
21b8f41a59 change API of Composite. we need to own all the sliders after all. prep
for including a scrollbar.
2019-12-23 14:33:43 -08:00
Dustin Carlino
3c0b88dfdf rewrite slider a bit. support vertical scrolling (untested). fix some
bugs in speed panel introduced a while ago. keep tuning github workflow.
2019-12-23 13:56:29 -08:00
Dustin Carlino
dafcc50479 for now, hack around layouting mess by hardcoding window width to make flex wrapping kind of work 2019-12-23 11:05:24 -08:00
Dustin Carlino
2a8c657770 only upload widget backgrounds once 2019-12-22 10:52:41 -08:00
Dustin Carlino
194dbae66f embed Scroller functionality in Composite directly. use for analytics panel 2019-12-22 10:26:48 -08:00
Dustin Carlino
2a67872d17 turning the old scoreboard into a separate dashboard. also fold in the
bus route explorer
2019-12-21 14:43:03 -08:00
Dustin Carlino
a5910ff99b add back a legend to the plots 2019-12-21 11:04:30 -08:00
Dustin Carlino
e7d9efc4e4 split the plot into 3 pieces, use layouting for the axes 2019-12-21 10:43:26 -08:00
Dustin Carlino
f1566b48c9 lift ManagedWidget and friends into ezgui. have a wrapper layer in game that adds callbacks. here's my herculean refactor of the week. :D 2019-12-20 15:56:04 -08:00
Dustin Carlino
c2e5678308 cut intersection delay and thruput plots over to being embedded in info panel composite. working on rendering issues. 2019-12-20 14:19:40 -08:00
Dustin Carlino
2a02e31bce making Plot be something that can be composited. just some of the glue
so far, nothing working yet.
2019-12-20 13:42:58 -08:00
Dustin Carlino
a67b1bf19a refactor Polygon::rectangle_top_left and a few more things... taking
Distance everywhere is kind of silly
2019-12-20 12:42:49 -08:00
Dustin Carlino
ae41408c70 compute Composite layout upfront. only recompute when window is resized. 2019-12-20 11:20:09 -08:00
Dustin Carlino
49a0f7abd6 yay, delete old gunky attempts at scrolling 2019-12-20 10:30:56 -08:00
Dustin Carlino
b229c44511 make the new signal diagram selectable. it's now basically usable! 2019-12-20 10:25:14 -08:00
Dustin Carlino
04bcf77e2b work on new traffic signal scrolling panel. generalized scrollable
Composite works!
2019-12-20 09:35:27 -08:00
Dustin Carlino
56285a7b30 add screen positioning to some Composites 2019-12-19 10:59:39 -08:00
Dustin Carlino
d5312fabd4 remove the show/hide feature from ModalMenus. ModalMenus are on the way out, the icon is often covering stuff up, and now we can delete some old pngs 2019-12-18 16:26:28 -08:00
Dustin Carlino
7ad40959ca adjust all of the UI panels... 2019-12-18 16:20:14 -08:00
Dustin Carlino
892e0592e1 adjust rendering of parked cars 2019-12-17 15:55:47 -08:00
Dustin Carlino
e893e6b98c add a flag to override DPI, so we can tune on mac 2019-12-16 19:09:02 -08:00
Dustin Carlino
eda40ecdec start an interactive legend for the minimap. pretty disjoint from real
AgentColorScheme right now
2019-12-16 15:40:32 -08:00
Dustin Carlino
ec01267dd0 let some buttons skip having callbacks and let the owner query them instead 2019-12-16 10:10:01 -08:00
Dustin Carlino
97c8a84efb switching out lane editing icons for yuwen's nice ones 2019-12-15 11:06:59 -08:00
Dustin Carlino
442a0509dd invert the default for text background. none by default, should be an exception to use it. planning to support background more generally through some kind of widget layouting. 2019-12-13 15:45:24 -08:00
Dustin Carlino
33bd713609 fix the weirdness with clicking in the info panel to choose actions. the
click event was getting immediately reused after exiting the panel,
causing the panel to reappear. problem was some widget stuff looking for
mouse-down events. instead they should look for mouse-up.
2019-12-13 11:47:02 -08:00
Dustin Carlino
1fc7a73882 add version number to release dirs and zips 2019-12-12 19:04:14 -08:00
Dustin Carlino
5440fca4fe move the functions from the last MenuUnderButton to the ModalMenus, just so I can get rid of the atrocity that is MenuUnderButton 2019-12-12 15:24:07 -08:00
Dustin Carlino
7d53f536d4 fix up speed controls a bit after yesterday's move. closes #23 2019-12-12 13:16:53 -08:00
Dustin Carlino
dc2cc81249 make Timer methods and ModalMenu take &str or String 2019-12-12 10:25:48 -08:00
Dustin Carlino
1542e237d9 limit precision on ScreenDims. should fix #18 2019-12-12 09:13:25 -08:00
Dustin Carlino
770507610c try to workaround the mac dpi issue for minimaps again. hardcoding didnt work. 2019-12-11 16:59:13 -08:00
Dustin Carlino
ee598b6ae4 round of clippy. not fixing everything. 2019-12-11 16:17:15 -08:00
Dustin Carlino
cb68536989 ripping out the old ezgui context menu gunk. woo! 2019-12-11 16:08:58 -08:00
Dustin Carlino
ec40780ee3 use the action list to populate a menu in InfoPanel. cant choose the actions yet there. 2019-12-11 15:25:43 -08:00
Dustin Carlino
14f4dc2e3c left click to open info panel. refiddling how drag events are detected.
kind of messy code, but the behavior is FINALLY right.
2019-12-11 13:52:01 -08:00
Dustin Carlino
f0af92f00e split out an agent meter with icons for the modes 2019-12-11 10:13:36 -08:00
Dustin Carlino
3187fc7ef8 replace MultiText with DrawBoth 2019-12-09 13:03:28 -08:00
Dustin Carlino
4e96363398 tuning color rewriting and placement of some svg icons. removing the
crazy shader color masking
2019-12-08 13:44:43 -08:00
Dustin Carlino
5a7314d137 Add color rewriting and stroke support for SVG images. Cut over more
images, discovering some break...
2019-12-08 12:46:56 -08:00
Dustin Carlino
77099a164b try using usvg and lyon to produce Polygon+Colors from svg files. so
far, so good. dodging a dependency on harfbuzz (which doesn't build in
my windows cross-compilation env), now trying on mac...
2019-12-08 10:24:01 -08:00
Dustin Carlino
e567d14fc2 silently add hotkeys to challenge picker screen for my own sanity 2019-12-07 13:29:34 -08:00
Dustin Carlino
631cc493c1 hack around mac dpi minimap issue 2019-12-06 10:29:24 -08:00
Dustin Carlino
f94a6ad667 when there are too many textures, print the current groupings 2019-12-05 18:23:19 -08:00
Dustin Carlino
ac4cfea3e3 skip hidden files (.gitignore started showing up, oops). also, stash
screenshots outside of the game/ dir, so we dont recompile when we
accidentally create these
2019-12-05 14:21:17 -08:00
Dustin Carlino
81a19eb78d remove the experimental hi-res grass and park textures and all the
flagged off textures. going to experiment in a different branch instead.
2019-12-05 09:37:05 -08:00
Dustin Carlino
c37eb1a5ed woops, i had broken hatching a while back, just now noticed 2019-12-03 15:19:44 -08:00
Dustin Carlino
6695f72847 organize abstutil paths internally a bit, inching towards organizing data/ dir 2019-12-03 11:15:17 -08:00
Dustin Carlino
a043a9ba05 clean up more of abstutil path/filesystem API 2019-12-03 09:59:43 -08:00