summary refs log tree commit diff stats
path: root/tools/validator/human_processor.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-08-30 12:00:03 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-08-30 12:00:03 -0400
commitd2bc5b2811171685e8bdc895122987b53defcf0a (patch)
treedabf111e8d4ba8caceee46189075968e223e3ee8 /tools/validator/human_processor.cpp
parent3b77044a6a53d38a6960eb2a5855283a00b24d75 (diff)
downloadlingo2-archipelago-d2bc5b2811171685e8bdc895122987b53defcf0a.tar.gz
lingo2-archipelago-d2bc5b2811171685e8bdc895122987b53defcf0a.tar.bz2
lingo2-archipelago-d2bc5b2811171685e8bdc895122987b53defcf0a.zip
Changed how door location names are formatted
STANDARD type doors with at most four panels in the same map area and no
other trigger objects will have their location names generated from the
names of the panels used to open the door, similar to Lingo 1. Other
door types will use the door's name. In either case, the name can be
overridden using the new location_name field.

Rooms can also set a panel_display_name field, which will be used in
location names for doors, and is used to group panels into areas.

Panels themselves can set display names, which differentiates their
locations from other panels in the same area.

Many maps were updated for this, but note that the_symbolic and
the_unyielding have validator failures because of duplicate panel names.
This won't matter until panelsanity is implemented.
Diffstat (limited to 'tools/validator/human_processor.cpp')
-rw-r--r--tools/validator/human_processor.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/tools/validator/human_processor.cpp b/tools/validator/human_processor.cpp index fb06d31..0f63936 100644 --- a/tools/validator/human_processor.cpp +++ b/tools/validator/human_processor.cpp
@@ -1,5 +1,6 @@
1#include "human_processor.h" 1#include "human_processor.h"
2 2
3#include <fmt/core.h>
3#include <google/protobuf/message.h> 4#include <google/protobuf/message.h>
4#include <google/protobuf/text_format.h> 5#include <google/protobuf/text_format.h>
5 6
@@ -93,7 +94,7 @@ class HumanProcessor {
93 room_info.definitions.push_back(h_room); 94 room_info.definitions.push_back(h_room);
94 95
95 for (const HumanPanel& h_panel : h_room.panels()) { 96 for (const HumanPanel& h_panel : h_room.panels()) {
96 ProcessPanel(h_panel, current_map_name, h_room.name()); 97 ProcessPanel(h_panel, current_map_name, h_room);
97 } 98 }
98 99
99 for (const HumanPainting& h_painting : h_room.paintings()) { 100 for (const HumanPainting& h_painting : h_room.paintings()) {
@@ -123,10 +124,10 @@ class HumanProcessor {
123 124
124 void ProcessPanel(const HumanPanel& h_panel, 125 void ProcessPanel(const HumanPanel& h_panel,
125 const std::string& current_map_name, 126 const std::string& current_map_name,
126 const std::string& current_room_name) { 127 const HumanRoom& h_room) {
127 PanelIdentifier panel_identifier; 128 PanelIdentifier panel_identifier;
128 panel_identifier.set_map(current_map_name); 129 panel_identifier.set_map(current_map_name);
129 panel_identifier.set_room(current_room_name); 130 panel_identifier.set_room(h_room.name());
130 panel_identifier.set_name(h_panel.name()); 131 panel_identifier.set_name(h_panel.name());
131 132
132 PanelInfo& panel_info = info_.panels[panel_identifier]; 133 PanelInfo& panel_info = info_.panels[panel_identifier];
@@ -155,6 +156,24 @@ class HumanProcessor {
155 RoomInfo& required_room_info = info_.rooms[required_room_identifier]; 156 RoomInfo& required_room_info = info_.rooms[required_room_identifier];
156 required_room_info.panels_referenced_by.push_back(panel_identifier); 157 required_room_info.panels_referenced_by.push_back(panel_identifier);
157 } 158 }
159
160 std::string map_area_name = current_map_name;
161 if (h_room.has_panel_display_name()) {
162 map_area_name =
163 fmt::format("{} ({})", current_map_name, h_room.panel_display_name());
164 }
165
166 panel_info.map_area_name = map_area_name;
167
168 std::string panelsanity_name;
169 if (h_panel.has_display_name()) {
170 panelsanity_name =
171 fmt::format("{} - {}", map_area_name, h_panel.display_name());
172 } else {
173 panelsanity_name = fmt::format("{} - {}", map_area_name, h_panel.name());
174 }
175 info_.panel_names[panelsanity_name].panels_used_by.push_back(
176 panel_identifier);
158 } 177 }
159 178
160 void ProcessPainting(const HumanPainting& h_painting, 179 void ProcessPainting(const HumanPainting& h_painting,