diff options
Diffstat (limited to 'src/ap_state.cpp')
-rw-r--r-- | src/ap_state.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ap_state.cpp b/src/ap_state.cpp index cbe622a..29e649f 100644 --- a/src/ap_state.cpp +++ b/src/ap_state.cpp | |||
@@ -245,6 +245,22 @@ struct APState { | |||
245 | 245 | ||
246 | std::string GetItemName(int id) { return apclient->get_item_name(id); } | 246 | std::string GetItemName(int id) { return apclient->get_item_name(id); } |
247 | 247 | ||
248 | void RevealPaintings() { | ||
249 | std::lock_guard state_guard(state_mutex); | ||
250 | |||
251 | std::vector<std::string> paintings; | ||
252 | for (const PaintingExit& painting : GD_GetPaintings()) { | ||
253 | paintings.push_back(painting.internal_id); | ||
254 | } | ||
255 | |||
256 | APClient::DataStorageOperation operation; | ||
257 | operation.operation = "replace"; | ||
258 | operation.value = paintings; | ||
259 | |||
260 | apclient->Set(fmt::format("{}Paintings", data_storage_prefix), "", true, | ||
261 | {operation}); | ||
262 | } | ||
263 | |||
248 | bool HasReachedGoal() { | 264 | bool HasReachedGoal() { |
249 | std::lock_guard state_guard(state_mutex); | 265 | std::lock_guard state_guard(state_mutex); |
250 | 266 | ||
@@ -713,6 +729,8 @@ bool AP_IsPaintingChecked(const std::string& painting_id) { | |||
713 | return GetState().IsPaintingChecked(painting_id); | 729 | return GetState().IsPaintingChecked(painting_id); |
714 | } | 730 | } |
715 | 731 | ||
732 | void AP_RevealPaintings() { GetState().RevealPaintings(); } | ||
733 | |||
716 | int AP_GetMasteryRequirement() { | 734 | int AP_GetMasteryRequirement() { |
717 | std::lock_guard state_guard(GetState().state_mutex); | 735 | std::lock_guard state_guard(GetState().state_mutex); |
718 | 736 | ||