From 3151ac6274e796f54f2d9269186f1fd2e69f90c3 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 15 May 2024 12:11:00 -0400 Subject: Get checked paintings from server --- src/subway_map.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/subway_map.cpp') diff --git a/src/subway_map.cpp b/src/subway_map.cpp index 99638aa..460532c 100644 --- a/src/subway_map.cpp +++ b/src/subway_map.cpp @@ -82,17 +82,21 @@ void SubwayMap::OnConnect() { } void SubwayMap::UpdateIndicators() { - Redraw(); -} - -void SubwayMap::UpdatePainting(std::string from_painting_id, - std::optional to_painting_id) { - checked_paintings_.insert(from_painting_id); - - if (to_painting_id) { - networks_.AddLink(GD_GetSubwayItemForPainting(from_painting_id), - GD_GetSubwayItemForPainting(*to_painting_id)); + if (AP_IsPaintingShuffle()) { + for (const std::string &painting_id : AP_GetCheckedPaintings()) { + if (!checked_paintings_.count(painting_id)) { + checked_paintings_.insert(painting_id); + + if (AP_GetPaintingMapping().count(painting_id)) { + networks_.AddLink(GD_GetSubwayItemForPainting(painting_id), + GD_GetSubwayItemForPainting( + AP_GetPaintingMapping().at(painting_id))); + } + } + } } + + Redraw(); } void SubwayMap::UpdateSunwarp(SubwaySunwarp from_sunwarp, -- cgit 1.4.1