diff --git a/game/src/sandbox/gameplay/mod.rs b/game/src/sandbox/gameplay/mod.rs index be327b2aaa..f68299c984 100644 --- a/game/src/sandbox/gameplay/mod.rs +++ b/game/src/sandbox/gameplay/mod.rs @@ -129,6 +129,13 @@ impl GameplayMode { } true } + + pub fn has_minimap(&self) -> bool { + match self { + GameplayMode::FixTrafficSignalsTutorial(_) => false, + _ => true, + } + } } impl GameplayRunner { diff --git a/game/src/sandbox/mod.rs b/game/src/sandbox/mod.rs index 37eab02109..615119b4d6 100644 --- a/game/src/sandbox/mod.rs +++ b/game/src/sandbox/mod.rs @@ -33,7 +33,7 @@ pub struct SandboxMode { overlay: Overlays, gameplay: gameplay::GameplayRunner, common: CommonState, - minimap: Minimap, + minimap: Option, menu: ModalMenu, } @@ -67,9 +67,13 @@ impl SandboxMode { ), agent_tools: AgentTools::new(), overlay: Overlays::Inactive, - gameplay: gameplay::GameplayRunner::initialize(mode, ui, ctx), common: CommonState::new(ctx), - minimap: Minimap::new(), + minimap: if mode.has_minimap() { + Some(Minimap::new()) + } else { + None + }, + gameplay: gameplay::GameplayRunner::initialize(mode, ui, ctx), menu: ModalMenu::new( "Sandbox Mode", vec![(lctrl(Key::E), "edit mode"), (hotkey(Key::X), "reset sim")], @@ -131,7 +135,9 @@ impl State for SandboxMode { { return t; } - self.minimap.event(ui, ctx); + if let Some(ref mut m) = self.minimap { + m.event(ui, ctx); + } if let Some(t) = self .agent_tools @@ -305,7 +311,9 @@ impl State for SandboxMode { self.info_tools.draw(g); self.general_tools.draw(g); self.gameplay.draw(g, ui); - self.minimap.draw(g, ui); + if let Some(ref m) = self.minimap { + m.draw(g, ui); + } } fn on_suspend(&mut self, _: &mut EventCtx, _: &mut UI) {