about summary refs log tree commit diff stats
path: root/src/area_popup.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-07-19 03:51:23 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-07-19 03:51:23 -0400
commit8c5b719469bc61e33a451d9b3aeb66c7b0a6d68e (patch)
tree1f452dc8a601630a1fd50f4ee3f8ea25aed7b315 /src/area_popup.cpp
parentb80e1b888a7203312119e5bfad9e26c2c17d9b9f (diff)
downloadlingo-ap-tracker-8c5b719469bc61e33a451d9b3aeb66c7b0a6d68e.tar.gz
lingo-ap-tracker-8c5b719469bc61e33a451d9b3aeb66c7b0a6d68e.tar.bz2
lingo-ap-tracker-8c5b719469bc61e33a451d9b3aeb66c7b0a6d68e.zip
Added savedata analyzer
Diffstat (limited to 'src/area_popup.cpp')
-rw-r--r--src/area_popup.cpp40
1 files changed, 31 insertions, 9 deletions
diff --git a/src/area_popup.cpp b/src/area_popup.cpp index ca3b352..b18ba62 100644 --- a/src/area_popup.cpp +++ b/src/area_popup.cpp
@@ -2,10 +2,13 @@
2 2
3#include <wx/dcbuffer.h> 3#include <wx/dcbuffer.h>
4 4
5#include <algorithm>
6
5#include "ap_state.h" 7#include "ap_state.h"
6#include "game_data.h" 8#include "game_data.h"
7#include "global.h" 9#include "global.h"
8#include "tracker_config.h" 10#include "tracker_config.h"
11#include "tracker_panel.h"
9#include "tracker_state.h" 12#include "tracker_state.h"
10 13
11AreaPopup::AreaPopup(wxWindow* parent, int area_id) 14AreaPopup::AreaPopup(wxWindow* parent, int area_id)
@@ -43,15 +46,23 @@ void AreaPopup::UpdateIndicators() {
43 46
44 mem_dc.SetFont(GetFont()); 47 mem_dc.SetFont(GetFont());
45 48
49 TrackerPanel* tracker_panel = dynamic_cast<TrackerPanel*>(GetParent());
50
46 std::vector<int> real_locations; 51 std::vector<int> real_locations;
47 52
48 for (int section_id = 0; section_id < map_area.locations.size(); 53 for (int section_id = 0; section_id < map_area.locations.size();
49 section_id++) { 54 section_id++) {
50 const Location& location = map_area.locations.at(section_id); 55 const Location& location = map_area.locations.at(section_id);
51 56
52 if (!AP_IsLocationVisible(location.classification) && 57 if (tracker_panel->IsPanelsMode()) {
53 !(location.hunt && GetTrackerConfig().show_hunt_panels)) { 58 if (!location.panel) {
54 continue; 59 continue;
60 }
61 } else {
62 if (!AP_IsLocationVisible(location.classification) &&
63 !(location.hunt && GetTrackerConfig().show_hunt_panels)) {
64 continue;
65 }
55 } 66 }
56 67
57 real_locations.push_back(section_id); 68 real_locations.push_back(section_id);
@@ -65,7 +76,7 @@ void AreaPopup::UpdateIndicators() {
65 } 76 }
66 } 77 }
67 78
68 if (AP_IsPaintingShuffle()) { 79 if (AP_IsPaintingShuffle() && !tracker_panel->IsPanelsMode()) {
69 for (int painting_id : map_area.paintings) { 80 for (int painting_id : map_area.paintings) {
70 const PaintingExit& painting = GD_GetPaintingExit(painting_id); 81 const PaintingExit& painting = GD_GetPaintingExit(painting_id);
71 wxSize item_extent = mem_dc.GetTextExtent(painting.internal_id); // TODO: Replace with a friendly name. 82 wxSize item_extent = mem_dc.GetTextExtent(painting.internal_id); // TODO: Replace with a friendly name.
@@ -102,10 +113,21 @@ void AreaPopup::UpdateIndicators() {
102 for (int section_id : real_locations) { 113 for (int section_id : real_locations) {
103 const Location& location = map_area.locations.at(section_id); 114 const Location& location = map_area.locations.at(section_id);
104 115
105 bool checked = 116 bool checked = false;
106 AP_HasCheckedGameLocation(location.ap_location_id) || 117 if (IsLocationWinCondition(location)) {
107 (location.hunt && AP_HasCheckedHuntPanel(location.ap_location_id)) || 118 checked = AP_HasReachedGoal();
108 (IsLocationWinCondition(location) && AP_HasReachedGoal()); 119 } else if (tracker_panel->IsPanelsMode()) {
120 checked = location.panel && std::any_of(
121 location.panels.begin(), location.panels.end(),
122 [tracker_panel](int panel_id) {
123 const Panel& panel = GD_GetPanel(panel_id);
124 return tracker_panel->GetSolvedPanels().contains(panel.nodepath);
125 });
126 } else {
127 checked =
128 AP_HasCheckedGameLocation(location.ap_location_id) ||
129 (location.hunt && AP_HasCheckedHuntPanel(location.ap_location_id));
130 }
109 131
110 wxBitmap* eye_ptr = checked ? &checked_eye_ : &unchecked_eye_; 132 wxBitmap* eye_ptr = checked ? &checked_eye_ : &unchecked_eye_;
111 133
@@ -123,7 +145,7 @@ void AreaPopup::UpdateIndicators() {
123 cur_height += 10 + 32; 145 cur_height += 10 + 32;
124 } 146 }
125 147
126 if (AP_IsPaintingShuffle()) { 148 if (AP_IsPaintingShuffle() && !tracker_panel->IsPanelsMode()) {
127 for (int painting_id : map_area.paintings) { 149 for (int painting_id : map_area.paintings) {
128 const PaintingExit& painting = GD_GetPaintingExit(painting_id); 150 const PaintingExit& painting = GD_GetPaintingExit(painting_id);
129 151