diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-05-29 12:56:29 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-05-29 12:56:29 -0400 |
| commit | 13d2a129f6972e6e752da9c9cb686a63d5550517 (patch) | |
| tree | ea0cfe2197c25732dd0d4d0f0e37717fd977792f /src/area_popup.cpp | |
| parent | d3e2d9518403eb89eb150fa2158966c3483d5339 (diff) | |
| download | lingo-ap-tracker-13d2a129f6972e6e752da9c9cb686a63d5550517.tar.gz lingo-ap-tracker-13d2a129f6972e6e752da9c9cb686a63d5550517.tar.bz2 lingo-ap-tracker-13d2a129f6972e6e752da9c9cb686a63d5550517.zip | |
Show unchecked paintings
Diffstat (limited to 'src/area_popup.cpp')
| -rw-r--r-- | src/area_popup.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
| diff --git a/src/area_popup.cpp b/src/area_popup.cpp index 6e70315..b5c1ccb 100644 --- a/src/area_popup.cpp +++ b/src/area_popup.cpp | |||
| @@ -65,6 +65,18 @@ void AreaPopup::UpdateIndicators() { | |||
| 65 | } | 65 | } |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | if (AP_IsPaintingShuffle()) { | ||
| 69 | for (const PaintingExit& painting : map_area.paintings) { | ||
| 70 | wxSize item_extent = mem_dc.GetTextExtent(painting.id); | ||
| 71 | int item_height = std::max(32, item_extent.GetHeight()) + 10; | ||
| 72 | acc_height += item_height; | ||
| 73 | |||
| 74 | if (item_extent.GetWidth() > col_width) { | ||
| 75 | col_width = item_extent.GetWidth(); | ||
| 76 | } | ||
| 77 | } | ||
| 78 | } | ||
| 79 | |||
| 68 | int item_width = col_width + 10 + 32; | 80 | int item_width = col_width + 10 + 32; |
| 69 | int full_width = std::max(header_extent.GetWidth(), item_width) + 20; | 81 | int full_width = std::max(header_extent.GetWidth(), item_width) + 20; |
| 70 | 82 | ||
| @@ -109,6 +121,26 @@ void AreaPopup::UpdateIndicators() { | |||
| 109 | 121 | ||
| 110 | cur_height += 10 + 32; | 122 | cur_height += 10 + 32; |
| 111 | } | 123 | } |
| 124 | |||
| 125 | if (AP_IsPaintingShuffle()) { | ||
| 126 | for (const PaintingExit& painting : map_area.paintings) { | ||
| 127 | bool checked = AP_IsPaintingChecked(painting.id); | ||
| 128 | wxBitmap* eye_ptr = checked ? &checked_eye_ : &unchecked_eye_; | ||
| 129 | |||
| 130 | mem_dc.DrawBitmap(*eye_ptr, {10, cur_height}); | ||
| 131 | |||
| 132 | bool reachable = painting.door ? IsDoorOpen(*painting.door) : true; | ||
| 133 | const wxColour* text_color = reachable ? wxWHITE : wxRED; | ||
| 134 | mem_dc.SetTextForeground(*text_color); | ||
| 135 | |||
| 136 | wxSize item_extent = mem_dc.GetTextExtent(painting.id); | ||
| 137 | mem_dc.DrawText(painting.id, | ||
| 138 | {10 + 32 + 10, | ||
| 139 | cur_height + (32 - mem_dc.GetFontMetrics().height) / 2}); | ||
| 140 | |||
| 141 | cur_height += 10 + 32; | ||
| 142 | } | ||
| 143 | } | ||
| 112 | } | 144 | } |
| 113 | 145 | ||
| 114 | void AreaPopup::OnPaint(wxPaintEvent& event) { | 146 | void AreaPopup::OnPaint(wxPaintEvent& event) { |
