mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-20 12:51:57 +03:00
jump to stop sign editor from sandbox mode too
This commit is contained in:
parent
afcd694524
commit
7d238ceff5
@ -3,6 +3,7 @@ mod stop_signs;
|
||||
mod traffic_signals;
|
||||
|
||||
use self::lanes::{Brush, LaneEditor};
|
||||
pub use self::stop_signs::StopSignEditor;
|
||||
pub use self::traffic_signals::TrafficSignalEditor;
|
||||
use crate::common::{tool_panel, CommonState, Warping};
|
||||
use crate::debug::DebugMode;
|
||||
@ -128,9 +129,7 @@ impl State for EditMode {
|
||||
.per_obj
|
||||
.action(ctx, Key::E, format!("edit stop signs for {}", id))
|
||||
{
|
||||
return Transition::Push(Box::new(stop_signs::StopSignEditor::new(
|
||||
id, ctx, ui,
|
||||
)));
|
||||
return Transition::Push(Box::new(StopSignEditor::new(id, ctx, ui)));
|
||||
} else if ui
|
||||
.primary
|
||||
.map
|
||||
|
@ -7,7 +7,7 @@ mod speed;
|
||||
pub use self::overlays::Overlays;
|
||||
use crate::common::{tool_panel, CommonState, Minimap};
|
||||
use crate::debug::DebugMode;
|
||||
use crate::edit::{apply_map_edits, save_edits, EditMode, TrafficSignalEditor};
|
||||
use crate::edit::{apply_map_edits, save_edits, EditMode, StopSignEditor, TrafficSignalEditor};
|
||||
use crate::game::{State, Transition, WizardState};
|
||||
use crate::helpers::ID;
|
||||
use crate::managed::Outcome;
|
||||
@ -127,6 +127,14 @@ impl State for SandboxMode {
|
||||
Box::new(TrafficSignalEditor::new(i, ctx, ui, sim_copy)),
|
||||
);
|
||||
}
|
||||
if ui.primary.map.get_i(i).is_stop_sign()
|
||||
&& ui.per_obj.action(ctx, Key::E, "edit stop sign")
|
||||
{
|
||||
return Transition::PushTwice(
|
||||
Box::new(EditMode::new(ctx, ui, self.gameplay.mode.clone())),
|
||||
Box::new(StopSignEditor::new(i, ctx, ui)),
|
||||
);
|
||||
}
|
||||
}
|
||||
if let Some(ID::BusStop(bs)) = ui.primary.current_selection {
|
||||
let routes = ui.primary.map.get_routes_serving_stop(bs);
|
||||
|
Loading…
Reference in New Issue
Block a user