about summary refs log tree commit diff stats
path: root/src/game_data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_data.cpp')
-rw-r--r--src/game_data.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/game_data.cpp b/src/game_data.cpp index dbc269a..bc4f41b 100644 --- a/src/game_data.cpp +++ b/src/game_data.cpp
@@ -254,6 +254,11 @@ struct GameData {
254 achievement_panels_.push_back(panel_id); 254 achievement_panels_.push_back(panel_id);
255 } 255 }
256 256
257 if (panel_it.second["location_name"]) {
258 panels_[panel_id].location_name =
259 panel_it.second["location_name"].as<std::string>();
260 }
261
257 if (panel_it.second["hunt"]) { 262 if (panel_it.second["hunt"]) {
258 panels_[panel_id].hunt = panel_it.second["hunt"].as<bool>(); 263 panels_[panel_id].hunt = panel_it.second["hunt"].as<bool>();
259 } 264 }
@@ -521,8 +526,21 @@ struct GameData {
521 std::string room_name = rooms_[room_id].name; 526 std::string room_name = rooms_[room_id].name;
522 527
523 std::string area_name = room_name; 528 std::string area_name = room_name;
524 if (fold_areas.count(room_name)) { 529 std::string section_name = panel.name;
525 int fold_area_id = fold_areas[room_name]; 530 std::string location_name = room_name + " - " + panel.name;
531
532 if (!panel.location_name.empty()) {
533 location_name = panel.location_name;
534
535 size_t divider_pos = location_name.find(" - ");
536 if (divider_pos != std::string::npos) {
537 area_name = location_name.substr(0, divider_pos);
538 section_name = location_name.substr(divider_pos + 3);
539 }
540 }
541
542 if (fold_areas.count(area_name)) {
543 int fold_area_id = fold_areas[area_name];
526 area_name = map_areas_[fold_area_id].name; 544 area_name = map_areas_[fold_area_id].name;
527 } 545 }
528 546
@@ -542,15 +560,15 @@ struct GameData {
542 MapArea &map_area = map_areas_[area_id]; 560 MapArea &map_area = map_areas_[area_id];
543 // room field should be the original room ID 561 // room field should be the original room ID
544 map_area.locations.push_back( 562 map_area.locations.push_back(
545 {.name = panel.name, 563 {.name = section_name,
546 .ap_location_name = room_name + " - " + panel.name, 564 .ap_location_name = location_name,
547 .ap_location_id = panel.ap_location_id, 565 .ap_location_id = panel.ap_location_id,
548 .room = panel.room, 566 .room = panel.room,
549 .panels = {panel.id}, 567 .panels = {panel.id},
550 .classification = classification, 568 .classification = classification,
551 .hunt = panel.hunt}); 569 .hunt = panel.hunt});
552 locations_by_name[map_area.locations.back().ap_location_name] = { 570 locations_by_name[location_name] = {area_id,
553 area_id, map_area.locations.size() - 1}; 571 map_area.locations.size() - 1};
554 } 572 }
555 573
556 for (int door_id : door_definition_order_) { 574 for (int door_id : door_definition_order_) {