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 8ff0ccd..a7565cf 100644 --- a/src/ap_state.cpp +++ b/src/ap_state.cpp | |||
@@ -56,6 +56,7 @@ struct APState { | |||
56 | std::optional<std::tuple<int, int>> player_pos; | 56 | std::optional<std::tuple<int, int>> player_pos; |
57 | 57 | ||
58 | DoorShuffleMode door_shuffle_mode = kNO_DOORS; | 58 | DoorShuffleMode door_shuffle_mode = kNO_DOORS; |
59 | bool group_doors = false; | ||
59 | bool color_shuffle = false; | 60 | bool color_shuffle = false; |
60 | bool painting_shuffle = false; | 61 | bool painting_shuffle = false; |
61 | int mastery_requirement = 21; | 62 | int mastery_requirement = 21; |
@@ -135,6 +136,7 @@ struct APState { | |||
135 | player_pos = std::nullopt; | 136 | player_pos = std::nullopt; |
136 | victory_data_storage_key.clear(); | 137 | victory_data_storage_key.clear(); |
137 | door_shuffle_mode = kNO_DOORS; | 138 | door_shuffle_mode = kNO_DOORS; |
139 | group_doors = false; | ||
138 | color_shuffle = false; | 140 | color_shuffle = false; |
139 | painting_shuffle = false; | 141 | painting_shuffle = false; |
140 | painting_mapping.clear(); | 142 | painting_mapping.clear(); |
@@ -227,6 +229,17 @@ struct APState { | |||
227 | data_storage_prefix = | 229 | data_storage_prefix = |
228 | "Lingo_" + std::to_string(apclient->get_player_number()) + "_"; | 230 | "Lingo_" + std::to_string(apclient->get_player_number()) + "_"; |
229 | door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>(); | 231 | door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>(); |
232 | if (slot_data.contains("group_doors")) { | ||
233 | group_doors = slot_data.contains("group_doors") && | ||
234 | slot_data["group_doors"].get<int>() == 1; | ||
235 | } else { | ||
236 | // If group_doors doesn't exist yet, that means kPANELS_MODE is actually | ||
237 | // kSIMPLE_DOORS. | ||
238 | if (door_shuffle_mode == kPANELS_MODE) { | ||
239 | door_shuffle_mode = kDOORS_MODE; | ||
240 | group_doors = true; | ||
241 | } | ||
242 | } | ||
230 | color_shuffle = slot_data["shuffle_colors"].get<int>() == 1; | 243 | color_shuffle = slot_data["shuffle_colors"].get<int>() == 1; |
231 | painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1; | 244 | painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1; |
232 | mastery_requirement = slot_data["mastery_achievements"].get<int>(); | 245 | mastery_requirement = slot_data["mastery_achievements"].get<int>(); |
@@ -524,6 +537,8 @@ std::string AP_GetItemName(int item_id) { | |||
524 | 537 | ||
525 | DoorShuffleMode AP_GetDoorShuffleMode() { return GetState().door_shuffle_mode; } | 538 | DoorShuffleMode AP_GetDoorShuffleMode() { return GetState().door_shuffle_mode; } |
526 | 539 | ||
540 | bool AP_AreDoorsGrouped() { return GetState().group_doors; } | ||
541 | |||
527 | bool AP_IsColorShuffle() { return GetState().color_shuffle; } | 542 | bool AP_IsColorShuffle() { return GetState().color_shuffle; } |
528 | 543 | ||
529 | bool AP_IsPaintingShuffle() { return GetState().painting_shuffle; } | 544 | bool AP_IsPaintingShuffle() { return GetState().painting_shuffle; } |