From 8c5b719469bc61e33a451d9b3aeb66c7b0a6d68e Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 19 Jul 2024 03:51:23 -0400 Subject: Added savedata analyzer --- src/area_popup.cpp | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'src/area_popup.cpp') 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 @@ #include +#include + #include "ap_state.h" #include "game_data.h" #include "global.h" #include "tracker_config.h" +#include "tracker_panel.h" #include "tracker_state.h" AreaPopup::AreaPopup(wxWindow* parent, int area_id) @@ -43,15 +46,23 @@ void AreaPopup::UpdateIndicators() { mem_dc.SetFont(GetFont()); + TrackerPanel* tracker_panel = dynamic_cast(GetParent()); + std::vector real_locations; for (int section_id = 0; section_id < map_area.locations.size(); section_id++) { const Location& location = map_area.locations.at(section_id); - if (!AP_IsLocationVisible(location.classification) && - !(location.hunt && GetTrackerConfig().show_hunt_panels)) { - continue; + if (tracker_panel->IsPanelsMode()) { + if (!location.panel) { + continue; + } + } else { + if (!AP_IsLocationVisible(location.classification) && + !(location.hunt && GetTrackerConfig().show_hunt_panels)) { + continue; + } } real_locations.push_back(section_id); @@ -65,7 +76,7 @@ void AreaPopup::UpdateIndicators() { } } - if (AP_IsPaintingShuffle()) { + if (AP_IsPaintingShuffle() && !tracker_panel->IsPanelsMode()) { for (int painting_id : map_area.paintings) { const PaintingExit& painting = GD_GetPaintingExit(painting_id); wxSize item_extent = mem_dc.GetTextExtent(painting.internal_id); // TODO: Replace with a friendly name. @@ -102,10 +113,21 @@ void AreaPopup::UpdateIndicators() { for (int section_id : real_locations) { const Location& location = map_area.locations.at(section_id); - bool checked = - AP_HasCheckedGameLocation(location.ap_location_id) || - (location.hunt && AP_HasCheckedHuntPanel(location.ap_location_id)) || - (IsLocationWinCondition(location) && AP_HasReachedGoal()); + bool checked = false; + if (IsLocationWinCondition(location)) { + checked = AP_HasReachedGoal(); + } else if (tracker_panel->IsPanelsMode()) { + checked = location.panel && std::any_of( + location.panels.begin(), location.panels.end(), + [tracker_panel](int panel_id) { + const Panel& panel = GD_GetPanel(panel_id); + return tracker_panel->GetSolvedPanels().contains(panel.nodepath); + }); + } else { + checked = + AP_HasCheckedGameLocation(location.ap_location_id) || + (location.hunt && AP_HasCheckedHuntPanel(location.ap_location_id)); + } wxBitmap* eye_ptr = checked ? &checked_eye_ : &unchecked_eye_; @@ -123,7 +145,7 @@ void AreaPopup::UpdateIndicators() { cur_height += 10 + 32; } - if (AP_IsPaintingShuffle()) { + if (AP_IsPaintingShuffle() && !tracker_panel->IsPanelsMode()) { for (int painting_id : map_area.paintings) { const PaintingExit& painting = GD_GetPaintingExit(painting_id); -- cgit 1.4.1