diff options
Diffstat (limited to 'tools/util')
-rw-r--r-- | tools/util/godot_scene.cpp | 6 | ||||
-rw-r--r-- | tools/util/ids_yaml_format.cpp | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/tools/util/godot_scene.cpp b/tools/util/godot_scene.cpp index 1e77c9e..f788d21 100644 --- a/tools/util/godot_scene.cpp +++ b/tools/util/godot_scene.cpp | |||
@@ -1,10 +1,8 @@ | |||
1 | #include "godot_scene.h" | 1 | #include "godot_scene.h" |
2 | 2 | ||
3 | #include <absl/strings/str_split.h> | ||
4 | #include <absl/strings/string_view.h> | ||
5 | |||
6 | #include <fstream> | 3 | #include <fstream> |
7 | #include <sstream> | 4 | #include <sstream> |
5 | #include <string_view> | ||
8 | #include <variant> | 6 | #include <variant> |
9 | 7 | ||
10 | namespace com::fourisland::lingo2_archipelago { | 8 | namespace com::fourisland::lingo2_archipelago { |
@@ -23,7 +21,7 @@ struct Heading { | |||
23 | GodotInstanceType instance_type; | 21 | GodotInstanceType instance_type; |
24 | }; | 22 | }; |
25 | 23 | ||
26 | Heading ParseTscnHeading(absl::string_view line) { | 24 | Heading ParseTscnHeading(std::string_view line) { |
27 | std::string original_line(line); | 25 | std::string original_line(line); |
28 | Heading heading; | 26 | Heading heading; |
29 | 27 | ||
diff --git a/tools/util/ids_yaml_format.cpp b/tools/util/ids_yaml_format.cpp index 67c21d6..71bfd63 100644 --- a/tools/util/ids_yaml_format.cpp +++ b/tools/util/ids_yaml_format.cpp | |||
@@ -104,6 +104,13 @@ IdMappings ReadIdsFromYaml(const std::string& filename) { | |||
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
107 | if (document["door_groups"]) { | ||
108 | for (const auto& group_it : document["door_groups"]) { | ||
109 | (*result.mutable_door_groups())[group_it.first.as<std::string>()] = | ||
110 | group_it.second.as<uint64_t>(); | ||
111 | } | ||
112 | } | ||
113 | |||
107 | return result; | 114 | return result; |
108 | } | 115 | } |
109 | 116 | ||
@@ -171,6 +178,11 @@ void WriteIdsAsYaml(const IdMappings& ids, const std::string& filename) { | |||
171 | result["progressives"][prog_name] = prog_id; | 178 | result["progressives"][prog_name] = prog_id; |
172 | }); | 179 | }); |
173 | 180 | ||
181 | OperateOnSortedMap(ids.door_groups(), [&result](const std::string& group_name, | ||
182 | uint64_t group_id) { | ||
183 | result["door_groups"][group_name] = group_id; | ||
184 | }); | ||
185 | |||
174 | std::ofstream output_stream(filename); | 186 | std::ofstream output_stream(filename); |
175 | output_stream << result << std::endl; | 187 | output_stream << result << std::endl; |
176 | } | 188 | } |