about summary refs log tree commit diff stats
path: root/src/tracker_panel.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-08-25 22:14:51 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-08-25 22:14:51 -0400
commit9bf6a50624284ab7422f56375b3e57c894200faf (patch)
tree9951ee08e5ebbed1363d190b57fa01606e0fbb94 /src/tracker_panel.cpp
parentbaf43ede759f9ff0ca8c71de764e0389469f9ae1 (diff)
downloadlingo-ap-tracker-9bf6a50624284ab7422f56375b3e57c894200faf.tar.gz
lingo-ap-tracker-9bf6a50624284ab7422f56375b3e57c894200faf.tar.bz2
lingo-ap-tracker-9bf6a50624284ab7422f56375b3e57c894200faf.zip
Panelsanity support
Diffstat (limited to 'src/tracker_panel.cpp')
-rw-r--r--src/tracker_panel.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/tracker_panel.cpp b/src/tracker_panel.cpp index 90b8eb9..40d3ced 100644 --- a/src/tracker_panel.cpp +++ b/src/tracker_panel.cpp
@@ -52,9 +52,9 @@ void TrackerPanel::OnPaint(wxPaintEvent &event) {
52 52
53void TrackerPanel::OnMouseMove(wxMouseEvent &event) { 53void TrackerPanel::OnMouseMove(wxMouseEvent &event) {
54 for (AreaIndicator &area : areas_) { 54 for (AreaIndicator &area : areas_) {
55 if (area.active && 55 if (area.active && area.real_x1 <= event.GetX() &&
56 area.real_x1 <= event.GetX() && event.GetX() < area.real_x2 && 56 event.GetX() < area.real_x2 && area.real_y1 <= event.GetY() &&
57 area.real_y1 <= event.GetY() && event.GetY() < area.real_y2) { 57 event.GetY() < area.real_y2) {
58 area.popup->Show(); 58 area.popup->Show();
59 } else { 59 } else {
60 area.popup->Hide(); 60 area.popup->Hide();
@@ -95,7 +95,7 @@ void TrackerPanel::Redraw() {
95 const wxBrush *brush_color = wxGREY_BRUSH; 95 const wxBrush *brush_color = wxGREY_BRUSH;
96 96
97 const MapArea &map_area = GD_GetMapArea(area.area_id); 97 const MapArea &map_area = GD_GetMapArea(area.area_id);
98 if (map_area.exclude_reduce && AP_IsReduceChecks()) { 98 if (!AP_IsLocationVisible(map_area.classification)) {
99 area.active = false; 99 area.active = false;
100 continue; 100 continue;
101 } else { 101 } else {
@@ -106,7 +106,9 @@ void TrackerPanel::Redraw() {
106 bool has_unreachable_unchecked = false; 106 bool has_unreachable_unchecked = false;
107 for (int section_id = 0; section_id < map_area.locations.size(); 107 for (int section_id = 0; section_id < map_area.locations.size();
108 section_id++) { 108 section_id++) {
109 if (!AP_HasCheckedGameLocation(area.area_id, section_id)) { 109 if (AP_IsLocationVisible(
110 map_area.locations.at(section_id).classification) &&
111 !AP_HasCheckedGameLocation(area.area_id, section_id)) {
110 if (IsLocationReachable(area.area_id, section_id)) { 112 if (IsLocationReachable(area.area_id, section_id)) {
111 has_reachable_unchecked = true; 113 has_reachable_unchecked = true;
112 } else { 114 } else {
@@ -146,6 +148,10 @@ void TrackerPanel::Redraw() {
146 final_x + map_area.map_x * final_width / image_size.GetWidth(); 148 final_x + map_area.map_x * final_width / image_size.GetWidth();
147 int popup_y = 149 int popup_y =
148 final_y + map_area.map_y * final_width / image_size.GetWidth(); 150 final_y + map_area.map_y * final_width / image_size.GetWidth();
151
152 area.popup->SetMaxSize(panel_size);
153 area.popup->GetSizer()->Fit(area.popup);
154
149 if (popup_x + area.popup->GetSize().GetWidth() > panel_size.GetWidth()) { 155 if (popup_x + area.popup->GetSize().GetWidth() > panel_size.GetWidth()) {
150 popup_x = panel_size.GetWidth() - area.popup->GetSize().GetWidth(); 156 popup_x = panel_size.GetWidth() - area.popup->GetSize().GetWidth();
151 } 157 }