Add a button to reload RawMap in editor, effectively making a way to undo a tested merge operation.
@@ -122,6 +122,10 @@ impl MainState {
.btn_solid_destructive
.text("overwrite RawMap")
.build_def(ctx),
+ ctx.style()
+ .btn_solid_destructive
+ .text("reload RawMap")
+ .build_def(ctx),
]),
]))
.aligned(HorizontalAlignment::Right, VerticalAlignment::Top)
@@ -320,6 +324,18 @@ impl State<App> for MainState {
"overwrite RawMap" => {
app.model.map.save();
}
+ "reload RawMap" => {
+ let include_bldgs = false;
+ app.model = Model::import(
+ ctx,
+ abstio::path_raw_map(&app.model.map.name),
+ include_bldgs,
+ );
+ app.model.show_intersection_geometry(
+ ctx,
+ self.panel.is_checked("intersection geometry"),
+ );
+ }
_ => unreachable!(),
},
Outcome::Changed(_) => {
