few things that should be in top menu

This commit is contained in:
Dustin Carlino 2018-12-17 13:13:02 -08:00
parent bbacdfb676
commit acbd08240d
3 changed files with 6 additions and 9 deletions

View File

@ -1,6 +1,6 @@
use crate::plugins::{Plugin, PluginCtx};
use abstutil::elapsed_seconds;
use ezgui::{EventLoopMode, Key};
use ezgui::EventLoopMode;
use sim::{Benchmark, Event, Sim, Tick, TIMESTEP};
use std::mem;
use std::time::{Duration, Instant};
@ -43,11 +43,7 @@ impl Plugin for SimControls {
self.desired_speed += ADJUST_SPEED;
}
if ctx.secondary.is_some()
&& ctx
.input
.key_pressed(Key::S, "Swap the primary/secondary sim")
{
if ctx.secondary.is_some() && ctx.input.action_chosen("swap the primary/secondary sim") {
info!("Swapping primary/secondary sim");
// Check out this cool little trick. :D
let primary_plugins = ctx.primary_plugins.take().unwrap();

View File

@ -14,8 +14,7 @@ pub struct DiffAllState {
impl DiffAllState {
pub fn new(ctx: &mut PluginCtx) -> Option<DiffAllState> {
if ctx.primary.current_selection.is_none()
&& ctx.input.key_pressed(Key::D, "Diff all trips")
if ctx.primary.current_selection.is_none() && ctx.input.action_chosen("diff all A/B trips")
{
return Some(diff_all(
&ctx.primary.sim,

View File

@ -67,11 +67,13 @@ impl<S: UIState> GUI<RenderingHints> for UI<S> {
(Key::O, "save sim state"),
(Key::Y, "load previous sim state"),
(Key::U, "load next sim state"),
(Key::S, "seed the sim with agents"),
(Key::Space, "run/pause sim"),
(Key::M, "run one step of sim"),
(Key::Dot, "show/hide sim info sidepanel"),
(Key::T, "start time traveling"),
(Key::D, "diff all A/B trips"),
(Key::S, "seed the sim with agents"),
(Key::LeftAlt, "swap the primary/secondary sim"),
],
),
Folder::new(