diff --git a/abstutil/src/logs.rs b/abstutil/src/logs.rs index db6942cbb4..37e1e18628 100644 --- a/abstutil/src/logs.rs +++ b/abstutil/src/logs.rs @@ -41,6 +41,16 @@ impl Warn { self.value } + pub fn expect(self, context: String) -> T { + if !self.warnings.is_empty() { + println!("{} warnings ({}):", self.warnings.len(), context); + for line in self.warnings { + println!("{}", line); + } + } + self.value + } + pub fn get(self, timer: &mut Timer) -> T { // TODO Context from the current Timer phase, caller for line in self.warnings { diff --git a/ezgui/src/text.rs b/ezgui/src/text.rs index a2df3d91b3..0d9d14685e 100644 --- a/ezgui/src/text.rs +++ b/ezgui/src/text.rs @@ -15,7 +15,7 @@ pub const INACTIVE_CHOICE_COLOR: Color = Color::grey(0.4); // TODO Don't do this! const MAX_CHAR_WIDTH: f64 = 25.0; -pub const SCALE_DOWN: f64 = 10.0; +pub const SCALE_DOWN: f64 = 60.0; // These're hardcoded for simplicity; this list doesn't change much. const DEJA_VU: FontId = FontId(0); diff --git a/game/src/common/info.rs b/game/src/common/info.rs index 0e3b469a98..e1f54eaf83 100644 --- a/game/src/common/info.rs +++ b/game/src/common/info.rs @@ -148,10 +148,10 @@ impl InfoPanel { time: ui.primary.sim.time(), composite: Composite::new(ManagedWidget::col(col).bg(Color::grey(0.3))) .aligned( - HorizontalAlignment::Percent(0.1), + HorizontalAlignment::Percent(0.02), VerticalAlignment::Percent(0.2), ) - .max_size_percent(40, 60) + .max_size_percent(30, 60) .build(ctx), also_draw: batch.upload(ctx), } diff --git a/game/src/common/warp.rs b/game/src/common/warp.rs index 3d6aedbdd0..1796d82ad9 100644 --- a/game/src/common/warp.rs +++ b/game/src/common/warp.rs @@ -1,5 +1,6 @@ use crate::game::{State, Transition, WizardState}; use crate::helpers::ID; +use crate::sandbox::SandboxMode; use crate::ui::{PerMapUI, UI}; use ezgui::{EventCtx, GfxCtx, Warper, Wizard}; use geom::Pt2D; @@ -54,12 +55,19 @@ impl Warping { } impl State for Warping { - fn event(&mut self, ctx: &mut EventCtx, ui: &mut UI) -> Transition { + fn event(&mut self, ctx: &mut EventCtx, _: &mut UI) -> Transition { if let Some(evmode) = self.warper.event(ctx) { Transition::KeepWithMode(evmode) } else { - ui.primary.current_selection = self.id.clone(); - Transition::Pop + if let Some(id) = self.id.clone() { + Transition::PopWithData(Box::new(move |state, ui, ctx| { + if let Some(ref mut s) = state.downcast_mut::() { + s.common.launch_info_panel(id, ctx, ui); + } + })) + } else { + Transition::Pop + } } } diff --git a/game/src/render/intersection.rs b/game/src/render/intersection.rs index b7908e6c75..69103dfd1e 100644 --- a/game/src/render/intersection.rs +++ b/game/src/render/intersection.rs @@ -146,7 +146,7 @@ impl Renderable for DrawIntersection { *maybe_redraw = Some(( ctx.sim.time(), g.prerender.upload(batch), - Text::from(Line(format!("{}", idx + 1)).roboto()), + Text::from(Line(format!("{}", idx + 1)).roboto().size(90)), ctx.map.get_i(self.id).polygon.center(), )); } diff --git a/game/src/render/pedestrian.rs b/game/src/render/pedestrian.rs index 2770c3ec81..a1c93efd3e 100644 --- a/game/src/render/pedestrian.rs +++ b/game/src/render/pedestrian.rs @@ -213,7 +213,7 @@ impl DrawPedCrowd { let label = Text::from( Line(format!("{}", input.members.len())) .fg(Color::BLACK) - .size(15), + .size(60), ); DrawPedCrowd { diff --git a/game/src/render/turn.rs b/game/src/render/turn.rs index 15d68948da..9e41acccfd 100644 --- a/game/src/render/turn.rs +++ b/game/src/render/turn.rs @@ -12,7 +12,9 @@ impl DrawTurn { pub fn draw_full(t: &Turn, g: &mut GfxCtx, color: Color) { g.draw_polygon( color, - &t.geom.make_arrow(BIG_ARROW_THICKNESS * 2.0).unwrap(), + &t.geom + .make_arrow(BIG_ARROW_THICKNESS) + .expect(format!("draw_full {}", t.id)), ); } diff --git a/game/src/sandbox/mod.rs b/game/src/sandbox/mod.rs index d7e54d156b..4ba9439534 100644 --- a/game/src/sandbox/mod.rs +++ b/game/src/sandbox/mod.rs @@ -28,7 +28,7 @@ pub struct SandboxMode { agent_meter: AgentMeter, gameplay: Box, gameplay_mode: GameplayMode, - common: CommonState, + pub common: CommonState, tool_panel: WrappedComposite, minimap: Minimap, }