diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-08-20 15:28:40 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-08-20 15:28:40 -0400 |
| commit | bcf503855107404ab3c8e0a7edd750c2720f8024 (patch) | |
| tree | e3b9b98ac0e288fdf9135c161c525392e824191f /tools | |
| parent | d77c73397b684faa55f0e95484ac89ca68bde1ad (diff) | |
| download | lingo2-archipelago-bcf503855107404ab3c8e0a7edd750c2720f8024.tar.gz lingo2-archipelago-bcf503855107404ab3c8e0a7edd750c2720f8024.tar.bz2 lingo2-archipelago-bcf503855107404ab3c8e0a7edd750c2720f8024.zip | |
Maps have display names now
Also added endings to the apworld.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/datapacker/main.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
| diff --git a/tools/datapacker/main.cpp b/tools/datapacker/main.cpp index c5a90e9..3ddb11f 100644 --- a/tools/datapacker/main.cpp +++ b/tools/datapacker/main.cpp | |||
| @@ -68,11 +68,28 @@ class DataPacker { | |||
| 68 | void ProcessMap(std::filesystem::path path) { | 68 | void ProcessMap(std::filesystem::path path) { |
| 69 | std::string map_name = path.filename().string(); | 69 | std::string map_name = path.filename().string(); |
| 70 | 70 | ||
| 71 | ProcessMapMetadataFile(path / "metadata.txtpb", map_name); | ||
| 71 | ProcessConnectionsFile(path / "connections.txtpb", map_name); | 72 | ProcessConnectionsFile(path / "connections.txtpb", map_name); |
| 72 | ProcessDoorsFile(path / "doors.txtpb", map_name); | 73 | ProcessDoorsFile(path / "doors.txtpb", map_name); |
| 73 | ProcessRooms(path / "rooms", map_name); | 74 | ProcessRooms(path / "rooms", map_name); |
| 74 | } | 75 | } |
| 75 | 76 | ||
| 77 | void ProcessMapMetadataFile(std::filesystem::path path, | ||
| 78 | const std::string& map_name) { | ||
| 79 | if (!std::filesystem::exists(path)) { | ||
| 80 | return; | ||
| 81 | } | ||
| 82 | |||
| 83 | auto metadata = ReadMessageFromFile<HumanMap>(path.string()); | ||
| 84 | |||
| 85 | uint64_t map_id = container_.FindOrAddMap(map_name); | ||
| 86 | Map& map = *container_.all_objects().mutable_maps(map_id); | ||
| 87 | |||
| 88 | if (metadata.has_display_name()) { | ||
| 89 | map.set_display_name(metadata.display_name()); | ||
| 90 | } | ||
| 91 | } | ||
| 92 | |||
| 76 | void ProcessRooms(std::filesystem::path path, | 93 | void ProcessRooms(std::filesystem::path path, |
| 77 | const std::string& current_map_name) { | 94 | const std::string& current_map_name) { |
| 78 | for (auto const& dir_entry : std::filesystem::directory_iterator(path)) { | 95 | for (auto const& dir_entry : std::filesystem::directory_iterator(path)) { |
