mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 07:25:47 +03:00
Collapse some of the module indirections in the game crate.
This commit is contained in:
parent
f3ff910c37
commit
db736ceab5
@ -20,6 +20,9 @@ use crate::helpers::ID;
|
||||
use crate::layer::Layer;
|
||||
use crate::sandbox::{GameplayMode, TutorialState};
|
||||
|
||||
// Convenient typedef
|
||||
pub type Transition = widgetry::Transition<App>;
|
||||
|
||||
/// The top-level data that lasts through the entire game, no matter what state the game is in.
|
||||
pub struct App {
|
||||
// Naming is from older days when there was an A/B test, "side-by-side" mode. Keeping this
|
||||
|
@ -10,7 +10,7 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::game::Transition;
|
||||
use crate::app::Transition;
|
||||
use crate::sandbox::gameplay::Tutorial;
|
||||
use crate::sandbox::{GameplayMode, SandboxMode, TutorialState};
|
||||
|
||||
|
@ -7,8 +7,8 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::Warping;
|
||||
use crate::game::Transition;
|
||||
use crate::layer::PickLayer;
|
||||
|
||||
// TODO Some of the math in here might assume map bound minimums start at (0, 0).
|
||||
|
@ -10,7 +10,7 @@ use widgetry::{
|
||||
pub use self::minimap::Minimap;
|
||||
pub use self::warp::Warping;
|
||||
use crate::app::App;
|
||||
use crate::game::Transition;
|
||||
use crate::app::Transition;
|
||||
use crate::helpers::{list_names, ID};
|
||||
use crate::info::InfoPanel;
|
||||
pub use crate::info::{ContextualActions, Tab};
|
||||
|
@ -1,15 +1,15 @@
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use geom::Pt2D;
|
||||
use map_gui::tools::PopupMsg;
|
||||
use map_model::{AreaID, BuildingID, BusRouteID, IntersectionID, LaneID, ParkingLotID, RoadID};
|
||||
use sim::{PedestrianID, PersonID, TripID};
|
||||
use widgetry::{
|
||||
Btn, EventCtx, GfxCtx, Key, Line, Outcome, Panel, State, Text, TextExt, Warper, Widget,
|
||||
};
|
||||
|
||||
use crate::app::{App, PerMap};
|
||||
use crate::app::{App, PerMap, Transition};
|
||||
use crate::common::Tab;
|
||||
use crate::game::{PopupMsg, Transition};
|
||||
use crate::helpers::{grey_out_map, ID};
|
||||
use crate::info::OpenTrip;
|
||||
use crate::sandbox::SandboxMode;
|
||||
|
@ -4,7 +4,7 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::game::Transition;
|
||||
use crate::app::Transition;
|
||||
use crate::helpers::grey_out_map;
|
||||
|
||||
pub struct CutsceneBuilder {
|
||||
|
@ -8,8 +8,8 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::CommonState;
|
||||
use crate::game::Transition;
|
||||
|
||||
/// Visualize the graph of what agents are blocked by others.
|
||||
pub struct Viewer {
|
||||
|
@ -7,8 +7,8 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::ColorDiscrete;
|
||||
use crate::game::Transition;
|
||||
|
||||
pub struct Floodfiller {
|
||||
panel: Panel,
|
||||
|
@ -5,6 +5,7 @@ use geom::{Distance, Pt2D};
|
||||
use map_gui::load::MapLoader;
|
||||
use map_gui::options::OptionsPanel;
|
||||
use map_gui::render::{calculate_corners, DrawOptions};
|
||||
use map_gui::tools::{ChooseSomething, PopupMsg, PromptInput};
|
||||
use map_model::{osm, ControlTrafficSignal, NORMAL_LANE_THICKNESS};
|
||||
use sim::{AgentID, Sim};
|
||||
use widgetry::{
|
||||
@ -13,9 +14,8 @@ use widgetry::{
|
||||
Widget,
|
||||
};
|
||||
|
||||
use crate::app::{App, ShowLayers, ShowObject};
|
||||
use crate::app::{App, ShowLayers, ShowObject, Transition};
|
||||
use crate::common::{tool_panel, CommonState, ContextualActions};
|
||||
use crate::game::{ChooseSomething, PopupMsg, PromptInput, Transition};
|
||||
use crate::helpers::ID;
|
||||
use crate::sandbox::GameplayMode;
|
||||
|
||||
|
@ -6,8 +6,8 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::{ColorLegend, ColorNetwork, CommonState};
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::ID;
|
||||
|
||||
/// A state to count the number of trips that will cross different roads.
|
||||
|
@ -1,11 +1,11 @@
|
||||
use geom::{Polygon, Pt2D, Triangle};
|
||||
use map_gui::tools::PopupMsg;
|
||||
use widgetry::{
|
||||
Btn, EventCtx, GeomBatch, GfxCtx, HorizontalAlignment, Key, Line, Outcome, Panel, State, Text,
|
||||
TextExt, VerticalAlignment, Widget,
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::game::{PopupMsg, Transition};
|
||||
use crate::app::{App, Transition};
|
||||
|
||||
pub struct PolygonDebugger {
|
||||
panel: Panel,
|
||||
|
@ -7,8 +7,8 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::ColorNetwork;
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::ID;
|
||||
|
||||
pub struct CollisionsViewer {
|
||||
|
@ -8,7 +8,7 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::game::Transition;
|
||||
use crate::app::Transition;
|
||||
use crate::helpers::{amenity_type, ID};
|
||||
|
||||
pub struct PopularDestinations {
|
||||
|
@ -8,14 +8,14 @@ use abstutil::{prettyprint_usize, Parallelism, Timer};
|
||||
use geom::{Circle, Distance, PolyLine, Polygon, Pt2D, Ring};
|
||||
use kml::{ExtraShape, ExtraShapes};
|
||||
use map_gui::colors::ColorScheme;
|
||||
use map_gui::tools::{ChooseSomething, PopupMsg};
|
||||
use map_model::BuildingID;
|
||||
use widgetry::{
|
||||
lctrl, Btn, Choice, Color, Drawable, EventCtx, GeomBatch, GfxCtx, HorizontalAlignment, Key,
|
||||
Line, Outcome, Panel, State, Text, TextExt, VerticalAlignment, Widget,
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::game::{ChooseSomething, PopupMsg, Transition};
|
||||
use crate::app::{App, Transition};
|
||||
|
||||
pub struct ViewKML {
|
||||
panel: Panel,
|
||||
|
@ -3,14 +3,13 @@
|
||||
|
||||
use abstutil::Timer;
|
||||
use geom::{LonLat, Percent};
|
||||
use map_gui::tools::CityPicker;
|
||||
use map_gui::tools::{ChooseSomething, CityPicker};
|
||||
use widgetry::{
|
||||
lctrl, Btn, Choice, DrawBaselayer, EventCtx, GfxCtx, HorizontalAlignment, Key, Line, Outcome,
|
||||
Panel, State, TextExt, VerticalAlignment, Widget,
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::game::{ChooseSomething, Transition};
|
||||
use crate::app::{App, Transition};
|
||||
use crate::helpers::nice_map_name;
|
||||
|
||||
mod collisions;
|
||||
|
@ -5,8 +5,8 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::CommonState;
|
||||
use crate::game::Transition;
|
||||
|
||||
const POINT_RADIUS: Distance = Distance::const_meters(10.0);
|
||||
// Localized and internal, so don't put in ColorScheme.
|
||||
|
@ -6,9 +6,9 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::{ColorDiscrete, CommonState};
|
||||
use crate::devtools::destinations::PopularDestinations;
|
||||
use crate::game::Transition;
|
||||
|
||||
pub struct ScenarioManager {
|
||||
panel: Panel,
|
||||
|
@ -2,15 +2,15 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use geom::{Distance, LonLat, PolyLine, Polygon, Pt2D, Ring};
|
||||
use map_gui::render::DrawOptions;
|
||||
use map_gui::tools::{ChooseSomething, PromptInput};
|
||||
use widgetry::{
|
||||
lctrl, Btn, Choice, Color, DrawBaselayer, Drawable, EventCtx, GeomBatch, GfxCtx,
|
||||
HorizontalAlignment, Key, Line, Outcome, Panel, RewriteColor, State, Text, VerticalAlignment,
|
||||
Widget,
|
||||
};
|
||||
|
||||
use crate::app::{App, ShowEverything};
|
||||
use crate::app::{App, ShowEverything, Transition};
|
||||
use crate::common::CommonState;
|
||||
use crate::game::{ChooseSomething, PromptInput, Transition};
|
||||
|
||||
// TODO This is a really great example of things that widgetry ought to make easier. Maybe a radio
|
||||
// button-ish thing to start?
|
||||
|
@ -1,16 +1,16 @@
|
||||
use maplit::btreeset;
|
||||
|
||||
use geom::Speed;
|
||||
use map_gui::tools::PopupMsg;
|
||||
use map_model::{LaneType, RoadID};
|
||||
use widgetry::{
|
||||
hotkeys, Btn, Choice, Color, Drawable, EventCtx, GfxCtx, HorizontalAlignment, Key, Line,
|
||||
Outcome, Panel, State, Text, TextExt, VerticalAlignment, Widget,
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::{App, Transition};
|
||||
use crate::edit::select::RoadSelector;
|
||||
use crate::edit::{apply_map_edits, speed_limit_choices, try_change_lt, ConfirmDiscard};
|
||||
use crate::game::{PopupMsg, Transition};
|
||||
|
||||
pub struct BulkSelect {
|
||||
panel: Panel,
|
||||
|
@ -8,8 +8,8 @@ use widgetry::{
|
||||
State, VerticalAlignment, Widget,
|
||||
};
|
||||
|
||||
use crate::app::Transition;
|
||||
use crate::app::{App, ShowEverything};
|
||||
use crate::game::Transition;
|
||||
|
||||
pub struct ClusterTrafficSignalEditor {
|
||||
panel: Panel,
|
||||
|
@ -6,12 +6,12 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::CommonState;
|
||||
use crate::edit::zones::ZoneEditor;
|
||||
use crate::edit::{
|
||||
apply_map_edits, can_edit_lane, maybe_edit_intersection, speed_limit_choices, try_change_lt,
|
||||
};
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::ID;
|
||||
use crate::sandbox::GameplayMode;
|
||||
|
||||
|
@ -6,6 +6,7 @@ use abstutil::{prettyprint_usize, Timer};
|
||||
use geom::Speed;
|
||||
use map_gui::options::OptionsPanel;
|
||||
use map_gui::render::DrawMap;
|
||||
use map_gui::tools::{ChooseSomething, PopupMsg};
|
||||
use map_model::{EditCmd, IntersectionID, LaneID, LaneType, MapEdits};
|
||||
use widgetry::{
|
||||
lctrl, Btn, Choice, Color, Drawable, EventCtx, GfxCtx, HorizontalAlignment, Key, Line, Menu,
|
||||
@ -18,10 +19,9 @@ pub use self::routes::RouteEditor;
|
||||
pub use self::stop_signs::StopSignEditor;
|
||||
pub use self::traffic_signals::TrafficSignalEditor;
|
||||
pub use self::validate::{check_blackholes, check_sidewalk_connectivity, try_change_lt};
|
||||
use crate::app::App;
|
||||
use crate::app::{App, Transition};
|
||||
use crate::common::{tool_panel, ColorLegend, CommonState, Warping};
|
||||
use crate::debug::DebugMode;
|
||||
use crate::game::{ChooseSomething, PopupMsg, Transition};
|
||||
use crate::helpers::{grey_out_map, ID};
|
||||
use crate::sandbox::{GameplayMode, SandboxMode, TimeWarpScreen};
|
||||
|
||||
|
@ -6,8 +6,8 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::edit::apply_map_edits;
|
||||
use crate::game::Transition;
|
||||
|
||||
pub struct RouteEditor {
|
||||
panel: Panel,
|
||||
|
@ -14,9 +14,9 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::CommonState;
|
||||
use crate::edit::{apply_map_edits, check_sidewalk_connectivity, TrafficSignalEditor};
|
||||
use crate::game::Transition;
|
||||
use crate::sandbox::GameplayMode;
|
||||
|
||||
// TODO For now, individual turns can't be manipulated. Banning turns could be useful, but I'm not
|
||||
|
@ -1,5 +1,6 @@
|
||||
use abstutil::Timer;
|
||||
use geom::Duration;
|
||||
use map_gui::tools::ChooseSomething;
|
||||
use map_model::{
|
||||
ControlStopSign, ControlTrafficSignal, EditCmd, EditIntersection, IntersectionID, PhaseType,
|
||||
};
|
||||
@ -8,10 +9,9 @@ use widgetry::{
|
||||
State, TextExt, Widget,
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::{App, Transition};
|
||||
use crate::edit::traffic_signals::{BundleEdits, TrafficSignalEditor};
|
||||
use crate::edit::{apply_map_edits, check_sidewalk_connectivity, StopSignEditor};
|
||||
use crate::game::{ChooseSomething, Transition};
|
||||
use crate::sandbox::GameplayMode;
|
||||
|
||||
pub struct ChangeDuration {
|
||||
|
@ -4,6 +4,7 @@ use abstutil::Timer;
|
||||
use geom::{Distance, Duration, Line, Polygon, Pt2D};
|
||||
use map_gui::options::TrafficSignalStyle;
|
||||
use map_gui::render::{traffic_signal, DrawMovement, DrawOptions};
|
||||
use map_gui::tools::PopupMsg;
|
||||
use map_model::{
|
||||
ControlTrafficSignal, EditCmd, EditIntersection, IntersectionID, MovementID, PhaseType, Stage,
|
||||
TurnPriority,
|
||||
@ -14,10 +15,9 @@ use widgetry::{
|
||||
Widget,
|
||||
};
|
||||
|
||||
use crate::app::{App, ShowEverything};
|
||||
use crate::app::{App, ShowEverything, Transition};
|
||||
use crate::common::{CommonState, Warping};
|
||||
use crate::edit::{apply_map_edits, ConfirmDiscard};
|
||||
use crate::game::{PopupMsg, Transition};
|
||||
use crate::sandbox::GameplayMode;
|
||||
|
||||
mod edits;
|
||||
|
@ -11,9 +11,9 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::CommonState;
|
||||
use crate::edit::traffic_signals::fade_irrelevant;
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::ID;
|
||||
|
||||
pub struct ShowAbsolute {
|
||||
|
@ -7,9 +7,9 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::CommonState;
|
||||
use crate::edit::TrafficSignalEditor;
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::ID;
|
||||
use crate::sandbox::gameplay::GameplayMode;
|
||||
|
||||
|
@ -2,14 +2,14 @@ use std::collections::BTreeSet;
|
||||
|
||||
use abstutil::Timer;
|
||||
use geom::Duration;
|
||||
use map_gui::tools::ChooseSomething;
|
||||
use map_model::IntersectionID;
|
||||
use widgetry::{
|
||||
Btn, Choice, EventCtx, GfxCtx, HorizontalAlignment, Key, Outcome, Panel, State, TextExt,
|
||||
UpdateType, VerticalAlignment, Widget,
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::game::{ChooseSomething, Transition};
|
||||
use crate::app::{App, Transition};
|
||||
use crate::sandbox::{spawn_agents_around, SpeedControls, TimePanel};
|
||||
|
||||
// TODO Show diagram, auto-sync the stage.
|
||||
|
@ -1,12 +1,12 @@
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
use abstutil::Timer;
|
||||
use map_gui::tools::PopupMsg;
|
||||
use map_model::{connectivity, EditCmd, LaneID, LaneType, Map, PathConstraints};
|
||||
use widgetry::{Color, EventCtx, State};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::common::ColorDiscrete;
|
||||
use crate::game::PopupMsg;
|
||||
|
||||
// All of these take a candidate EditCmd to do, then see if it's valid. If they return None, it's
|
||||
// fine. They always leave the map in the original state without the new EditCmd.
|
||||
|
@ -11,11 +11,11 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::ColorDiscrete;
|
||||
use crate::common::CommonState;
|
||||
use crate::edit::apply_map_edits;
|
||||
use crate::edit::select::RoadSelector;
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::{checkbox_per_mode, intersections_from_roads};
|
||||
|
||||
pub struct ZoneEditor {
|
||||
|
@ -1,5 +0,0 @@
|
||||
// TODO Remove this module entirely
|
||||
|
||||
pub use map_gui::tools::{ChooseSomething, PopupMsg, PromptInput};
|
||||
|
||||
pub type Transition = widgetry::Transition<crate::app::App>;
|
@ -14,10 +14,10 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::Warping;
|
||||
use crate::debug::path_counter::PathCounter;
|
||||
use crate::edit::{EditMode, RouteEditor};
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::{color_for_agent_type, hotkey_btn, open_browser, ID};
|
||||
use crate::sandbox::{dashboards, GameplayMode, SandboxMode, TimeWarpScreen};
|
||||
|
||||
|
@ -4,7 +4,7 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::game::Transition;
|
||||
use crate::app::Transition;
|
||||
use crate::helpers::{grey_out_map, hotkey_btn};
|
||||
use crate::sandbox::dashboards;
|
||||
|
||||
|
@ -17,7 +17,6 @@ mod cutscene;
|
||||
mod debug;
|
||||
mod devtools;
|
||||
mod edit;
|
||||
mod game;
|
||||
mod helpers;
|
||||
mod info;
|
||||
mod layer;
|
||||
|
@ -7,6 +7,7 @@ use rand_xorshift::XorShiftRng;
|
||||
use abstutil::Timer;
|
||||
use geom::{Duration, Line, Percent, Pt2D, Speed};
|
||||
use map_gui::load::MapLoader;
|
||||
use map_gui::tools::PopupMsg;
|
||||
use map_model::PermanentMapEdits;
|
||||
use sim::{AlertHandler, ScenarioGenerator, Sim, SimOptions};
|
||||
use widgetry::{
|
||||
@ -14,11 +15,10 @@ use widgetry::{
|
||||
State, Text, UpdateType, Widget,
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::{App, Transition};
|
||||
use crate::challenges::ChallengesPicker;
|
||||
use crate::devtools::DevToolsMode;
|
||||
use crate::edit::apply_map_edits;
|
||||
use crate::game::{PopupMsg, Transition};
|
||||
use crate::helpers::open_browser;
|
||||
use crate::sandbox::gameplay::Tutorial;
|
||||
use crate::sandbox::{GameplayMode, SandboxMode};
|
||||
|
@ -12,8 +12,8 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::{ColorLegend, CommonState};
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::checkbox_per_mode;
|
||||
|
||||
pub struct CommuterPatterns {
|
||||
|
@ -6,7 +6,7 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::game::Transition;
|
||||
use crate::app::Transition;
|
||||
use crate::helpers::color_for_trip_phase;
|
||||
use crate::info::{OpenTrip, Tab};
|
||||
use crate::sandbox::dashboards::table::Table;
|
||||
|
@ -7,8 +7,8 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::Tab;
|
||||
use crate::game::Transition;
|
||||
use crate::sandbox::dashboards::DashTab;
|
||||
use crate::sandbox::SandboxMode;
|
||||
|
||||
|
@ -5,7 +5,7 @@ pub use trip_table::FinishedTripTable;
|
||||
use widgetry::{Btn, Choice, EventCtx, Line, Panel, TextExt, Widget};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::game::Transition;
|
||||
use crate::app::Transition;
|
||||
|
||||
mod commuter;
|
||||
mod generic_trip_table;
|
||||
|
@ -4,14 +4,14 @@ use std::io::Write;
|
||||
|
||||
use abstutil::prettyprint_usize;
|
||||
use geom::{Distance, Duration, Polygon, Pt2D};
|
||||
use map_gui::tools::PopupMsg;
|
||||
use sim::TripMode;
|
||||
use widgetry::{
|
||||
Btn, Checkbox, Choice, Color, CompareTimes, DrawBaselayer, DrawWithTooltips, EventCtx,
|
||||
GeomBatch, GfxCtx, Line, Outcome, Panel, State, Text, TextExt, Widget,
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::game::{PopupMsg, Transition};
|
||||
use crate::app::{App, Transition};
|
||||
use crate::helpers::color_for_mode;
|
||||
use crate::sandbox::dashboards::DashTab;
|
||||
|
||||
|
@ -10,9 +10,9 @@ use widgetry::{
|
||||
Line, Outcome, Panel, Spinner, State, Text, TextExt, VerticalAlignment, Widget,
|
||||
};
|
||||
|
||||
use crate::app::Transition;
|
||||
use crate::app::{App, ShowEverything};
|
||||
use crate::common::CommonState;
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::ID;
|
||||
|
||||
pub struct TrafficSignalDemand {
|
||||
|
@ -8,11 +8,11 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::challenges::{Challenge, HighScore};
|
||||
use crate::common::Tab;
|
||||
use crate::cutscene::{CutsceneBuilder, FYI};
|
||||
use crate::edit::EditMode;
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::cmp_duration_shorter;
|
||||
use crate::sandbox::gameplay::{challenge_header, FinalScore, GameplayMode, GameplayState};
|
||||
use crate::sandbox::{Actions, SandboxControls};
|
||||
|
@ -5,12 +5,12 @@ use widgetry::{
|
||||
State, Text, VerticalAlignment, Widget,
|
||||
};
|
||||
|
||||
use crate::app::Transition;
|
||||
use crate::app::{App, FindDelayedIntersections};
|
||||
use crate::challenges::HighScore;
|
||||
use crate::common::Warping;
|
||||
use crate::cutscene::{CutsceneBuilder, FYI};
|
||||
use crate::edit::EditMode;
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::ID;
|
||||
use crate::sandbox::gameplay::{challenge_header, FinalScore, GameplayMode, GameplayState};
|
||||
use crate::sandbox::{Actions, SandboxControls, SandboxMode};
|
||||
|
@ -3,7 +3,7 @@ use rand::Rng;
|
||||
|
||||
use abstutil::Timer;
|
||||
use geom::{Distance, Polygon};
|
||||
use map_gui::tools::CityPicker;
|
||||
use map_gui::tools::{ChooseSomething, CityPicker, PopupMsg, PromptInput};
|
||||
use map_model::{BuildingID, IntersectionID, Position, NORMAL_LANE_THICKNESS};
|
||||
use sim::{IndividTrip, PersonSpec, Scenario, TripEndpoint, TripMode, TripPurpose};
|
||||
use widgetry::{
|
||||
@ -11,10 +11,9 @@ use widgetry::{
|
||||
ScreenRectangle, Spinner, State, Text, TextExt, VerticalAlignment, Widget,
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::{App, Transition};
|
||||
use crate::common::CommonState;
|
||||
use crate::edit::EditMode;
|
||||
use crate::game::{ChooseSomething, PopupMsg, PromptInput, Transition};
|
||||
use crate::helpers::{nice_map_name, ID};
|
||||
use crate::sandbox::gameplay::{GameplayMode, GameplayState};
|
||||
use crate::sandbox::{Actions, SandboxControls, SandboxMode};
|
||||
|
@ -12,9 +12,9 @@ use widgetry::{
|
||||
pub use self::freeform::spawn_agents_around;
|
||||
pub use self::tutorial::{Tutorial, TutorialPointer, TutorialState};
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::challenges::{Challenge, ChallengesPicker};
|
||||
use crate::edit::SaveEdits;
|
||||
use crate::game::Transition;
|
||||
use crate::pregame::MainMenu;
|
||||
use crate::sandbox::{Actions, SandboxControls, SandboxMode};
|
||||
|
||||
|
@ -2,16 +2,15 @@ use std::collections::BTreeSet;
|
||||
|
||||
use maplit::btreeset;
|
||||
|
||||
use map_gui::tools::CityPicker;
|
||||
use map_gui::tools::{ChooseSomething, CityPicker, PopupMsg};
|
||||
use sim::{ScenarioModifier, TripMode};
|
||||
use widgetry::{
|
||||
lctrl, Btn, Choice, Color, EventCtx, GfxCtx, HorizontalAlignment, Key, Line, Outcome, Panel,
|
||||
Slider, Spinner, State, Text, TextExt, VerticalAlignment, Widget,
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::{App, Transition};
|
||||
use crate::edit::EditMode;
|
||||
use crate::game::{ChooseSomething, PopupMsg, Transition};
|
||||
use crate::helpers::{checkbox_per_mode, grey_out_map, nice_map_name};
|
||||
use crate::sandbox::gameplay::freeform::make_change_traffic;
|
||||
use crate::sandbox::gameplay::{GameplayMode, GameplayState};
|
||||
|
@ -2,6 +2,7 @@ use std::collections::BTreeSet;
|
||||
|
||||
use abstutil::Timer;
|
||||
use geom::{ArrowCap, Distance, Duration, PolyLine, Pt2D, Time};
|
||||
use map_gui::tools::PopupMsg;
|
||||
use map_model::raw::OriginalRoad;
|
||||
use map_model::{osm, BuildingID, Map, Position};
|
||||
use sim::{
|
||||
@ -13,11 +14,10 @@ use widgetry::{
|
||||
RewriteColor, ScreenPt, State, Text, TextExt, VerticalAlignment, Widget,
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::{App, Transition};
|
||||
use crate::common::{tool_panel, Minimap, Warping};
|
||||
use crate::cutscene::CutsceneBuilder;
|
||||
use crate::edit::EditMode;
|
||||
use crate::game::{PopupMsg, Transition};
|
||||
use crate::helpers::{grey_out_map, ID};
|
||||
use crate::sandbox::gameplay::{GameplayMode, GameplayState};
|
||||
use crate::sandbox::{
|
||||
|
@ -9,8 +9,8 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::Transition;
|
||||
use crate::common::CommonState;
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::ID;
|
||||
|
||||
/// Draws a preview of the path for the agent under the mouse cursor.
|
||||
|
@ -6,7 +6,7 @@ pub use time_warp::TimeWarpScreen;
|
||||
use abstutil::prettyprint_usize;
|
||||
use geom::{Circle, Distance, Pt2D, Time};
|
||||
use map_gui::load::{FileLoader, MapLoader};
|
||||
use map_gui::tools::TurnExplorer;
|
||||
use map_gui::tools::{ChooseSomething, PopupMsg, TurnExplorer};
|
||||
use map_gui::AppLike;
|
||||
use sim::{Analytics, Scenario};
|
||||
use widgetry::{
|
||||
@ -15,13 +15,12 @@ use widgetry::{
|
||||
};
|
||||
|
||||
use self::misc_tools::{RoutePreview, TrafficRecorder};
|
||||
use crate::app::App;
|
||||
use crate::app::{App, Transition};
|
||||
use crate::common::{tool_panel, CommonState, ContextualActions, Minimap};
|
||||
use crate::debug::DebugMode;
|
||||
use crate::edit::{
|
||||
can_edit_lane, EditMode, LaneEditor, SaveEdits, StopSignEditor, TrafficSignalEditor,
|
||||
};
|
||||
use crate::game::{ChooseSomething, PopupMsg, Transition};
|
||||
use crate::helpers::ID;
|
||||
use crate::layer::PickLayer;
|
||||
use crate::pregame::MainMenu;
|
||||
|
@ -1,13 +1,13 @@
|
||||
use geom::{Duration, Polygon, Time};
|
||||
use map_gui::tools::PopupMsg;
|
||||
use sim::AlertLocation;
|
||||
use widgetry::{
|
||||
Btn, Choice, Color, EventCtx, GeomBatch, GfxCtx, HorizontalAlignment, Key, Line, Outcome,
|
||||
Panel, PersistentSplit, RewriteColor, Text, VerticalAlignment, Widget,
|
||||
};
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::{App, Transition};
|
||||
use crate::common::Warping;
|
||||
use crate::game::{PopupMsg, Transition};
|
||||
use crate::helpers::ID;
|
||||
use crate::sandbox::time_warp::JumpToTime;
|
||||
use crate::sandbox::{GameplayMode, SandboxMode, TimeWarpScreen};
|
||||
|
@ -3,14 +3,14 @@ use instant::Instant;
|
||||
use abstutil::prettyprint_usize;
|
||||
use geom::{Duration, Polygon, Pt2D, Ring, Time};
|
||||
use map_gui::render::DrawOptions;
|
||||
use map_gui::tools::PopupMsg;
|
||||
use widgetry::{
|
||||
Btn, Checkbox, Choice, Color, DrawBaselayer, EventCtx, GeomBatch, GfxCtx, Key, Line, Outcome,
|
||||
Panel, Slider, State, Text, UpdateType, Widget,
|
||||
};
|
||||
|
||||
use crate::app::{App, FindDelayedIntersections, ShowEverything};
|
||||
use crate::app::{App, FindDelayedIntersections, ShowEverything, Transition};
|
||||
use crate::common::Warping;
|
||||
use crate::game::{PopupMsg, Transition};
|
||||
use crate::helpers::{grey_out_map, ID};
|
||||
use crate::sandbox::{GameplayMode, SandboxMode};
|
||||
|
||||
|
@ -2,6 +2,7 @@ use std::collections::BTreeSet;
|
||||
|
||||
use geom::ArrowCap;
|
||||
use map_gui::render::{DrawOptions, BIG_ARROW_THICKNESS};
|
||||
use map_gui::tools::PopupMsg;
|
||||
use map_model::{IntersectionCluster, IntersectionID, PathConstraints};
|
||||
use widgetry::{
|
||||
Btn, Checkbox, Color, DrawBaselayer, Drawable, EventCtx, GeomBatch, GfxCtx,
|
||||
@ -9,10 +10,9 @@ use widgetry::{
|
||||
Widget,
|
||||
};
|
||||
|
||||
use crate::app::{App, ShowEverything};
|
||||
use crate::app::{App, ShowEverything, Transition};
|
||||
use crate::common::CommonState;
|
||||
use crate::edit::ClusterTrafficSignalEditor;
|
||||
use crate::game::{PopupMsg, Transition};
|
||||
use crate::helpers::ID;
|
||||
|
||||
pub struct UberTurnPicker {
|
||||
|
Loading…
Reference in New Issue
Block a user