Commit Graph

353 Commits

Author SHA1 Message Date
Dustin Carlino
92ce83dfdd cant start dragging on top of covered area 2018-12-22 22:21:05 -08:00
Dustin Carlino
5d28acd1af traffic signal editor left bar should be drawn below top menu 2018-12-22 22:18:03 -08:00
Dustin Carlino
0edded5725 trying out a quick way to mark parts of the screen unavailable for map-space mouseover. oh hey, it works great. 2018-12-22 20:03:12 -08:00
Dustin Carlino
2d7034e9cb canvas wont serve up map-space cursor when it's out of the window 2018-12-22 17:12:30 -08:00
Dustin Carlino
0aece4944d prep for disabling mouseover by changing canvas API. fix neighborhood
plugin to handle out-of-bounds points while we're there.
2018-12-22 16:49:47 -08:00
Dustin Carlino
099fd288fe all arrows are rounded 2018-12-22 14:02:42 -08:00
Dustin Carlino
1d9f3320fa implementing draw_line and draw_rounded_line directly 2018-12-22 13:58:45 -08:00
Dustin Carlino
9b6725fc7d back to adjusting GUI colors 2018-12-22 13:12:10 -08:00
Dustin Carlino
9d32ef8b83 use const functions to construct constant colors in many cases, now that rust 2018 is here 2018-12-22 12:39:17 -08:00
Dustin Carlino
0f62da0f63 centralize and adjust constants for text colors. also clean up places
unnecessarilly passing in RGB values for constants
2018-12-22 12:26:34 -08:00
Dustin Carlino
dfc08bfe97 figure out longest line for text dims by actual rendered width 2018-12-22 12:04:17 -08:00
Dustin Carlino
44c3fab9f6 working on text alignment again 2018-12-22 11:54:49 -08:00
Dustin Carlino
2510625efc removing piston window size type from canvas, meaning piston deps are now very narrowly isolated to part of ezgui 2018-12-21 10:00:45 -08:00
Dustin Carlino
c7e7f6ae75 oops, dont allow unselecting a key-controlled menu 2018-12-19 11:52:58 -08:00
Dustin Carlino
ad497ac698 make menus handle window resizing 2018-12-19 11:48:35 -08:00
Dustin Carlino
b7f31cc8f4 make canvas know initial screen size, so centering on map pt initially does work 2018-12-18 15:37:44 -08:00
Dustin Carlino
78f3107d8a oh, piston has a helper for rendering a line of text. use it. 2018-12-18 15:02:51 -08:00
Dustin Carlino
a0160f6be0 render highlighted lines with full width when it makes sense 2018-12-18 12:42:29 -08:00
Dustin Carlino
0a18d2afd2 fix broken top menu hotkeys when a submenu is present 2018-12-18 11:50:23 -08:00
Dustin Carlino
d4592f64a0 clippy run 2018-12-18 09:59:50 -08:00
Dustin Carlino
7ebc51ee64 use arrow keys to switch cycles, not numbers. remove number_chosen. only allow arrow keys in wizard menus. 2018-12-17 20:40:32 -08:00
Dustin Carlino
54c1f1ba73 update modal menu prompt 2018-12-17 20:21:55 -08:00
Dustin Carlino
4a98e1d086 convert all plugins to modal calls 2018-12-17 16:40:03 -08:00
Dustin Carlino
e6595c0d14 destroy modal menu when done 2018-12-17 16:08:32 -08:00
Dustin Carlino
002095bc84 make menu item activeness be mutable 2018-12-17 16:01:42 -08:00
Dustin Carlino
72a39c9597 wire up modal actions 2018-12-17 14:54:36 -08:00
Dustin Carlino
c654bf2b06 revamp menu to work in screen-space, so canvas can move beneath modal menu. also fix the menu mouseover when a prompt is present. 2018-12-17 14:42:52 -08:00
Dustin Carlino
787c965985 explicit type for screen-space stuff in ezgui 2018-12-17 14:25:05 -08:00
Dustin Carlino
32db434862 trying out modal flow in UserInput... at least initially displaying the
sidebar
2018-12-17 13:58:06 -08:00
Dustin Carlino
bbacdfb676 declaring modal menus 2018-12-17 13:08:46 -08:00
Dustin Carlino
2194ea38a5 grey out irrelevant top menu items 2018-12-17 12:13:32 -08:00
Dustin Carlino
875edddc7a undo the few remaining places that pass in keys to plugins 2018-12-17 11:49:36 -08:00
Dustin Carlino
661c9715b3 handle idle event; happens when running sim 2018-12-17 11:36:14 -08:00
Dustin Carlino
b3dea902de handle window close event 2018-12-17 11:33:57 -08:00
Dustin Carlino
806a139788 dont panic on unknown keypresses 2018-12-17 11:30:20 -08:00
Dustin Carlino
a11fe98ca9 oh yeah, still let keys be pressed for top menu actions. :D 2018-12-17 10:27:35 -08:00
Dustin Carlino
21c61e4a60 avoid typos in action_chosen 2018-12-17 10:23:14 -08:00
Dustin Carlino
6f92a82efe glue TopMenu to UserInput... get ready to change lots of calls to it 2018-12-17 09:47:53 -08:00
Dustin Carlino
1f1f3b63e2 wiring up submenu events 2018-12-17 09:07:49 -08:00
Dustin Carlino
6595f804e0 spawn submenu in the proper place 2018-12-16 20:19:30 -08:00
Dustin Carlino
b571f410ef spawn submenus... but not in the right place. no input wiring yet. 2018-12-16 19:57:39 -08:00
Dustin Carlino
7c5ba61e89 touchscreen support. (not) 2018-12-16 19:49:00 -08:00
Dustin Carlino
8aa12fb6d9 highlight selected item in top menu 2018-12-16 19:41:11 -08:00
Dustin Carlino
a4a312d488 draw the top menu bar 2018-12-16 19:22:48 -08:00
Dustin Carlino
efc0db122a specify top menu in UI, but it doesn't do anything yet 2018-12-16 18:23:17 -08:00
Dustin Carlino
0b069a7083 display optional prompt in the menu 2018-12-16 16:58:04 -08:00
Dustin Carlino
435f3f35c9 start wizard menus with first item selected, like the good ol days 2018-12-16 16:51:15 -08:00
Dustin Carlino
24fbc18324 rewrite a fxn from wizard with NLL 2018-12-16 16:45:52 -08:00
Dustin Carlino
2a5384cf11 making wizard use the new Menu 2018-12-16 16:29:25 -08:00
Dustin Carlino
3a47cb04e9 expressing context menu as an FSM instead 2018-12-16 16:12:51 -08:00
Dustin Carlino
6993294f24 make ContextMenu use Menu now 2018-12-16 15:49:12 -08:00
Dustin Carlino
2b245f9277 write a proper Menu constructor, now that we can calculate geometry up-front 2018-12-16 15:23:49 -08:00
Dustin Carlino
62bdd92ac3 move ownership of GlyphCache into Canvas, so calculating text dimensions can be done during event. Stick the glyphs behind a RefCell to avoid mutability creeping into canvas everywhere 2018-12-16 15:16:02 -08:00
Dustin Carlino
671dad6b02 make a blend between ScrollingMenu and ContextMenu... don't use it yet 2018-12-16 14:47:48 -08:00
Dustin Carlino
11945739bd rename old ezgui menu to scrolling menu, which color picker will keep using for now 2018-12-16 14:18:43 -08:00
Dustin Carlino
4629015e12 delete unused TreeMenu and stop passing in the category for unimportant actions 2018-12-16 14:13:28 -08:00
Dustin Carlino
9adcb0315e making my own event, mapping piston's event to it. will simplify downstream code and make moving away from piston even easier. 2018-12-15 20:44:28 -08:00
Dustin Carlino
d9721caa8a left clicking to confirm or cancel a menu 2018-12-15 16:48:47 -08:00
Dustin Carlino
51d1cbba6e highlighting if a menu item is selected 2018-12-15 16:36:45 -08:00
Dustin Carlino
cf74050758 dont call event() for a render event 2018-12-15 12:24:06 -08:00
Dustin Carlino
b633d698d2 make sure nothing else happens while a context menu is present 2018-12-15 11:07:51 -08:00
Dustin Carlino
003881fe93 prototyping right-click context menus. solid start, lots of work needed. 2018-12-15 10:39:50 -08:00
Dustin Carlino
3f2a7d6e68 display when a traffic signal is in overtime 2018-12-14 12:01:00 -08:00
Dustin Carlino
2b16b9571e making it easier to create one-line Texts 2018-12-14 11:01:14 -08:00
Dustin Carlino
d61255a4b3 lift panic handling from UI's event to ezgui runner, use also for draw 2018-12-12 14:11:18 -08:00
Dustin Carlino
3c710c2e8a fix the sim score plugin 2018-12-12 10:47:02 -08:00
Dustin Carlino
44d9065123 wrap long agent tooltips 2018-12-09 15:28:04 -08:00
Dustin Carlino
f48757c5e7 clippy pt2 2018-12-08 19:56:54 -08:00
Dustin Carlino
ab86835611 initially playing with clippy... pt1 2018-12-08 18:21:56 -08:00
Dustin Carlino
91b2b07fbd remove more extern crate's; import macros directly 2018-12-06 11:22:12 -08:00
Dustin Carlino
375a923a9d try removing most extern crate's 2018-12-06 11:00:13 -08:00
Dustin Carlino
f64f411093 upgrade all crates to 2018 in Cargo.toml. this requires switching to
crate:: paths everywhere. not yet fiddling with 'extern crate's
2018-12-06 10:57:31 -08:00
Dustin Carlino
6a0cd7f71e rust 2018: run the new fmt, delete the unneeded script 2018-12-06 10:05:50 -08:00
Dustin Carlino
ac4c7a5b83 edit cycle time 2018-12-04 11:44:34 -08:00
Dustin Carlino
038cd385d7 show cycle duration in sidebar 2018-12-04 11:20:51 -08:00
Dustin Carlino
43fa67177d plumbing generic things in ezgui runner 2018-12-04 10:20:08 -08:00
Dustin Carlino
3155bcbaf1 drawing a box to show time left in current cycle 2018-12-04 08:33:24 -08:00
Dustin Carlino
ac1e12b43a draw ALL cycles in a sidebar, to summarize. needs tuning, but looks
initially good
2018-12-03 17:09:56 -08:00
Dustin Carlino
f36b967dee drawing yield turns better in turn cycler 2018-12-03 10:37:14 -08:00
Dustin Carlino
7705289a62 specialize tooltip_lines to one plugin. solves the problem of not being able to look up objects in DrawMap 2018-11-20 11:32:03 -08:00
Dustin Carlino
7937586e52 make it easy to prefill a textbox from wizard 2018-11-14 11:56:45 -08:00
Dustin Carlino
7b6f1c4624 refactoring a proper way to draw/use rectangles 2018-11-14 09:57:58 -08:00
Dustin Carlino
f1d82a4c97 make the warp plugin animate the panning 2018-11-12 11:02:51 -08:00
Dustin Carlino
03909cc04f make turn cycler able to draw all turns from a lane, even when the plugin isnt really 'active' 2018-11-05 17:52:35 -08:00
Dustin Carlino
a610575701 changing ezgui API to return Bounds, not Rect 2018-11-01 15:31:06 -07:00
Dustin Carlino
898e036c7e the great color scheme refactor! 2018-10-24 19:18:37 -07:00
Dustin Carlino
2026acde32 draw_text_at centers the text box 2018-10-23 13:56:04 -07:00
Dustin Carlino
bb21c45394 weighted choice for how many cars per building 2018-10-17 16:22:33 -07:00
Dustin Carlino
df927c5829 make sim ctrl plugin advance dual sims and print some OSD and side panel
stuff appropriately
2018-10-08 17:03:36 -07:00
Dustin Carlino
af2d49debb show a textbox when an empty menu is attempted 2018-10-08 12:25:17 -07:00
Dustin Carlino
fcfef89760 intermission: handling empty directory listings, menus 2018-10-08 09:45:21 -07:00
Dustin Carlino
7b3069a1a1 clean up ezgui draw() API and hide window size inside ezgui entirely 2018-10-06 11:52:08 -07:00
Dustin Carlino
0048f90734 removing use_event_directly 2018-10-06 11:15:37 -07:00
Dustin Carlino
94ac54d7e8 stop using Color and Vec2d types from piston, to slowly move away from dependence on piston 2018-10-05 14:58:48 -07:00
Dustin Carlino
7ee75ea6be renaming osd -> just text 2018-10-01 13:56:43 -07:00
Dustin Carlino
d9ff599332 refactoring text alignment 2018-09-28 07:59:05 -07:00
Dustin Carlino
8badd7a813 show optional sidepanel in UI with current sim score 2018-09-28 07:43:53 -07:00
Dustin Carlino
3d2255d728 move wizard to ezgui \o/ 2018-09-25 14:43:56 -07:00
Dustin Carlino
d134706db7 bigger FSM for managing scenarios... it initially seems to work? :P 2018-09-24 15:40:37 -07:00
Dustin Carlino
7836df4580 storing associated data with menu 2018-09-24 08:34:02 -07:00
Dustin Carlino
6c7d4185b3 proper logging from the editor layer 2018-09-22 20:12:24 -07:00
Dustin Carlino
f9e0b6facc adding a scrollable log buffer widget 2018-09-21 14:09:20 -07:00
Dustin Carlino
f6ddd8aeaa adding categories to unimportant actions, arranging them in a tree 2018-09-21 13:16:46 -07:00
Dustin Carlino
0a50fbd8bd scroll long menus 2018-09-21 09:55:56 -07:00
Dustin Carlino
13baaf6b6f styled text spans 2018-09-21 08:57:01 -07:00
Dustin Carlino
f1f0683026 prompts on top of menus, too 2018-09-21 08:08:34 -07:00
Dustin Carlino
b66e6891f6 textbox and menu take UserInput and consume it 2018-09-20 19:19:08 -07:00
Dustin Carlino
4a9306e1e2 use 3-way result for menus and text boxes, letting text boxes be
canceled properly
2018-09-20 19:13:23 -07:00
Dustin Carlino
d32556f470 only take TextOSD in canvas API 2018-09-20 19:00:14 -07:00
Dustin Carlino
1d7417e851 display text entry boxes in the middle of the screen, not as part of the bottom OSD 2018-09-20 18:55:44 -07:00
Dustin Carlino
726adb6249 basic menu support to gui wizard 2018-09-20 17:04:52 -07:00
Dustin Carlino
86c3a33526 input sim Ticks in gui wizard 2018-09-20 15:15:07 -07:00
Dustin Carlino
b365f595bd populate OSD during event. this lets wizard display prompts easily. 2018-09-20 14:57:42 -07:00
Dustin Carlino
c95f5e7a4d starting a stateful multi-question GUI wizard. just accepts usize's
right now
2018-09-20 14:29:50 -07:00
Dustin Carlino
4b26411794 show current selected polygon as preview 2018-09-19 18:44:17 -07:00
Dustin Carlino
c7f2c50e25 draw menus centered in the screen, with highlighted lines 2018-09-19 17:38:31 -07:00
Dustin Carlino
96994eb9bd load existing polygon with pre-filled name 2018-09-19 14:24:09 -07:00
Dustin Carlino
60d4e0af33 list existing polygons with menu 2018-09-19 12:28:29 -07:00
Dustin Carlino
ce91b77ad6 highlighting the cursor in text boxes 2018-09-18 18:52:25 -07:00
Dustin Carlino
8b0fb9248c using Pt2D in ezgui's API when appropriate 2018-09-18 15:09:17 -07:00
Dustin Carlino
1050d86e67 making a proper Circle type in geom 2018-09-18 14:00:55 -07:00
Dustin Carlino
e8ef4545fb remove to_vec from Pt2D; only need it in one triangulation-specific place 2018-09-18 13:44:14 -07:00
Dustin Carlino
49ebe97c21 small refactor in ezgui and polyline 2018-09-18 13:39:55 -07:00
Dustin Carlino
7dc192b0c9 refactoring helpers to draw lines 2018-09-18 13:29:30 -07:00
Dustin Carlino
e65f3aecc7 update to rust 1.29, re-run format 2018-09-15 16:54:00 -07:00
Dustin Carlino
8db279ff7c refactoring toggleable layers 2018-09-13 10:49:56 -07:00
Dustin Carlino
986717dc76 dont expose ezgui's modules 2018-09-10 17:32:33 -07:00
Dustin Carlino
64d4117c0c moving GUI runner to ezgui 2018-09-09 18:50:36 -07:00
Dustin Carlino
7eb279a978 simplify toggleable layer; dont need to repeat key names 2018-08-14 14:06:32 -07:00
Dustin Carlino
40cb2bf6f4 making draw_polygon only accept a geom Polygon. guess ezgui depending on geom is fine. 2018-08-09 10:57:19 -07:00
Dustin Carlino
5d2a4f3ac4 trying an ear clipping algorithm for buildings and parcels. works great,
lots of cleanup needed now!
2018-08-08 14:39:08 -07:00
Dustin Carlino
b1c74157d9 scale the zoom speed based on how far already zoomed in 2018-08-05 15:22:55 -07:00
Dustin Carlino
1348db1288 different colors for cars and peds 2018-08-01 15:06:23 -07:00
Dustin Carlino
3fa06fd032 dont repeat keypress manually in OSD message 2018-07-26 14:28:01 -07:00
Dustin Carlino
120e7c5db1 plumb through UI controls for road edits 2018-07-24 15:43:01 -07:00
Dustin Carlino
2ebc13140b round of rustfmt after 1.27 upgrade 2018-07-09 12:30:59 -07:00
Dustin Carlino
18132e3c8b consistently having one(ish) plugin do stuff at a time 2018-07-06 12:25:43 -07:00
Dustin Carlino
e2aabeb0e9 refactoring drawing primitives into GfxCtx 2018-07-06 11:04:18 -07:00
Dustin Carlino
8f244438c1 plumbing window_size with canvas 2018-07-06 10:26:35 -07:00
Dustin Carlino
43536743a8 warp plugin, and making text entry handle numbers 2018-06-26 09:05:14 -07:00
Dustin Carlino
6afb71ea5f preps for line trimming 2018-06-25 11:54:15 -07:00
Dustin Carlino
9b1ce9b3b3 split canvas scrolling and text 2018-06-22 14:47:07 -07:00
Dustin Carlino
0d46b413bb move gfxctx 2018-06-22 14:42:13 -07:00
Dustin Carlino
348f9a0a0f very hacky menu to pick what color to change 2018-06-21 13:45:09 -07:00
Dustin Carlino
6b8a5a0103 moving more colors to scheme 2018-06-21 11:18:17 -07:00
Dustin Carlino
e7e334a460 using color scheme in most places 2018-06-21 10:32:07 -07:00
Dustin Carlino
03df50c96e fill in parcel interior with color 2018-06-19 14:24:30 -07:00
Dustin Carlino
923883883b updating README and trimming license declarations 2018-06-03 17:56:53 -07:00
Dustin Carlino
0e672f9e09 remove svg rendering. output is too large, never used. 2018-05-16 18:58:30 -07:00
Dustin Carlino
b8842d5852 detect and fix when two parts of the UI try to read the same key 2018-05-14 19:00:26 -07:00
Dustin Carlino
f2b7344940 using new rust 1.26 match stuff, and fmt 2018-05-10 16:19:26 -07:00
Dustin Carlino
065c2ce9ba Importing everything since the initial import 2018-04-10 17:51:37 -07:00
Dustin Carlino
1863289f6d Initial import of A/B Street prototype. 2018-03-13 08:06:03 -07:00