diff options
Diffstat (limited to 'src/ap_state.cpp')
-rw-r--r-- | src/ap_state.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ap_state.cpp b/src/ap_state.cpp index 58670e6..62c9f3f 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; |
@@ -128,6 +129,7 @@ struct APState { | |||
128 | player_pos = std::nullopt; | 129 | player_pos = std::nullopt; |
129 | victory_data_storage_key.clear(); | 130 | victory_data_storage_key.clear(); |
130 | door_shuffle_mode = kNO_DOORS; | 131 | door_shuffle_mode = kNO_DOORS; |
132 | group_doors = false; | ||
131 | color_shuffle = false; | 133 | color_shuffle = false; |
132 | painting_shuffle = false; | 134 | painting_shuffle = false; |
133 | painting_mapping.clear(); | 135 | painting_mapping.clear(); |
@@ -212,6 +214,17 @@ struct APState { | |||
212 | data_storage_prefix = | 214 | data_storage_prefix = |
213 | "Lingo_" + std::to_string(apclient->get_player_number()) + "_"; | 215 | "Lingo_" + std::to_string(apclient->get_player_number()) + "_"; |
214 | door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>(); | 216 | door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>(); |
217 | if (slot_data.contains("group_doors")) { | ||
218 | group_doors = slot_data.contains("group_doors") && | ||
219 | slot_data["group_doors"].get<int>() == 1; | ||
220 | } else { | ||
221 | // If group_doors doesn't exist yet, that means kPANELS_MODE is actually | ||
222 | // kSIMPLE_DOORS. | ||
223 | if (door_shuffle_mode == kPANELS_MODE) { | ||
224 | door_shuffle_mode = kDOORS_MODE; | ||
225 | group_doors = true; | ||
226 | } | ||
227 | } | ||
215 | color_shuffle = slot_data["shuffle_colors"].get<int>() == 1; | 228 | color_shuffle = slot_data["shuffle_colors"].get<int>() == 1; |
216 | painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1; | 229 | painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1; |
217 | mastery_requirement = slot_data["mastery_achievements"].get<int>(); | 230 | mastery_requirement = slot_data["mastery_achievements"].get<int>(); |
@@ -346,7 +359,7 @@ struct APState { | |||
346 | } else { | 359 | } else { |
347 | data_storage.erase(key); | 360 | data_storage.erase(key); |
348 | } | 361 | } |
349 | 362 | ||
350 | TrackerLog("Data storage " + key + " retrieved as null"); | 363 | TrackerLog("Data storage " + key + " retrieved as null"); |
351 | } | 364 | } |
352 | } | 365 | } |
@@ -426,6 +439,8 @@ bool AP_HasItem(int item_id, int quantity) { | |||
426 | 439 | ||
427 | DoorShuffleMode AP_GetDoorShuffleMode() { return GetState().door_shuffle_mode; } | 440 | DoorShuffleMode AP_GetDoorShuffleMode() { return GetState().door_shuffle_mode; } |
428 | 441 | ||
442 | bool AP_AreDoorsGrouped() { return GetState().group_doors; } | ||
443 | |||
429 | bool AP_IsColorShuffle() { return GetState().color_shuffle; } | 444 | bool AP_IsColorShuffle() { return GetState().color_shuffle; } |
430 | 445 | ||
431 | bool AP_IsPaintingShuffle() { return GetState().painting_shuffle; } | 446 | bool AP_IsPaintingShuffle() { return GetState().painting_shuffle; } |