diff --git a/abstutil/src/lib.rs b/abstutil/src/lib.rs index 183ecbeedb..8b0963a9eb 100644 --- a/abstutil/src/lib.rs +++ b/abstutil/src/lib.rs @@ -39,82 +39,33 @@ macro_rules! skip_fail { }; } -// TODO Organize these - -pub fn path_all_maps() -> String { - format!("../data/maps") -} +// System data (Players can't edit, needed at runtime) pub fn path_map(map_name: &str) -> String { format!("../data/maps/{}.bin", map_name) } - -pub fn path_polygon(polygon_name: &str) -> String { - format!("../data/polygons/{}.poly", polygon_name) -} - -pub fn path_raw_map(map_name: &str) -> String { - format!("../data/raw_maps/{}.bin", map_name) -} - -pub fn path_fixes(name: &str) -> String { - format!("../data/fixes/{}.json", name) -} - -pub fn path_camera_state(map_name: &str) -> String { - format!("../data/camera_state/{}.json", map_name) -} - -pub fn path_pending_screenshots(map_name: &str) -> String { - format!("../data/screenshots/pending_{}", map_name) +pub fn path_all_maps() -> String { + format!("../data/maps") } pub fn path_prebaked_results(map_name: &str) -> String { format!("../data/prebaked_results/{}.bin", map_name) } -pub fn path_all_shortcuts() -> String { - format!("../data/shortcuts") +pub fn path_scenario(map_name: &str, scenario_name: &str) -> String { + format!("../data/scenarios/{}/{}.bin", map_name, scenario_name) } - -pub fn path_shortcut(name: &str) -> String { - format!("../data/shortcuts/{}.json", name) -} - pub fn path_all_scenarios(map_name: &str) -> String { format!("../data/scenarios/{}", map_name) } -pub fn path_scenario(map_name: &str, scenario_name: &str) -> String { - format!("../data/scenarios/{}/{}.bin", map_name, scenario_name) -} - -pub fn path_all_edits(map_name: &str) -> String { - format!("../data/edits/{}", map_name) -} - -pub fn path_edits(map_name: &str, edits_name: &str) -> String { - format!("../data/edits/{}/{}.json", map_name, edits_name) -} - -pub fn path_all_neighborhoods(map_name: &str) -> String { - format!("../data/neighborhoods/{}", map_name) -} - -pub fn path_neighborhood(map_name: &str, neighborhood: &str) -> String { - format!("../data/neighborhoods/{}/{}.json", map_name, neighborhood) -} - -pub fn path_all_ab_tests(map_name: &str) -> String { - format!("../data/ab_tests/{}", map_name) -} +// Player data (Players edit this) pub fn path_ab_test(map_name: &str, test_name: &str) -> String { format!("../data/ab_tests/{}/{}.json", map_name, test_name) } - -pub fn path_all_ab_test_saves(map_name: &str, test_name: &str) -> String { - format!("../data/ab_test_saves/{}/{}", map_name, test_name) +pub fn path_all_ab_tests(map_name: &str) -> String { + format!("../data/ab_tests/{}", map_name) } pub fn path_ab_test_save(map_name: &str, test_name: &str, time: String) -> String { @@ -123,13 +74,19 @@ pub fn path_ab_test_save(map_name: &str, test_name: &str, time: String) -> Strin map_name, test_name, time ) } - -pub fn path_popdat() -> String { - format!("../data/shapes/popdat.bin") +pub fn path_all_ab_test_saves(map_name: &str, test_name: &str) -> String { + format!("../data/ab_test_saves/{}/{}", map_name, test_name) } -pub fn path_all_saves(map_name: &str, edits_name: &str, run_name: &str) -> String { - format!("../data/saves/{}/{}_{}", map_name, edits_name, run_name) +pub fn path_camera_state(map_name: &str) -> String { + format!("../data/camera_state/{}.json", map_name) +} + +pub fn path_edits(map_name: &str, edits_name: &str) -> String { + format!("../data/edits/{}/{}.json", map_name, edits_name) +} +pub fn path_all_edits(map_name: &str) -> String { + format!("../data/edits/{}", map_name) } pub fn path_save(map_name: &str, edits_name: &str, run_name: &str, time: String) -> String { @@ -138,3 +95,42 @@ pub fn path_save(map_name: &str, edits_name: &str, run_name: &str, time: String) map_name, edits_name, run_name, time ) } +pub fn path_all_saves(map_name: &str, edits_name: &str, run_name: &str) -> String { + format!("../data/saves/{}/{}_{}", map_name, edits_name, run_name) +} + +pub fn path_shortcut(name: &str) -> String { + format!("../data/shortcuts/{}.json", name) +} +pub fn path_all_shortcuts() -> String { + format!("../data/shortcuts") +} + +// Input data (For developers to build maps, not needed at runtime) + +pub fn path_fixes(name: &str) -> String { + format!("../data/fixes/{}.json", name) +} + +pub fn path_neighborhood(map_name: &str, neighborhood: &str) -> String { + format!("../data/neighborhoods/{}/{}.json", map_name, neighborhood) +} +pub fn path_all_neighborhoods(map_name: &str) -> String { + format!("../data/neighborhoods/{}", map_name) +} + +pub fn path_pending_screenshots(map_name: &str) -> String { + format!("../data/screenshots/pending_{}", map_name) +} + +pub fn path_polygon(polygon_name: &str) -> String { + format!("../data/polygons/{}.poly", polygon_name) +} + +pub fn path_popdat() -> String { + format!("../data/shapes/popdat.bin") +} + +pub fn path_raw_map(map_name: &str) -> String { + format!("../data/raw_maps/{}.bin", map_name) +} diff --git a/ezgui/src/widgets/wizard.rs b/ezgui/src/widgets/wizard.rs index 7b88ff80be..22897959c0 100644 --- a/ezgui/src/widgets/wizard.rs +++ b/ezgui/src/widgets/wizard.rs @@ -261,8 +261,8 @@ impl<'a, 'b> WrappedWizard<'a, 'b> { let choices: Vec> = choices_generator(); if choices.is_empty() { self.wizard.log_scroller = Some(LogScroller::new( - "Wizard".to_string(), - vec![format!("No choices for \"{}\", canceling wizard", query)], + query.to_string(), + vec!["No choices, never mind".to_string()], )); return None; } diff --git a/game/src/options.rs b/game/src/options.rs index a59b9fb497..8bb8adc88c 100644 --- a/game/src/options.rs +++ b/game/src/options.rs @@ -2,6 +2,7 @@ use crate::game::{State, Transition, WizardState}; use ezgui::Choice; // TODO SimOptions stuff too +// TODO Move dev mode here #[derive(Clone)] pub struct Options { pub traffic_signal_style: TrafficSignalStyle,