diff options
Diffstat (limited to 'src/ap_state.cpp')
-rw-r--r-- | src/ap_state.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ap_state.cpp b/src/ap_state.cpp index ebc5fc9..d501e81 100644 --- a/src/ap_state.cpp +++ b/src/ap_state.cpp | |||
@@ -58,6 +58,7 @@ struct APState { | |||
58 | std::optional<std::tuple<int, int>> player_pos; | 58 | std::optional<std::tuple<int, int>> player_pos; |
59 | 59 | ||
60 | DoorShuffleMode door_shuffle_mode = kNO_DOORS; | 60 | DoorShuffleMode door_shuffle_mode = kNO_DOORS; |
61 | bool group_doors = false; | ||
61 | bool color_shuffle = false; | 62 | bool color_shuffle = false; |
62 | bool painting_shuffle = false; | 63 | bool painting_shuffle = false; |
63 | int mastery_requirement = 21; | 64 | int mastery_requirement = 21; |
@@ -137,6 +138,7 @@ struct APState { | |||
137 | player_pos = std::nullopt; | 138 | player_pos = std::nullopt; |
138 | victory_data_storage_key.clear(); | 139 | victory_data_storage_key.clear(); |
139 | door_shuffle_mode = kNO_DOORS; | 140 | door_shuffle_mode = kNO_DOORS; |
141 | group_doors = false; | ||
140 | color_shuffle = false; | 142 | color_shuffle = false; |
141 | painting_shuffle = false; | 143 | painting_shuffle = false; |
142 | painting_mapping.clear(); | 144 | painting_mapping.clear(); |
@@ -231,6 +233,17 @@ struct APState { | |||
231 | data_storage_prefix = | 233 | data_storage_prefix = |
232 | fmt::format("Lingo_{}_", apclient->get_player_number()); | 234 | fmt::format("Lingo_{}_", apclient->get_player_number()); |
233 | door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>(); | 235 | door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>(); |
236 | if (slot_data.contains("group_doors")) { | ||
237 | group_doors = slot_data.contains("group_doors") && | ||
238 | slot_data["group_doors"].get<int>() == 1; | ||
239 | } else { | ||
240 | // If group_doors doesn't exist yet, that means kPANELS_MODE is actually | ||
241 | // kSIMPLE_DOORS. | ||
242 | if (door_shuffle_mode == kPANELS_MODE) { | ||
243 | door_shuffle_mode = kDOORS_MODE; | ||
244 | group_doors = true; | ||
245 | } | ||
246 | } | ||
234 | color_shuffle = slot_data["shuffle_colors"].get<int>() == 1; | 247 | color_shuffle = slot_data["shuffle_colors"].get<int>() == 1; |
235 | painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1; | 248 | painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1; |
236 | mastery_requirement = slot_data["mastery_achievements"].get<int>(); | 249 | mastery_requirement = slot_data["mastery_achievements"].get<int>(); |
@@ -527,6 +540,8 @@ std::string AP_GetItemName(int item_id) { | |||
527 | 540 | ||
528 | DoorShuffleMode AP_GetDoorShuffleMode() { return GetState().door_shuffle_mode; } | 541 | DoorShuffleMode AP_GetDoorShuffleMode() { return GetState().door_shuffle_mode; } |
529 | 542 | ||
543 | bool AP_AreDoorsGrouped() { return GetState().group_doors; } | ||
544 | |||
530 | bool AP_IsColorShuffle() { return GetState().color_shuffle; } | 545 | bool AP_IsColorShuffle() { return GetState().color_shuffle; } |
531 | 546 | ||
532 | bool AP_IsPaintingShuffle() { return GetState().painting_shuffle; } | 547 | bool AP_IsPaintingShuffle() { return GetState().painting_shuffle; } |