about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-05-14 12:07:31 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-05-14 12:07:31 -0400
commitdff1d7382f2af91e50561bfdb9eb83773ac7c010 (patch)
tree87617a4ef68acc6a18f54cbab970bb107137be6f /src
parent7f4b6b4f0cb276a7e0868c7e97d862b1feb468d3 (diff)
downloadlingo-ap-tracker-dff1d7382f2af91e50561bfdb9eb83773ac7c010.tar.gz
lingo-ap-tracker-dff1d7382f2af91e50561bfdb9eb83773ac7c010.tar.bz2
lingo-ap-tracker-dff1d7382f2af91e50561bfdb9eb83773ac7c010.zip
Hide vanilla paintings that go nowhere
There's some shading stuff for painting shuffle owls but that's not anything at the moment.
Diffstat (limited to 'src')
-rw-r--r--src/subway_map.cpp53
1 files changed, 44 insertions, 9 deletions
diff --git a/src/subway_map.cpp b/src/subway_map.cpp index a03f0d8..d331b7d 100644 --- a/src/subway_map.cpp +++ b/src/subway_map.cpp
@@ -10,6 +10,7 @@
10#include "tracker_state.h" 10#include "tracker_state.h"
11 11
12constexpr int AREA_ACTUAL_SIZE = 21; 12constexpr int AREA_ACTUAL_SIZE = 21;
13constexpr int OWL_ACTUAL_SIZE = 32;
13 14
14enum class ItemDrawType { 15enum class ItemDrawType {
15 kNone, 16 kNone,
@@ -230,17 +231,10 @@ void SubwayMap::Redraw() {
230 wxMemoryDC dc; 231 wxMemoryDC dc;
231 dc.SelectObject(rendered_); 232 dc.SelectObject(rendered_);
232 233
233 int real_area_size =
234 render_width_ * AREA_ACTUAL_SIZE / image_size.GetWidth();
235 if (real_area_size == 0) {
236 real_area_size = 1;
237 }
238 wxBitmap owl_bitmap = wxBitmap(owl_image_.Scale(
239 real_area_size * 1.25, real_area_size * 1.25, wxIMAGE_QUALITY_BILINEAR));
240
241 for (const SubwayItem &subway_item : GD_GetSubwayItems()) { 234 for (const SubwayItem &subway_item : GD_GetSubwayItems()) {
242 ItemDrawType draw_type = ItemDrawType::kNone; 235 ItemDrawType draw_type = ItemDrawType::kNone;
243 const wxBrush *brush_color = wxGREY_BRUSH; 236 const wxBrush *brush_color = wxGREY_BRUSH;
237 std::optional<wxColour> shade_color;
244 238
245 if (subway_item.door) { 239 if (subway_item.door) {
246 draw_type = ItemDrawType::kBox; 240 draw_type = ItemDrawType::kBox;
@@ -255,7 +249,37 @@ void SubwayMap::Redraw() {
255 brush_color = wxRED_BRUSH; 249 brush_color = wxRED_BRUSH;
256 } 250 }
257 } else if (!subway_item.paintings.empty()) { 251 } else if (!subway_item.paintings.empty()) {
258 draw_type = ItemDrawType::kOwl; 252 if (AP_IsPaintingShuffle()) {
253 bool has_checked_painting = false;
254 bool has_unchecked_painting = false;
255 bool has_mapped_painting = false;
256
257 for (const std::string &painting_id : subway_item.paintings) {
258 if (checked_paintings_.count(painting_id)) {
259 has_checked_painting = true;
260
261 if (AP_GetPaintingMapping().count(painting_id)) {
262 has_mapped_painting = true;
263 }
264 } else {
265 has_unchecked_painting = true;
266 }
267 }
268
269 if (has_unchecked_painting || has_mapped_painting) {
270 draw_type = ItemDrawType::kOwl;
271
272 if (has_unchecked_painting) {
273 if (has_checked_painting) {
274 shade_color = wxColour(255, 255, 0, 100);
275 } else {
276 shade_color = wxColour(100, 100, 100, 100);
277 }
278 }
279 }
280 } else if (!subway_item.tags.empty()) {
281 draw_type = ItemDrawType::kOwl;
282 }
259 } 283 }
260 284
261 int real_area_x = 285 int real_area_x =
@@ -263,12 +287,23 @@ void SubwayMap::Redraw() {
263 int real_area_y = 287 int real_area_y =
264 render_y_ + subway_item.y * render_width_ / image_size.GetWidth(); 288 render_y_ + subway_item.y * render_width_ / image_size.GetWidth();
265 289
290 int real_area_size =
291 render_width_ *
292 (draw_type == ItemDrawType::kOwl ? OWL_ACTUAL_SIZE : AREA_ACTUAL_SIZE) /
293 image_size.GetWidth();
294 if (real_area_size == 0) {
295 real_area_size = 1;
296 }
297
266 if (draw_type == ItemDrawType::kBox) { 298 if (draw_type == ItemDrawType::kBox) {
267 dc.SetPen(*wxThePenList->FindOrCreatePen(*wxBLACK, 1)); 299 dc.SetPen(*wxThePenList->FindOrCreatePen(*wxBLACK, 1));
268 dc.SetBrush(*brush_color); 300 dc.SetBrush(*brush_color);
269 dc.DrawRectangle({real_area_x, real_area_y}, 301 dc.DrawRectangle({real_area_x, real_area_y},
270 {real_area_size, real_area_size}); 302 {real_area_size, real_area_size});
271 } else if (draw_type == ItemDrawType::kOwl) { 303 } else if (draw_type == ItemDrawType::kOwl) {
304 wxBitmap owl_bitmap = wxBitmap(
305 owl_image_.Scale(real_area_size, real_area_size,
306 wxIMAGE_QUALITY_BILINEAR));
272 dc.DrawBitmap(owl_bitmap, {real_area_x, real_area_y}); 307 dc.DrawBitmap(owl_bitmap, {real_area_x, real_area_y});
273 } 308 }
274 } 309 }