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 8feb78b..4fd241a 100644 --- a/src/ap_state.cpp +++ b/src/ap_state.cpp | |||
@@ -57,6 +57,7 @@ struct APState { | |||
57 | std::optional<std::tuple<int, int>> player_pos; | 57 | std::optional<std::tuple<int, int>> player_pos; |
58 | 58 | ||
59 | DoorShuffleMode door_shuffle_mode = kNO_DOORS; | 59 | DoorShuffleMode door_shuffle_mode = kNO_DOORS; |
60 | bool group_doors = false; | ||
60 | bool color_shuffle = false; | 61 | bool color_shuffle = false; |
61 | bool painting_shuffle = false; | 62 | bool painting_shuffle = false; |
62 | int mastery_requirement = 21; | 63 | int mastery_requirement = 21; |
@@ -134,6 +135,7 @@ struct APState { | |||
134 | player_pos = std::nullopt; | 135 | player_pos = std::nullopt; |
135 | victory_data_storage_key.clear(); | 136 | victory_data_storage_key.clear(); |
136 | door_shuffle_mode = kNO_DOORS; | 137 | door_shuffle_mode = kNO_DOORS; |
138 | group_doors = false; | ||
137 | color_shuffle = false; | 139 | color_shuffle = false; |
138 | painting_shuffle = false; | 140 | painting_shuffle = false; |
139 | painting_mapping.clear(); | 141 | painting_mapping.clear(); |
@@ -224,6 +226,17 @@ struct APState { | |||
224 | data_storage_prefix = | 226 | data_storage_prefix = |
225 | "Lingo_" + std::to_string(apclient->get_player_number()) + "_"; | 227 | "Lingo_" + std::to_string(apclient->get_player_number()) + "_"; |
226 | door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>(); | 228 | door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>(); |
229 | if (slot_data.contains("group_doors")) { | ||
230 | group_doors = slot_data.contains("group_doors") && | ||
231 | slot_data["group_doors"].get<int>() == 1; | ||
232 | } else { | ||
233 | // If group_doors doesn't exist yet, that means kPANELS_MODE is actually | ||
234 | // kSIMPLE_DOORS. | ||
235 | if (door_shuffle_mode == kPANELS_MODE) { | ||
236 | door_shuffle_mode = kDOORS_MODE; | ||
237 | group_doors = true; | ||
238 | } | ||
239 | } | ||
227 | color_shuffle = slot_data["shuffle_colors"].get<int>() == 1; | 240 | color_shuffle = slot_data["shuffle_colors"].get<int>() == 1; |
228 | painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1; | 241 | painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1; |
229 | mastery_requirement = slot_data["mastery_achievements"].get<int>(); | 242 | mastery_requirement = slot_data["mastery_achievements"].get<int>(); |
@@ -463,6 +476,8 @@ bool AP_HasItem(int item_id, int quantity) { | |||
463 | 476 | ||
464 | DoorShuffleMode AP_GetDoorShuffleMode() { return GetState().door_shuffle_mode; } | 477 | DoorShuffleMode AP_GetDoorShuffleMode() { return GetState().door_shuffle_mode; } |
465 | 478 | ||
479 | bool AP_AreDoorsGrouped() { return GetState().group_doors; } | ||
480 | |||
466 | bool AP_IsColorShuffle() { return GetState().color_shuffle; } | 481 | bool AP_IsColorShuffle() { return GetState().color_shuffle; } |
467 | 482 | ||
468 | bool AP_IsPaintingShuffle() { return GetState().painting_shuffle; } | 483 | bool AP_IsPaintingShuffle() { return GetState().painting_shuffle; } |