From 8ad881fed6e388f7a254350532ce58552ef47a1d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 11 Mar 2025 17:19:54 -0400 Subject: New subway map paintings --- assets/subway.png | Bin 222481 -> 232357 bytes assets/subway.yaml | 440 ++++++++++++++++++++++++++--------------------------- src/game_data.cpp | 11 +- src/game_data.h | 2 +- src/subway_map.cpp | 134 ++++++++-------- 5 files changed, 298 insertions(+), 289 deletions(-) diff --git a/assets/subway.png b/assets/subway.png index f8f97cd..8128004 100644 Binary files a/assets/subway.png and b/assets/subway.png differ diff --git a/assets/subway.yaml b/assets/subway.yaml index b691304..f90f945 100644 --- a/assets/subway.yaml +++ b/assets/subway.yaml @@ -5,50 +5,46 @@ - pos: [986, 1034] room: Starting Room door: Rhyme Room Entrance -- pos: [990, 956] - special: starting_room_paintings # Early Color Hallways painting is a hardcoded special case - paintings: - - arrows_painting -- pos: [905, 841] +- pos: [996, 964] + special: starting_room_overhead + painting: arrows_painting +- pos: [1044, 1012] + special: early_color_hallways + painting: color_hallways +- pos: [915, 851] room: Hedge Maze door: Painting Shortcut - paintings: - - garden_painting_tower2 + painting: garden_painting_tower2 entrances: - garden_starting -- pos: [1066, 841] +- pos: [1076, 851] room: Courtyard door: Painting Shortcut - paintings: - - flower_painting_8 + painting: flower_painting_8 entrances: - flower_starting -- pos: [905, 895] +- pos: [915, 905] room: The Wondrous (Doorknob) door: Painting Shortcut - paintings: - - symmetry_painting_a_starter + painting: symmetry_painting_a_starter entrances: - symmetry_starting -- pos: [1066, 868] +- pos: [1076, 905] room: Outside The Bold door: Painting Shortcut - paintings: - - pencil_painting6 + painting: pencil_painting6 entrances: - pencil_starting -- pos: [1066, 895] +- pos: [1076, 878] room: Outside The Undeterred door: Painting Shortcut - paintings: - - blueman_painting_3 + painting: blueman_painting_3 entrances: - blueman_starting -- pos: [905, 868] +- pos: [915, 878] room: Outside The Agreeable door: Painting Shortcut - paintings: - - eyes_yellow_painting2 + painting: eyes_yellow_painting2 entrances: - street_starting - pos: [1211, 879] @@ -63,9 +59,8 @@ - pos: [1174, 981] room: Hidden Room door: Rhyme Room Entrance -- pos: [1116, 939] - paintings: - - owl_painting +- pos: [1114, 937] + painting: owl_painting entrances: - owl_hidden - pos: [986, 793] @@ -86,9 +81,8 @@ - pos: [1372, 729] room: Hub Room door: Traveled Entrance -- pos: [1313, 686] - paintings: - - maze_painting +- pos: [1312, 696] + painting: maze_painting exits: - green_owl - green_numbers @@ -105,19 +99,19 @@ - pos: [1276, 820] room: Number Hunt door: Eights -- pos: [1263, 867] - paintings: - - smile_painting_6 +- pos: [1253, 889] + painting: smile_painting_6 entrances: - smiley_deadend - pos: [1013, 1087] sunwarp: dots: 6 type: final -- pos: [938, 1002] +- pos: [948, 1012] room: Pilgrim Antechamber door: Sun Painting special: sun_painting + painting: pilgrim_painting2 - pos: [1053, 1090] invisible: true special: sun_painting_exit @@ -151,9 +145,8 @@ - pos: [509, 434] room: Crossroads door: Roof Access -- pos: [756, 400] - paintings: - - smile_painting_4 +- pos: [712, 514] + painting: smile_painting_4 entrances: - smiley_crossroads - pos: [878, 509] @@ -172,9 +165,8 @@ - pos: [954, 247] room: Amen Name Area door: Exit -- pos: [954, 222] - paintings: - - west_afar +- pos: [985, 235] + painting: west_afar - pos: [986, 697] room: The Tenacious door: Shortcut to Hub Room @@ -205,9 +197,8 @@ - pos: [1216, 525] room: Outside The Agreeable door: Agreeable Entrance -- pos: [1138, 287] - paintings: - - eyes_yellow_painting +- pos: [1156, 299] + painting: eyes_yellow_painting exits: - street_starting - pos: [1088, 385] @@ -217,9 +208,8 @@ - pos: [1195, 445] room: Compass Room door: Lookout Entrance -- pos: [1214, 457] - paintings: - - pencil_painting7 +- pos: [1226, 481] + painting: pencil_painting7 entrances: - pencil_compass - pos: [1196, 417] @@ -248,9 +238,8 @@ - pos: [1714, 434] room: Hedge Maze door: Observant Entrance -- pos: [1477, 343] - paintings: - - garden_painting_tower +- pos: [1526, 401] + painting: garden_painting_tower exits: - garden_starting - pos: [1565, 311] @@ -268,19 +257,16 @@ - pos: [1694, 659] room: The Incomparable door: Eight Door -- pos: [1784, 569] - paintings: - - crown_painting +- pos: [1799, 583] + painting: crown_painting exits: - crown_tower6 -- pos: [1653, 717] - paintings: - - eight_painting2 +- pos: [1644, 685] + painting: eight_painting2 entrances: - eight_alcove -- pos: [1653, 662] - paintings: - - eight_painting +- pos: [1660, 664] + painting: eight_painting exits: - eight_alcove - pos: [697, 1471] @@ -383,10 +369,10 @@ - pos: [1173, 1248] room: Orange Tower Third Floor door: Rhyme Room Entrance -- pos: [1270, 1231] - paintings: - - arrows_painting_6 - - flower_painting_5 +- pos: [1274, 1253] + painting: arrows_painting_6 +- pos: [1293, 1234] + painting: flower_painting_5 - pos: [1216, 1216] sunwarp: dots: 2 @@ -405,9 +391,8 @@ - pos: [878, 155] room: Number Hunt door: Eights -- pos: [844, 134] - paintings: - - smile_painting_8 +- pos: [862, 144] + painting: smile_painting_8 entrances: - smiley_hotcrusts - pos: [798, 155] @@ -420,59 +405,65 @@ - pos: [723, 953] room: Orange Tower Fifth Floor door: Welcome Back -- pos: [683, 944] - paintings: - - east_afar -- pos: [548, 1221] - paintings: - - hi_solved_painting3 -- pos: [1574, 1425] - paintings: - - hi_solved_painting2 -- pos: [411, 1186] - paintings: - - arrows_painting_10 - - owl_painting_3 - - clock_painting - - scenery_painting_5d_2 - - symmetry_painting_b_7 - - panda_painting_2 - - crown_painting2 - - colors_painting2 - - cherry_painting2 - - hi_solved_painting +- pos: [690, 937] + painting: east_afar +- pos: [535, 1205] + painting: hi_solved_painting3 +- pos: [1574, 1424] + painting: hi_solved_painting2 +- pos: [316, 1269] + painting: arrows_painting_10 +- pos: [332, 1253] + painting: scenery_painting_5d_2 +- pos: [347, 1237] + painting: panda_painting_2 entrances: - - owl_tower6 - - clock_tower6 - panda_tower6 - - crown_tower6 - - apple_tower6 +- pos: [363, 1221] + painting: colors_painting2 +- pos: [380, 1205] + painting: clock_painting + entrances: + - clock_tower6 +- pos: [396, 1221] + painting: hi_solved_painting exits: - hi_scientific -- pos: [349, 1124] - paintings: - - map_painting2 +- pos: [380, 1237] + painting: crown_painting2 + entrances: + - crown_tower6 +- pos: [363, 1253] + painting: owl_painting_3 + entrances: + - owl_tower6 +- pos: [347, 1269] + painting: symmetry_painting_b_7 +- pos: [332, 1285] + painting: cherry_painting2 + entrances: + - apple_tower6 +- pos: [360, 1135] + # TODO: there isn't really a spot for this one + painting: map_painting2 - pos: [436, 1159] room: Orange Tower Seventh Floor door: Mastery -- pos: [544, 1159] - paintings: - - arrows_painting_11 +- pos: [535, 1146] + painting: arrows_painting_11 - pos: [498, 284] room: Courtyard door: Green Barrier -- pos: [556, 233] - paintings: - - flower_painting_7 +- pos: [589, 230] + painting: flower_painting_7 exits: - flower_starting - flower_arrow - pos: [600, 332] room: Number Hunt door: Nines -- pos: [579, 350] - paintings: - - blueman_painting +- pos: [589, 369] + painting: blueman_painting entrances: - blueman_courtyard - pos: [530, 310] @@ -508,9 +499,8 @@ - pos: [922, 107] room: The Colorful (Gray) door: Progress Door -- pos: [967, 107] - paintings: - - arrows_painting_12 +- pos: [969, 96] + painting: arrows_painting_12 - pos: [878, 954] room: Welcome Back Area door: Shortcut to Starting Room @@ -555,17 +545,19 @@ - pos: [1478, 498] room: Owl Hallway door: Shortcut to Hedge Maze -- pos: [1480, 551] - paintings: - - arrows_painting_8 - - maze_painting_2 - - owl_painting_2 - - clock_painting_4 +- pos: [1467, 535] + painting: arrows_painting_8 +- pos: [1467, 562] + painting: maze_painting_2 entrances: - green_owl +- pos: [1510, 535] + painting: owl_painting_2 exits: - owl_hidden - owl_tower6 +- pos: [1510, 562] + painting: clock_painting_4 - pos: [1478, 938] room: Number Hunt door: Sevens @@ -605,15 +597,14 @@ - pos: [1580, 729] room: The Incomparable door: "Eight Door (Outside The Initiated)" -- pos: [1530, 938] - paintings: - - clock_painting_5 +- pos: [1548, 948] + painting: clock_painting_5 entrances: - clock_initiated -- pos: [1546, 938] - paintings: - - clock_painting_2 - - arrows_painting_2 +- pos: [1575, 969] + painting: arrows_painting_2 +- pos: [1575, 926] + painting: clock_painting_2 exits: - clock_tower6 - clock_initiated @@ -621,9 +612,8 @@ sunwarp: dots: 3 type: exit -- pos: [1444, 896] - paintings: - - smile_painting_1 +- pos: [1462, 915] + painting: smile_painting_1 entrances: - smiley_initiated - pos: [1430, 691] @@ -668,14 +658,14 @@ - pos: [1468, 1377] room: Outside The Bold door: Bold Entrance -- pos: [1425, 1358] - paintings: - - pencil_painting2 - - north_missing2 +- pos: [1446, 1344] + painting: pencil_painting2 exits: - pencil_compass - pencil_starting - pencil_directional +- pos: [1580, 1344] + painting: north_missing2 - pos: [1334, 1419] room: Outside The Bold door: Steady Entrance @@ -697,17 +687,15 @@ - pos: [242, 1071] room: Outside The Undeterred door: Undeterred Entrance -- pos: [60, 1017] - paintings: - - blueman_painting_2 +- pos: [149, 937] + painting: blueman_painting_2 exits: - blueman_courtyard - blueman_starting -- pos: [402, 1012] +- pos: [412, 1017] room: Outside The Undeterred door: Green Painting - paintings: - - maze_painting_3 + painting: maze_painting_3 entrances: - green_numbers - pos: [134, 1007] @@ -738,11 +726,10 @@ - pos: [525, 1002] room: Number Hunt door: Door to Directional Gallery -- pos: [659, 1014] +- pos: [572, 1017] room: Number Hunt door: Eights - paintings: - - smile_painting_5 + painting: smile_painting_5 entrances: - smiley_numbers - pos: [557, 953] @@ -766,31 +753,26 @@ - pos: [242, 980] room: Directional Gallery door: Shortcut to The Undeterred -- pos: [351, 927] - paintings: - - boxes_painting +- pos: [364, 942] + painting: boxes_painting entrances: - lattice_directional -- pos: [272, 927] - paintings: - - smile_painting_7 +- pos: [278, 942] + painting: smile_painting_7 entrances: - smiley_directional -- pos: [214, 822] - paintings: - - cherry_painting +- pos: [278, 803] + painting: cherry_painting entrances: - apple_directional -- pos: [266, 735] +- pos: [262, 573] room: Number Hunt door: Sixes - paintings: - - pencil_painting3 + painting: pencil_painting3 entrances: - pencil_directional -- pos: [215, 735] - paintings: - - flower_painting_4 +- pos: [278, 685] + painting: flower_painting_4 - pos: [626, 851] sunwarp: dots: 6 @@ -798,21 +780,18 @@ - pos: [1334, 1377] room: Color Hunt door: Shortcut to The Steady -- pos: [1280, 1375] - paintings: - - arrows_painting_7 -- pos: [1233, 1321] +- pos: [1312, 1333] + painting: arrows_painting_7 +- pos: [1226, 1333] room: Outside The Initiated door: Entrance - paintings: - - fruitbowl_painting3 + painting: fruitbowl_painting3 - pos: [1260, 1323] sunwarp: dots: 5 type: exit -- pos: [1154, 1332] - paintings: - - colors_painting +- pos: [1092, 1333] + painting: colors_painting - pos: [1640, 1260] room: The Bearer door: Backside Door @@ -825,10 +804,10 @@ - pos: [1388, 1152] room: Bearer Side Area door: Shortcut to Tower -- pos: [1273, 1442] - paintings: - - pencil_painting5 - - pencil_painting4 +- pos: [1264, 1430] + painting: pencil_painting5 +- pos: [1291, 1430] + painting: pencil_painting4 - pos: [1355, 1092] room: Knight Night (Final) door: Exit @@ -839,9 +818,8 @@ # Complex case, because this is also blocked by Knight Night (Final) - Exit room: Number Hunt door: Sevens -- pos: [1653, 101] - paintings: - - smile_painting_9 +- pos: [1687, 117] + painting: smile_painting_9 exits: - smiley_crossroads - smiley_deadend @@ -857,26 +835,23 @@ - pos: [1711, 140] entrances: - undeterred_artistic -- pos: [1653, 169] - paintings: - - panda_painting_3 +- pos: [1687, 224] + painting: panda_painting_3 exits: - panda_tower6 - panda_hallway - pos: [1731, 215] room: The Artistic (Panda) door: Door to Lattice -- pos: [1761, 169] - paintings: - - boxes_painting2 +- pos: [1794, 224] + painting: boxes_painting2 exits: - lattice_directional - pos: [1785, 161] room: The Artistic (Lattice) door: Door to Apple -- pos: [1761, 101] - paintings: - - cherry_painting3 +- pos: [1794, 117] + painting: cherry_painting3 exits: - apple_tower6 - apple_directional @@ -886,50 +861,75 @@ - pos: [370, 563] room: Number Hunt door: Eights -- pos: [411, 685] - paintings: - - eye_painting_2 - - smile_painting_2 +- pos: [637, 605] + painting: eye_painting + entrances: + - crossroads_eyewall +- pos: [610, 605] + exits: + - crossroads_eyewall +- pos: [417, 573] + painting: eye_painting_2 + exits: + - crossroads_eyewall +- pos: [342, 573] + painting: smile_painting_2 entrances: - smiley_theysee - pos: [311, 750] room: The Eyes They See door: Exit -- pos: [334, 798] - paintings: - - arrows_painting_5 +- pos: [348, 803] + painting: arrows_painting_5 - pos: [370, 751] room: Outside The Wondrous door: Wondrous Entrance -- pos: [367, 752] - paintings: - - symmetry_painting_a_1 - - symmetry_painting_b_1 - - symmetry_painting_a_3 - - symmetry_painting_a_5 - - symmetry_painting_b_4 - - symmetry_painting_a_2 - - symmetry_painting_b_2 - - symmetry_painting_a_6 - - symmetry_painting_b_6 +- pos: [428, 696] + painting: symmetry_painting_a_1 exits: - symmetry_starting + - symmetry_a_chandelier + - symmetry_a_table +- pos: [428, 749] + painting: symmetry_painting_b_1 + entrances: + - symmetry_b_table +- pos: [471, 696] + painting: symmetry_painting_a_3 +- pos: [538, 699] + painting: symmetry_painting_a_5 + entrances: + - symmetry_a_chandelier +- pos: [562, 728] + painting: symmetry_painting_b_4 +- pos: [422, 647] + painting: symmetry_painting_a_2 + entrances: + - symmetry_a_table +- pos: [364, 648] + painting: symmetry_painting_b_2 + exits: + - symmetry_b_table + - symmetry_b_fire +- pos: [449, 647] + painting: symmetry_painting_a_6 +- pos: [508, 647] + painting: symmetry_painting_b_6 + entrances: + - symmetry_b_fire - pos: [558, 665] room: The Wondrous door: Exit -- pos: [407, 755] +- pos: [535, 647] room: The Wondrous door: Exit - paintings: - - arrows_painting_9 -- pos: [449, 755] - paintings: - - flower_painting_6 + painting: arrows_painting_9 +- pos: [610, 674] + painting: flower_painting_6 entrances: - flower_arrow -- pos: [1101, 222] - paintings: - - panda_painting +- pos: [1156, 262] + painting: panda_painting entrances: - panda_hallway - pos: [1152, 209] @@ -950,9 +950,8 @@ - pos: [1415, 140] room: Number Hunt door: Nines -- pos: [1458, 133] - paintings: - - south_afar +- pos: [1424, 85] + painting: south_afar - pos: [826, 1452] room: Outside The Wanderer door: Wanderer Entrance @@ -979,15 +978,18 @@ - pos: [1511, 1119] room: Art Gallery door: Exit -- pos: [1654, 1116] - paintings: - - smile_painting_3 - - flower_painting_2 - - scenery_painting_0a - - map_painting - - fruitbowl_painting4 +- pos: [1730, 1162] + painting: flower_painting_2 +- pos: [1730, 1189] + painting: map_painting +- pos: [1698, 1189] + painting: smile_painting_3 entrances: - smiley_gallery +- pos: [1714, 1215] + painting: fruitbowl_painting4 +- pos: [1714, 1242] + painting: scenery_painting_0a - pos: [1120, 1286] room: Rhyme Room (Smiley) door: Door to Target @@ -1006,9 +1008,8 @@ - pos: [1120, 1195] room: Rhyme Room (Circle) door: Door to Smiley -- pos: [1118, 1137] - paintings: - - arrows_painting_3 +- pos: [1130, 1124] + painting: arrows_painting_3 - pos: [1050, 1142] room: Rhyme Room (Looped Square) door: Door to Circle @@ -1021,24 +1022,21 @@ - pos: [852, 1200] room: Rhyme Room (Target) door: Door to Cross -- pos: [850, 1138] - paintings: - - arrows_painting_4 +- pos: [862, 1124] + painting: arrows_painting_4 - pos: [1592, 1442] room: Room Room door: Cellar Exit - pos: [1623, 938] room: Outside The Wise door: Wise Entrance -- pos: [1653, 935] - paintings: - - clock_painting_3 +- pos: [1665, 920] + painting: clock_painting_3 - pos: [241, 348] room: Outside The Scientific door: Scientific Entrance -- pos: [294, 602] - paintings: - - hi_solved_painting4 +- pos: [176, 326] + painting: hi_solved_painting4 entrances: - hi_scientific - pos: [815, 1002] diff --git a/src/game_data.cpp b/src/game_data.cpp index 54b25b4..8ccc0da 100644 --- a/src/game_data.cpp +++ b/src/game_data.cpp @@ -778,13 +778,10 @@ struct GameData { subway_it["door"].as()); } - if (subway_it["paintings"]) { - for (const auto &painting_it : subway_it["paintings"]) { - std::string painting_id = painting_it.as(); - - subway_item.paintings.push_back(painting_id); - subway_item_by_painting_[painting_id] = subway_item.id; - } + if (subway_it["painting"]) { + std::string painting_id = subway_it["painting"].as(); + subway_item.painting = painting_id; + subway_item_by_painting_[painting_id] = subway_item.id; } if (subway_it["tags"]) { diff --git a/src/game_data.h b/src/game_data.h index b087734..be10900 100644 --- a/src/game_data.h +++ b/src/game_data.h @@ -157,7 +157,7 @@ struct SubwayItem { int x; int y; std::optional door; - std::vector paintings; + std::optional painting; std::vector tags; // 2-way teleports std::vector entrances; // teleport entrances std::vector exits; // teleport exits diff --git a/src/subway_map.cpp b/src/subway_map.cpp index 9a35eef..f00f03f 100644 --- a/src/subway_map.cpp +++ b/src/subway_map.cpp @@ -14,8 +14,23 @@ constexpr int AREA_ACTUAL_SIZE = 21; constexpr int OWL_ACTUAL_SIZE = 32; +constexpr int PAINTING_RADIUS = 9; // the actual circles on the map are radius 11 +constexpr int PAINTING_EXIT_RADIUS = 6; -enum class ItemDrawType { kNone, kBox, kOwl }; +enum class ItemDrawType { kNone, kBox, kOwl, kOwlExit }; + +namespace { + +wxPoint GetSubwayItemMapCenter(const SubwayItem &subway_item) { + if (subway_item.painting) { + return {subway_item.x, subway_item.y}; + } else { + return {subway_item.x + AREA_ACTUAL_SIZE / 2, + subway_item.y + AREA_ACTUAL_SIZE / 2}; + } +} + +} // namespace SubwayMap::SubwayMap(wxWindow *parent) : wxPanel(parent, wxID_ANY) { SetBackgroundStyle(wxBG_STYLE_PAINT); @@ -68,11 +83,11 @@ void SubwayMap::OnConnect() { std::map> exits; for (const SubwayItem &subway_item : GD_GetSubwayItems()) { if (AP_HasEarlyColorHallways() && - subway_item.special == "starting_room_paintings") { + subway_item.special == "early_color_hallways") { entrances["early_ch"].push_back(subway_item.id); } - if (AP_IsPaintingShuffle() && !subway_item.paintings.empty()) { + if (AP_IsPaintingShuffle() && subway_item.painting) { continue; } @@ -319,10 +334,8 @@ void SubwayMap::OnPaint(wxPaintEvent &event) { const SubwayItem &item1 = GD_GetSubwayItem(node.entry); const SubwayItem &item2 = GD_GetSubwayItem(node.exit); - wxPoint item1_pos = MapPosToRenderPos( - {item1.x + AREA_ACTUAL_SIZE / 2, item1.y + AREA_ACTUAL_SIZE / 2}); - wxPoint item2_pos = MapPosToRenderPos( - {item2.x + AREA_ACTUAL_SIZE / 2, item2.y + AREA_ACTUAL_SIZE / 2}); + wxPoint item1_pos = MapPosToRenderPos(GetSubwayItemMapCenter(item1)); + wxPoint item2_pos = MapPosToRenderPos(GetSubwayItemMapCenter(item2)); int left = std::min(item1_pos.x, item2_pos.x); int top = std::min(item1_pos.y, item2_pos.y); @@ -508,11 +521,12 @@ void SubwayMap::OnClickHelp(wxCommandEvent &event) { "your mouse. Click again to stop.\nHover over a door to see the " "requirements to open it.\nHover over a warp or active painting to see " "what it is connected to.\nFor one-way connections, there will be a " - "circle at the exit.\nIn painting shuffle, paintings that have not " - "yet been checked will not show their connections.\nA green shaded owl " - "means that there is a painting entrance there.\nA red shaded owl means " - "that there are only painting exits there.\nClick on a door or " - "warp to make the popup stick until you click again.", + "circle at the exit.\nCircles represent paintings.\nA red circle means " + "that the painting is locked by a door.\nA blue circle means painting " + "shuffle is enabled and the painting has not been checked yet.\nA black " + "circle means the painting is not a warp.\nA green circle means that the " + "painting is a warp.\nPainting exits will be indicated with an X.\nClick " + "on a door or warp to make the popup stick until you click again.", "Subway Map Help"); } @@ -529,20 +543,20 @@ void SubwayMap::Redraw() { for (const SubwayItem &subway_item : GD_GetSubwayItems()) { ItemDrawType draw_type = ItemDrawType::kNone; const wxBrush *brush_color = wxGREY_BRUSH; - std::optional shade_color; std::optional subway_door = GetRealSubwayDoor(subway_item); if (AP_HasEarlyColorHallways() && - subway_item.special == "starting_room_paintings") { + subway_item.special == "early_color_hallways") { draw_type = ItemDrawType::kOwl; - shade_color = wxColour(0, 255, 0, 128); + brush_color = wxGREEN_BRUSH; + } else if (subway_item.special == "starting_room_overhead") { + // Do not draw. } else if (subway_item.special == "sun_painting") { if (!AP_IsPilgrimageEnabled()) { + draw_type = ItemDrawType::kOwl; if (IsDoorOpen(*subway_item.door)) { - draw_type = ItemDrawType::kOwl; - shade_color = wxColour(0, 255, 0, 128); + brush_color = wxGREEN_BRUSH; } else { - draw_type = ItemDrawType::kBox; brush_color = wxRED_BRUSH; } } @@ -556,41 +570,28 @@ void SubwayMap::Redraw() { } else { brush_color = wxRED_BRUSH; } - } else if (!subway_item.paintings.empty()) { - if (AP_IsPaintingShuffle()) { - bool has_checked_painting = false; - bool has_unchecked_painting = false; - bool has_mapped_painting = false; - bool has_codomain_painting = false; - - for (const std::string &painting_id : subway_item.paintings) { - if (checked_paintings_.count(painting_id)) { - has_checked_painting = true; - - if (painting_mapping.count(painting_id)) { - has_mapped_painting = true; - } else if (AP_IsPaintingMappedTo(painting_id)) { - has_codomain_painting = true; - } - } else { - has_unchecked_painting = true; - } - } - - if (has_unchecked_painting || has_mapped_painting || - has_codomain_painting) { + } else if (subway_item.painting) { + if (subway_door && !IsDoorOpen(*subway_door)) { + draw_type = ItemDrawType::kOwl; + brush_color = wxRED_BRUSH; + } else if (AP_IsPaintingShuffle()) { + if (!checked_paintings_.count(*subway_item.painting)) { draw_type = ItemDrawType::kOwl; - - if (has_checked_painting) { - if (has_mapped_painting) { - shade_color = wxColour(0, 255, 0, 128); - } else { - shade_color = wxColour(255, 0, 0, 128); - } - } + brush_color = wxBLUE_BRUSH; + } else if (painting_mapping.count(*subway_item.painting)) { + draw_type = ItemDrawType::kOwl; + brush_color = wxGREEN_BRUSH; + } else if (AP_IsPaintingMappedTo(*subway_item.painting)) { + draw_type = ItemDrawType::kOwlExit; + brush_color = wxGREEN_BRUSH; } } else if (subway_item.HasWarps()) { - draw_type = ItemDrawType::kOwl; + brush_color = wxGREEN_BRUSH; + if (!subway_item.exits.empty()) { + draw_type = ItemDrawType::kOwlExit; + } else { + draw_type = ItemDrawType::kOwl; + } } } else if (subway_door) { draw_type = ItemDrawType::kBox; @@ -611,14 +612,20 @@ void SubwayMap::Redraw() { gcdc.SetPen(*wxThePenList->FindOrCreatePen(*wxBLACK, 1)); gcdc.SetBrush(*brush_color); gcdc.DrawRectangle(real_area_pos, {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)); - gcdc.DrawBitmap(owl_bitmap, real_area_pos); - - if (shade_color) { - gcdc.SetBrush(wxBrush(*shade_color)); - gcdc.DrawRectangle(real_area_pos, {real_area_size, real_area_size}); + } else if (draw_type == ItemDrawType::kOwl || draw_type == ItemDrawType::kOwlExit) { + gcdc.SetPen(*wxThePenList->FindOrCreatePen(*wxBLACK, 1)); + gcdc.SetBrush(*brush_color); + gcdc.DrawCircle(real_area_pos, PAINTING_RADIUS); + + if (draw_type == ItemDrawType::kOwlExit) { + gcdc.DrawLine(subway_item.x - PAINTING_EXIT_RADIUS, + subway_item.y - PAINTING_EXIT_RADIUS, + subway_item.x + PAINTING_EXIT_RADIUS, + subway_item.y + PAINTING_EXIT_RADIUS); + gcdc.DrawLine(subway_item.x + PAINTING_EXIT_RADIUS, + subway_item.y - PAINTING_EXIT_RADIUS, + subway_item.x - PAINTING_EXIT_RADIUS, + subway_item.y + PAINTING_EXIT_RADIUS); } } } @@ -796,6 +803,13 @@ std::optional SubwayMap::GetRealSubwayDoor(const SubwayItem subway_item) { quadtree::Box SubwayMap::GetItemBox::operator()(const int &id) const { const SubwayItem &subway_item = GD_GetSubwayItem(id); - return {static_cast(subway_item.x), static_cast(subway_item.y), - AREA_ACTUAL_SIZE, AREA_ACTUAL_SIZE}; + if (subway_item.painting) { + return {static_cast(subway_item.x) - PAINTING_RADIUS, + static_cast(subway_item.y) - PAINTING_RADIUS, + PAINTING_RADIUS * 2, PAINTING_RADIUS * 2}; + } else { + return {static_cast(subway_item.x), + static_cast(subway_item.y), AREA_ACTUAL_SIZE, + AREA_ACTUAL_SIZE}; + } } -- cgit 1.4.1