about summary refs log tree commit diff stats
path: root/src/ap_state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ap_state.cpp')
-rw-r--r--src/ap_state.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/ap_state.cpp b/src/ap_state.cpp index 876fdd8..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();
@@ -221,14 +223,27 @@ struct APState {
221 RefreshTracker(false); 223 RefreshTracker(false);
222 }); 224 });
223 225
224 apclient->set_slot_connected_handler([this, &connection_mutex]( 226 apclient->set_slot_connected_handler([this, player, server,
227 &connection_mutex](
225 const nlohmann::json& slot_data) { 228 const nlohmann::json& slot_data) {
226 tracker_frame->SetStatusMessage("Connected to Archipelago!"); 229 tracker_frame->SetStatusMessage(
230 fmt::format("Connected to Archipelago! ({}@{})", player, server));
227 TrackerLog("Connected to Archipelago!"); 231 TrackerLog("Connected to Archipelago!");
228 232
229 data_storage_prefix = 233 data_storage_prefix =
230 fmt::format("Lingo_{}_", apclient->get_player_number()); 234 fmt::format("Lingo_{}_", apclient->get_player_number());
231 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 }
232 color_shuffle = slot_data["shuffle_colors"].get<int>() == 1; 247 color_shuffle = slot_data["shuffle_colors"].get<int>() == 1;
233 painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1; 248 painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1;
234 mastery_requirement = slot_data["mastery_achievements"].get<int>(); 249 mastery_requirement = slot_data["mastery_achievements"].get<int>();
@@ -525,6 +540,8 @@ std::string AP_GetItemName(int item_id) {
525 540
526DoorShuffleMode AP_GetDoorShuffleMode() { return GetState().door_shuffle_mode; } 541DoorShuffleMode AP_GetDoorShuffleMode() { return GetState().door_shuffle_mode; }
527 542
543bool AP_AreDoorsGrouped() { return GetState().group_doors; }
544
528bool AP_IsColorShuffle() { return GetState().color_shuffle; } 545bool AP_IsColorShuffle() { return GetState().color_shuffle; }
529 546
530bool AP_IsPaintingShuffle() { return GetState().painting_shuffle; } 547bool AP_IsPaintingShuffle() { return GetState().painting_shuffle; }