mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-25 11:44:25 +03:00
few things that should be in top menu
This commit is contained in:
parent
bbacdfb676
commit
acbd08240d
@ -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();
|
||||
|
@ -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,
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user