diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-06-09 22:43:20 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-06-09 22:43:20 -0400 |
| commit | 475b7a38f66071ad5713f6f00a49c4e1399e0613 (patch) | |
| tree | 4dcb76d5bb9e1dbabe19dcbd0cc9676c31f715e6 /src/tracker_panel.cpp | |
| parent | 829bb6ba7fdbef5c4e6fb9e4eabc0c2f962325ae (diff) | |
| parent | 14d075e02007aeb53dbadd6c629564ee467cd7b2 (diff) | |
| download | lingo-ap-tracker-475b7a38f66071ad5713f6f00a49c4e1399e0613.tar.gz lingo-ap-tracker-475b7a38f66071ad5713f6f00a49c4e1399e0613.tar.bz2 lingo-ap-tracker-475b7a38f66071ad5713f6f00a49c4e1399e0613.zip | |
Merge branch 'main' into panels
Diffstat (limited to 'src/tracker_panel.cpp')
| -rw-r--r-- | src/tracker_panel.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
| diff --git a/src/tracker_panel.cpp b/src/tracker_panel.cpp index 5f9f8ea..d60c1b6 100644 --- a/src/tracker_panel.cpp +++ b/src/tracker_panel.cpp | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | #include "tracker_panel.h" | 1 | #include "tracker_panel.h" |
| 2 | 2 | ||
| 3 | #include <wx/dcbuffer.h> | ||
| 4 | |||
| 3 | #include "ap_state.h" | 5 | #include "ap_state.h" |
| 4 | #include "area_popup.h" | 6 | #include "area_popup.h" |
| 5 | #include "game_data.h" | 7 | #include "game_data.h" |
| @@ -13,6 +15,8 @@ constexpr int AREA_EFFECTIVE_SIZE = AREA_ACTUAL_SIZE + AREA_BORDER_SIZE * 2; | |||
| 13 | constexpr int PLAYER_SIZE = 96; | 15 | constexpr int PLAYER_SIZE = 96; |
| 14 | 16 | ||
| 15 | TrackerPanel::TrackerPanel(wxWindow *parent) : wxPanel(parent, wxID_ANY) { | 17 | TrackerPanel::TrackerPanel(wxWindow *parent) : wxPanel(parent, wxID_ANY) { |
| 18 | SetBackgroundStyle(wxBG_STYLE_PAINT); | ||
| 19 | |||
| 16 | map_image_ = wxImage(GetAbsolutePath("assets/lingo_map.png").c_str(), | 20 | map_image_ = wxImage(GetAbsolutePath("assets/lingo_map.png").c_str(), |
| 17 | wxBITMAP_TYPE_PNG); | 21 | wxBITMAP_TYPE_PNG); |
| 18 | if (!map_image_.IsOk()) { | 22 | if (!map_image_.IsOk()) { |
| @@ -54,7 +58,7 @@ void TrackerPanel::OnPaint(wxPaintEvent &event) { | |||
| 54 | Redraw(); | 58 | Redraw(); |
| 55 | } | 59 | } |
| 56 | 60 | ||
| 57 | wxPaintDC dc(this); | 61 | wxBufferedPaintDC dc(this); |
| 58 | dc.DrawBitmap(rendered_, 0, 0); | 62 | dc.DrawBitmap(rendered_, 0, 0); |
| 59 | 63 | ||
| 60 | if (AP_GetPlayerPosition().has_value()) { | 64 | if (AP_GetPlayerPosition().has_value()) { |
| @@ -139,7 +143,8 @@ void TrackerPanel::Redraw() { | |||
| 139 | for (AreaIndicator &area : areas_) { | 143 | for (AreaIndicator &area : areas_) { |
| 140 | const MapArea &map_area = GD_GetMapArea(area.area_id); | 144 | const MapArea &map_area = GD_GetMapArea(area.area_id); |
| 141 | if (!AP_IsLocationVisible(map_area.classification) && | 145 | if (!AP_IsLocationVisible(map_area.classification) && |
| 142 | !(map_area.hunt && GetTrackerConfig().show_hunt_panels)) { | 146 | !(map_area.hunt && GetTrackerConfig().show_hunt_panels) && |
| 147 | !(AP_IsPaintingShuffle() && !map_area.paintings.empty())) { | ||
| 143 | area.active = false; | 148 | area.active = false; |
| 144 | continue; | 149 | continue; |
| 145 | } else { | 150 | } else { |
| @@ -167,6 +172,21 @@ void TrackerPanel::Redraw() { | |||
| 167 | } | 172 | } |
| 168 | } | 173 | } |
| 169 | 174 | ||
| 175 | if (AP_IsPaintingShuffle()) { | ||
| 176 | for (int painting_id : map_area.paintings) { | ||
| 177 | const PaintingExit &painting = GD_GetPaintingExit(painting_id); | ||
| 178 | if (!AP_IsPaintingChecked(painting.internal_id)) { | ||
| 179 | bool reachable = IsPaintingReachable(painting_id); | ||
| 180 | |||
| 181 | if (reachable) { | ||
| 182 | has_reachable_unchecked = true; | ||
| 183 | } else { | ||
| 184 | has_unreachable_unchecked = true; | ||
| 185 | } | ||
| 186 | } | ||
| 187 | } | ||
| 188 | } | ||
| 189 | |||
| 170 | int real_area_x = final_x + (map_area.map_x - (AREA_EFFECTIVE_SIZE / 2)) * | 190 | int real_area_x = final_x + (map_area.map_x - (AREA_EFFECTIVE_SIZE / 2)) * |
| 171 | final_width / image_size.GetWidth(); | 191 | final_width / image_size.GetWidth(); |
| 172 | int real_area_y = final_y + (map_area.map_y - (AREA_EFFECTIVE_SIZE / 2)) * | 192 | int real_area_y = final_y + (map_area.map_y - (AREA_EFFECTIVE_SIZE / 2)) * |
