diff --git a/ezgui/src/assets/fragment_140.glsl b/ezgui/src/assets/fragment_140.glsl index f633468383..7cada650b1 100644 --- a/ezgui/src/assets/fragment_140.glsl +++ b/ezgui/src/assets/fragment_140.glsl @@ -25,9 +25,13 @@ in vec4 pass_style; out vec4 f_color; void handle_texture(in sampler2DArray tex, in vec4 style, out vec4 color) { - color = texture(tex, vec3(pass_style[0], pass_style[1], pass_style[3] - 100.0)); - if (pass_style[3] >= 200.0 && color[3] > 0.0) { - color = vec4(1.0, 0.55, 0.0, 1.0); + if (pass_style[3] >= 200.0) { + color = texture(tex, vec3(pass_style[0], pass_style[1], pass_style[3] - 200.0)); + if (color[3] > 0.0) { + color = vec4(1.0, 0.55, 0.0, 1.0); + } + } else { + color = texture(tex, vec3(pass_style[0], pass_style[1], pass_style[3] - 100.0)); } } diff --git a/game/assets/speed/slow_down.png b/game/assets/speed/slow_down.png index bad37097b9..a0da2e4aa3 100644 Binary files a/game/assets/speed/slow_down.png and b/game/assets/speed/slow_down.png differ diff --git a/game/assets/speed/small_step.png b/game/assets/speed/small_step.png index 4933cb65c9..f133243b5f 100644 Binary files a/game/assets/speed/small_step.png and b/game/assets/speed/small_step.png differ diff --git a/game/src/sandbox/speed.rs b/game/src/sandbox/speed.rs index 39135669c4..cab4d3a9ac 100644 --- a/game/src/sandbox/speed.rs +++ b/game/src/sandbox/speed.rs @@ -20,6 +20,7 @@ pub struct SpeedControls { resume_btn: Button, pause_btn: Button, jump_to_time_btn: Button, + small_step_btn: Button, large_step_btn: Button, speed_slider: Slider, slow_down_btn: Button, @@ -110,17 +111,17 @@ impl SpeedControls { hotkey(Key::B), ctx, ) - .at(ScreenPt::new(328.0, 22.0)); + .at(ScreenPt::new(300.0, 20.0)); // Row 2 - /*let small_step_btn = Button::rectangle_img_no_bg( + let small_step_btn = Button::rectangle_img_no_bg( "assets/speed/small_step.png", "step forwards 0.1s", hotkey(Key::M), ctx, ) - .at(ScreenPt::new(380.0, 70.0));*/ + .at(ScreenPt::new(315.0, 60.0)); let large_step_btn = Button::rectangle_img_no_bg( "assets/speed/large_step.png", @@ -145,7 +146,7 @@ impl SpeedControls { hotkey(Key::LeftBracket), ctx, ) - .at(ScreenPt::new(264.0, 129.0)); + .at(ScreenPt::new(245.0, 129.0)); let speed_up_btn = Button::rectangle_img_no_bg( "assets/speed/speed_up.png", "speed up", @@ -159,6 +160,7 @@ impl SpeedControls { resume_btn, pause_btn, jump_to_time_btn, + small_step_btn, large_step_btn, speed_slider, slow_down_btn, @@ -235,14 +237,14 @@ impl SpeedControls { } } - /*self.small_step_btn.event(ctx); + self.small_step_btn.event(ctx); if self.small_step_btn.clicked() { ui.primary.sim.step(&ui.primary.map, Duration::seconds(0.1)); if let Some(ref mut s) = ui.secondary { s.sim.step(&s.map, Duration::seconds(0.1)); } ui.recalculate_current_selection(ctx); - }*/ + } self.large_step_btn.event(ctx); if self.large_step_btn.clicked() { @@ -286,7 +288,7 @@ impl SpeedControls { g.draw_text_at_screenspace_topleft( &Text::from(Line(ui.primary.sim.time().ampm_tostring()).size(30)).no_bg(), - ScreenPt::new(86.0, 13.0), + ScreenPt::new(86.0, 19.0), ); self.jump_to_time_btn.draw(g); @@ -314,7 +316,7 @@ impl SpeedControls { g.unfork(); } - //self.small_step_btn.draw(g); + self.small_step_btn.draw(g); self.large_step_btn.draw(g); // Row 4 @@ -327,7 +329,7 @@ impl SpeedControls { // TODO Center this text g.draw_text_at_screenspace_topleft( &Text::from(Line(format!("{:.1}x", self.desired_speed())).size(14)).no_bg(), - ScreenPt::new(290.0, 131.0), + ScreenPt::new(275.0, 131.0), ); self.speed_up_btn.draw(g);