From 70f1c629a6e08e0f9c58707f0470e08c6ffeca34 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 2 May 2023 20:14:43 -0400 Subject: Added reachability checking (only no doors rn) --- area_window.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'area_window.cpp') diff --git a/area_window.cpp b/area_window.cpp index ca327b8..fded223 100644 --- a/area_window.cpp +++ b/area_window.cpp @@ -4,6 +4,7 @@ #include "ap_state.h" #include "game_data.h" +#include "tracker_state.h" AreaWindow::AreaWindow(wxWindow* parent, int area_id, AreaPopup* popup) : wxWindow(parent, wxID_ANY), area_id_(area_id), popup_(popup) { @@ -35,16 +36,25 @@ void AreaWindow::Redraw() { const wxBrush* brush_color = wxGREY_BRUSH; const MapArea& map_area = GetGameData().GetMapArea(area_id_); - int unchecked_sections = 0; + bool has_reachable_unchecked = false; + bool has_unreachable_unchecked = false; for (int section_id = 0; section_id < map_area.locations.size(); section_id++) { if (!GetAPState().HasCheckedGameLocation(area_id_, section_id)) { - unchecked_sections++; + if (GetTrackerState().IsLocationReachable(area_id_, section_id)) { + has_reachable_unchecked = true; + } else { + has_unreachable_unchecked = true; + } } } - if (unchecked_sections > 0) { + if (has_reachable_unchecked && has_unreachable_unchecked) { + brush_color = wxYELLOW_BRUSH; + } else if (has_reachable_unchecked) { brush_color = wxGREEN_BRUSH; + } else if (has_unreachable_unchecked) { + brush_color = wxRED_BRUSH; } int actual_border_size = GetSize().GetWidth() * BORDER_SIZE / EFFECTIVE_SIZE; -- cgit 1.4.1