diff --git a/main_game_lib/src/top_down/layout/map_maker.rs b/main_game_lib/src/top_down/layout/map_maker.rs index ffdf62ba..f53e5a93 100644 --- a/main_game_lib/src/top_down/layout/map_maker.rs +++ b/main_game_lib/src/top_down/layout/map_maker.rs @@ -398,8 +398,16 @@ fn export_map( let dot_g = g.as_dotgraph(T::name()); info!("Graphviz dot graph: \n{}", dot_g.as_dot()); - let svg = dot_g.into_svg().unwrap(); - fs::write(format!("{scene_path}/docs/tile-graph.svg"), svg).unwrap(); + + match dot_g.into_svg() { + Ok(svg) => { + fs::write(format!("{scene_path}/docs/tile-graph.svg"), svg) + .unwrap(); + } + Err(e) => { + error!("Could not generate svg from dot graph: {e}"); + } + } } impl TileKind { diff --git a/wiki/src/SUMMARY.md b/wiki/src/SUMMARY.md index 155d5b79..628dd7ba 100644 --- a/wiki/src/SUMMARY.md +++ b/wiki/src/SUMMARY.md @@ -11,3 +11,4 @@ - [Devtools](devtools.md) - [Godot](devtools_godot.md) - [Dialog](devtools_dialog.md) + - [Map maker](devtools_map_maker.md) diff --git a/wiki/src/devtools_map_maker.md b/wiki/src/devtools_map_maker.md new file mode 100644 index 00000000..f09198f4 --- /dev/null +++ b/wiki/src/devtools_map_maker.md @@ -0,0 +1,5 @@ +TODO + +To store the edit, you can press the "Store button". +Ideally, you would have [`graphviz`] installed. +We use it to store an SVG file that shows connections between zones for debug purposes.