Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Delv tools should not crash without graphviz installed (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
porkbrain authored May 30, 2024
1 parent 84972d5 commit c25213d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
12 changes: 10 additions & 2 deletions main_game_lib/src/top_down/layout/map_maker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,16 @@ fn export_map<T: TopDownScene>(

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<L: Eq> TileKind<L> {
Expand Down
1 change: 1 addition & 0 deletions wiki/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
- [Devtools](devtools.md)
- [Godot](devtools_godot.md)
- [Dialog](devtools_dialog.md)
- [Map maker](devtools_map_maker.md)
5 changes: 5 additions & 0 deletions wiki/src/devtools_map_maker.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit c25213d

Please sign in to comment.