From dff1d7382f2af91e50561bfdb9eb83773ac7c010 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 14 May 2024 12:07:31 -0400 Subject: Hide vanilla paintings that go nowhere There's some shading stuff for painting shuffle owls but that's not anything at the moment. --- src/subway_map.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 9 deletions(-) (limited to 'src/subway_map.cpp') 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 @@ #include "tracker_state.h" constexpr int AREA_ACTUAL_SIZE = 21; +constexpr int OWL_ACTUAL_SIZE = 32; enum class ItemDrawType { kNone, @@ -230,17 +231,10 @@ void SubwayMap::Redraw() { wxMemoryDC dc; dc.SelectObject(rendered_); - int real_area_size = - render_width_ * AREA_ACTUAL_SIZE / image_size.GetWidth(); - if (real_area_size == 0) { - real_area_size = 1; - } - wxBitmap owl_bitmap = wxBitmap(owl_image_.Scale( - real_area_size * 1.25, real_area_size * 1.25, wxIMAGE_QUALITY_BILINEAR)); - for (const SubwayItem &subway_item : GD_GetSubwayItems()) { ItemDrawType draw_type = ItemDrawType::kNone; const wxBrush *brush_color = wxGREY_BRUSH; + std::optional shade_color; if (subway_item.door) { draw_type = ItemDrawType::kBox; @@ -255,7 +249,37 @@ void SubwayMap::Redraw() { brush_color = wxRED_BRUSH; } } else if (!subway_item.paintings.empty()) { - draw_type = ItemDrawType::kOwl; + if (AP_IsPaintingShuffle()) { + bool has_checked_painting = false; + bool has_unchecked_painting = false; + bool has_mapped_painting = false; + + for (const std::string &painting_id : subway_item.paintings) { + if (checked_paintings_.count(painting_id)) { + has_checked_painting = true; + + if (AP_GetPaintingMapping().count(painting_id)) { + has_mapped_painting = true; + } + } else { + has_unchecked_painting = true; + } + } + + if (has_unchecked_painting || has_mapped_painting) { + draw_type = ItemDrawType::kOwl; + + if (has_unchecked_painting) { + if (has_checked_painting) { + shade_color = wxColour(255, 255, 0, 100); + } else { + shade_color = wxColour(100, 100, 100, 100); + } + } + } + } else if (!subway_item.tags.empty()) { + draw_type = ItemDrawType::kOwl; + } } int real_area_x = @@ -263,12 +287,23 @@ void SubwayMap::Redraw() { int real_area_y = render_y_ + subway_item.y * render_width_ / image_size.GetWidth(); + int real_area_size = + render_width_ * + (draw_type == ItemDrawType::kOwl ? OWL_ACTUAL_SIZE : AREA_ACTUAL_SIZE) / + image_size.GetWidth(); + if (real_area_size == 0) { + real_area_size = 1; + } + if (draw_type == ItemDrawType::kBox) { dc.SetPen(*wxThePenList->FindOrCreatePen(*wxBLACK, 1)); dc.SetBrush(*brush_color); dc.DrawRectangle({real_area_x, real_area_y}, {real_area_size, real_area_size}); } else if (draw_type == ItemDrawType::kOwl) { + wxBitmap owl_bitmap = wxBitmap( + owl_image_.Scale(real_area_size, real_area_size, + wxIMAGE_QUALITY_BILINEAR)); dc.DrawBitmap(owl_bitmap, {real_area_x, real_area_y}); } } -- cgit 1.4.1