diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-03-08 09:33:06 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-03-08 09:33:06 -0500 |
commit | 5fe5bec92e86a4a94cddefec51fabc22212b7364 (patch) | |
tree | f9190bf341494510be2c3b9b75e907208025fcbb /src/ap_state.cpp | |
parent | c96b3e0e27d3086113dffe1eab0f63f906a5f58c (diff) | |
download | lingo-ap-tracker-5fe5bec92e86a4a94cddefec51fabc22212b7364.tar.gz lingo-ap-tracker-5fe5bec92e86a4a94cddefec51fabc22212b7364.tar.bz2 lingo-ap-tracker-5fe5bec92e86a4a94cddefec51fabc22212b7364.zip |
Added button to reveal paintings
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 | ||