diff options
Diffstat (limited to 'src/game_data.cpp')
-rw-r--r-- | src/game_data.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/game_data.cpp b/src/game_data.cpp index 71b8629..5776c6c 100644 --- a/src/game_data.cpp +++ b/src/game_data.cpp | |||
@@ -262,6 +262,11 @@ struct GameData { | |||
262 | achievement_panels_.push_back(panel_id); | 262 | achievement_panels_.push_back(panel_id); |
263 | } | 263 | } |
264 | 264 | ||
265 | if (panel_it.second["location_name"]) { | ||
266 | panels_[panel_id].location_name = | ||
267 | panel_it.second["location_name"].as<std::string>(); | ||
268 | } | ||
269 | |||
265 | if (panel_it.second["hunt"]) { | 270 | if (panel_it.second["hunt"]) { |
266 | panels_[panel_id].hunt = panel_it.second["hunt"].as<bool>(); | 271 | panels_[panel_id].hunt = panel_it.second["hunt"].as<bool>(); |
267 | } | 272 | } |
@@ -518,8 +523,21 @@ struct GameData { | |||
518 | std::string room_name = rooms_[room_id].name; | 523 | std::string room_name = rooms_[room_id].name; |
519 | 524 | ||
520 | std::string area_name = room_name; | 525 | std::string area_name = room_name; |
521 | if (fold_areas.count(room_name)) { | 526 | std::string section_name = panel.name; |
522 | int fold_area_id = fold_areas[room_name]; | 527 | std::string location_name = room_name + " - " + panel.name; |
528 | |||
529 | if (!panel.location_name.empty()) { | ||
530 | location_name = panel.location_name; | ||
531 | |||
532 | size_t divider_pos = location_name.find(" - "); | ||
533 | if (divider_pos != std::string::npos) { | ||
534 | area_name = location_name.substr(0, divider_pos); | ||
535 | section_name = location_name.substr(divider_pos + 3); | ||
536 | } | ||
537 | } | ||
538 | |||
539 | if (fold_areas.count(area_name)) { | ||
540 | int fold_area_id = fold_areas[area_name]; | ||
523 | area_name = map_areas_[fold_area_id].name; | 541 | area_name = map_areas_[fold_area_id].name; |
524 | } | 542 | } |
525 | 543 | ||
@@ -535,15 +553,15 @@ struct GameData { | |||
535 | MapArea &map_area = map_areas_[area_id]; | 553 | MapArea &map_area = map_areas_[area_id]; |
536 | // room field should be the original room ID | 554 | // room field should be the original room ID |
537 | map_area.locations.push_back( | 555 | map_area.locations.push_back( |
538 | {.name = panel.name, | 556 | {.name = section_name, |
539 | .ap_location_name = room_name + " - " + panel.name, | 557 | .ap_location_name = location_name, |
540 | .ap_location_id = panel.ap_location_id, | 558 | .ap_location_id = panel.ap_location_id, |
541 | .room = panel.room, | 559 | .room = panel.room, |
542 | .panels = {panel.id}, | 560 | .panels = {panel.id}, |
543 | .classification = classification, | 561 | .classification = classification, |
544 | .hunt = panel.hunt}); | 562 | .hunt = panel.hunt}); |
545 | locations_by_name[map_area.locations.back().ap_location_name] = { | 563 | locations_by_name[location_name] = {area_id, |
546 | area_id, map_area.locations.size() - 1}; | 564 | map_area.locations.size() - 1}; |
547 | } | 565 | } |
548 | 566 | ||
549 | for (int door_id : door_definition_order_) { | 567 | for (int door_id : door_definition_order_) { |