about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game_data.cpp30
-rw-r--r--src/game_data.h1
-rw-r--r--src/version.h2
3 files changed, 26 insertions, 7 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_) {
diff --git a/src/game_data.h b/src/game_data.h index e0942f7..a5d5699 100644 --- a/src/game_data.h +++ b/src/game_data.h
@@ -50,6 +50,7 @@ struct Panel {
50 bool exclude_reduce = false; 50 bool exclude_reduce = false;
51 bool achievement = false; 51 bool achievement = false;
52 std::string achievement_name; 52 std::string achievement_name;
53 std::string location_name;
53 bool non_counting = false; 54 bool non_counting = false;
54 int ap_location_id = -1; 55 int ap_location_id = -1;
55 bool hunt = false; 56 bool hunt = false;
diff --git a/src/version.h b/src/version.h index 36bd8c1..4b13d42 100644 --- a/src/version.h +++ b/src/version.h
@@ -37,6 +37,6 @@ struct Version {
37 } 37 }
38}; 38};
39 39
40constexpr const Version kTrackerVersion = Version(0, 9, 0); 40constexpr const Version kTrackerVersion = Version(0, 9, 2);
41 41
42#endif /* end of include guard: VERSION_H_C757E53C */ \ No newline at end of file 42#endif /* end of include guard: VERSION_H_C757E53C */ \ No newline at end of file