about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-05-17 18:07:16 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-05-17 18:07:16 -0400
commit085531b53449dc28bc18739b06772641c5c82192 (patch)
treefcf1c0cfe0f7faa6f0fe4902b1731b3b8b9113c3
parentc0204878f7e4bf2240104a81a54943d7749d690a (diff)
downloadlingo-ap-tracker-085531b53449dc28bc18739b06772641c5c82192.tar.gz
lingo-ap-tracker-085531b53449dc28bc18739b06772641c5c82192.tar.bz2
lingo-ap-tracker-085531b53449dc28bc18739b06772641c5c82192.zip
Handle panel location name config field
-rw-r--r--src/game_data.cpp30
-rw-r--r--src/game_data.h1
2 files changed, 25 insertions, 6 deletions
diff --git a/src/game_data.cpp b/src/game_data.cpp index c98f532..be31b8f 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
@@ -538,15 +556,15 @@ struct GameData {
538 MapArea &map_area = map_areas_[area_id]; 556 MapArea &map_area = map_areas_[area_id];
539 // room field should be the original room ID 557 // room field should be the original room ID
540 map_area.locations.push_back( 558 map_area.locations.push_back(
541 {.name = panel.name, 559 {.name = section_name,
542 .ap_location_name = room_name + " - " + panel.name, 560 .ap_location_name = location_name,
543 .ap_location_id = panel.ap_location_id, 561 .ap_location_id = panel.ap_location_id,
544 .room = panel.room, 562 .room = panel.room,
545 .panels = {panel.id}, 563 .panels = {panel.id},
546 .classification = classification, 564 .classification = classification,
547 .hunt = panel.hunt}); 565 .hunt = panel.hunt});
548 locations_by_name[map_area.locations.back().ap_location_name] = { 566 locations_by_name[location_name] = {area_id,
549 area_id, map_area.locations.size() - 1}; 567 map_area.locations.size() - 1};
550 } 568 }
551 569
552 for (int door_id : door_definition_order_) { 570 for (int door_id : door_definition_order_) {
diff --git a/src/game_data.h b/src/game_data.h index cd09627..f3edaa2 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;
<destination>{3899767b-37bf-41fc-b32f-2c9e83f7b987}</destination> </relationship> </object> <object class="MixerBusPanner" id="{f18af2ec-6258-440a-95a9-f10cbe2e26d9}"/> <object class="SingleSound" id="{aca51545-9374-4735-a7ab-56bd7f41d5af}"> <property name="length"> <value>0.27560090702947848</value> </property> <relationship name="audioFile"> <destination>{e4ee2376-d790-4e2c-8a64-9c08953d0f04}</destination> </relationship> </object> <object class="EventMixerGroup" id="{21bae33a-352a-45ad-9322-aa298bafb005}"> <property name="volume"> <value>-14.5</value> </property> <property name="name"> <value>Audio 1</value> </property> <relationship name="effectChain"> <destination>{883828c9-5226-49e9-98f6-4258eebef55b}</destination> </relationship> <relationship name="panner"> <destination>{468091c0-d1e2-4b3d-916e-acb6eb3674f5}</destination> </relationship> <relationship name="output"> <destination>{35e8cb8d-f400-4eef-9028-974cd2749cf1}</destination> </relationship> </object> <object class="MixerBusEffectChain" id="{ba0b9d9a-b2f1-4e56-95ed-1f81b82e4410}"> <relationship name="effects"> <destination>{2af00a65-0814-4bff-9f1f-23c4dbf60ac9}</destination> <destination>{b14ea1a4-53ac-494a-a9f6-7ea6722914c5}</destination> </relationship> </object> <object class="MixerBusPanner" id="{ff8ef233-315d-46e1-ab83-d06a727b8f41}"/> <object class="MixerBusFader" id="{3899767b-37bf-41fc-b32f-2c9e83f7b987}"/> <object class="MixerBusEffectChain" id="{883828c9-5226-49e9-98f6-4258eebef55b}"> <relationship name="effects"> <destination>{93d6a568-d5b1-4f8c-ae1f-bd7049024b09}</destination> </relationship> </object> <object class="MixerBusPanner" id="{468091c0-d1e2-4b3d-916e-acb6eb3674f5}"/> <object class="MixerBusFader" id="{2af00a65-0814-4bff-9f1f-23c4dbf60ac9}"/> <object class="SpatialiserEffect" id="{b14ea1a4-53ac-494a-a9f6-7ea6722914c5}"/> <object class="MixerBusFader" id="{93d6a568-d5b1-4f8c-ae1f-bd7049024b09}"/> </objects>