mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 15:02:59 +03:00
Restore the ability to see individually changed lanes. Give up on the
"revert" button for lanes; it was always kind of confusing.
This commit is contained in:
parent
1c98dd55b7
commit
e283b8944a
@ -84,17 +84,7 @@ impl LaneEditor {
|
||||
Widget::custom_row(row).centered(),
|
||||
change_speed_limit(ctx, parent.speed_limit),
|
||||
Btn::text_fg("Change access restrictions").build_def(ctx, hotkey(Key::A)),
|
||||
Widget::custom_row(vec![
|
||||
Btn::text_fg("Finish").build_def(ctx, hotkey(Key::Escape)),
|
||||
// TODO Handle reverting speed limit too...
|
||||
// TODO Woops, we need an easy way to figure this out
|
||||
if false {
|
||||
Btn::text_fg("Revert").build_def(ctx, hotkey(Key::R))
|
||||
} else {
|
||||
Btn::text_fg("Revert").inactive(ctx)
|
||||
},
|
||||
])
|
||||
.centered(),
|
||||
Btn::text_bg2("Finish").build_def(ctx, hotkey(Key::Escape)),
|
||||
];
|
||||
|
||||
let composite = Composite::new(Widget::col(col))
|
||||
@ -151,9 +141,6 @@ impl State for LaneEditor {
|
||||
x => {
|
||||
let map = &mut app.primary.map;
|
||||
let result = match x {
|
||||
"Revert" => {
|
||||
panic!("need to implement this again");
|
||||
}
|
||||
"reverse lane direction" => try_reverse(ctx, map, self.l),
|
||||
"convert to a driving lane" => {
|
||||
try_change_lt(ctx, map, self.l, LaneType::Driving)
|
||||
|
@ -8,7 +8,7 @@ use ezgui::{
|
||||
Text, TextExt, VerticalAlignment, Widget,
|
||||
};
|
||||
use geom::{Distance, Time};
|
||||
use map_model::LaneType;
|
||||
use map_model::{EditRoad, LaneType};
|
||||
use sim::AgentType;
|
||||
|
||||
pub struct BikeNetwork {
|
||||
@ -222,10 +222,22 @@ impl Static {
|
||||
);
|
||||
|
||||
let edits = app.primary.map.get_edits();
|
||||
// TODO Actually this loses tons of information; we really should highlight just the
|
||||
// changed lanes
|
||||
for r in &edits.changed_roads {
|
||||
colorer.add_r(*r, "modified road/intersection");
|
||||
let r = app.primary.map.get_r(*r);
|
||||
let orig = EditRoad::get_orig_from_osm(r);
|
||||
// What exactly changed?
|
||||
if r.speed_limit != orig.speed_limit
|
||||
|| r.access_restrictions != orig.access_restrictions
|
||||
{
|
||||
colorer.add_r(r.id, "modified road/intersection");
|
||||
} else {
|
||||
let lanes = r.lanes_ltr();
|
||||
for (idx, (lt, dir)) in orig.lanes_ltr.into_iter().enumerate() {
|
||||
if lanes[idx].1 != dir || lanes[idx].2 != lt {
|
||||
colorer.add_l(lanes[idx].0, "modified road/intersection");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for i in edits.original_intersections.keys() {
|
||||
colorer.add_i(*i, "modified lane/intersection");
|
||||
|
@ -46,7 +46,7 @@ pub struct EditRoad {
|
||||
}
|
||||
|
||||
impl EditRoad {
|
||||
fn get_orig_from_osm(r: &Road) -> EditRoad {
|
||||
pub fn get_orig_from_osm(r: &Road) -> EditRoad {
|
||||
EditRoad {
|
||||
lanes_ltr: get_lane_specs_ltr(&r.osm_tags)
|
||||
.into_iter()
|
||||
|
@ -10,7 +10,9 @@ pub mod raw;
|
||||
mod traversable;
|
||||
|
||||
pub use crate::city::City;
|
||||
pub use crate::edits::{EditCmd, EditEffects, EditIntersection, MapEdits, PermanentMapEdits};
|
||||
pub use crate::edits::{
|
||||
EditCmd, EditEffects, EditIntersection, EditRoad, MapEdits, PermanentMapEdits,
|
||||
};
|
||||
pub use crate::map::MapConfig;
|
||||
pub use crate::objects::area::{Area, AreaID, AreaType};
|
||||
pub use crate::objects::building::{
|
||||
|
Loading…
Reference in New Issue
Block a user