diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-03-13 12:47:54 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-03-13 12:47:54 -0400 |
| commit | dfddd07b8b5cbff7c09103a694aed40bda254a2d (patch) | |
| tree | 220364fa26eff54d9a3fd49f1b52a8afce2bf907 /src/tracker_config.cpp | |
| parent | dacbe8e3fbda85f7c2e7e7b660795f2a080a9d25 (diff) | |
| download | lingo-ap-tracker-dfddd07b8b5cbff7c09103a694aed40bda254a2d.tar.gz lingo-ap-tracker-dfddd07b8b5cbff7c09103a694aed40bda254a2d.tar.bz2 lingo-ap-tracker-dfddd07b8b5cbff7c09103a694aed40bda254a2d.zip | |
Obsolete savefile reader + IPC solves
Now, panel solve state is all read from the sync fields in datastorage. The "show hunt panels" field in settings is now a radio box, and you can choose to show all panels.
Diffstat (limited to 'src/tracker_config.cpp')
| -rw-r--r-- | src/tracker_config.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
| diff --git a/src/tracker_config.cpp b/src/tracker_config.cpp index aeff669..da5d60a 100644 --- a/src/tracker_config.cpp +++ b/src/tracker_config.cpp | |||
| @@ -16,7 +16,9 @@ void TrackerConfig::Load() { | |||
| 16 | asked_to_check_for_updates = file["asked_to_check_for_updates"].as<bool>(); | 16 | asked_to_check_for_updates = file["asked_to_check_for_updates"].as<bool>(); |
| 17 | should_check_for_updates = file["should_check_for_updates"].as<bool>(); | 17 | should_check_for_updates = file["should_check_for_updates"].as<bool>(); |
| 18 | hybrid_areas = file["hybrid_areas"].as<bool>(); | 18 | hybrid_areas = file["hybrid_areas"].as<bool>(); |
| 19 | show_hunt_panels = file["show_hunt_panels"].as<bool>(); | 19 | if (file["show_hunt_panels"] && file["show_hunt_panels"].as<bool>()) { |
| 20 | visible_panels = kHUNT_PANELS; | ||
| 21 | } | ||
| 20 | 22 | ||
| 21 | if (file["connection_history"]) { | 23 | if (file["connection_history"]) { |
| 22 | for (const auto& connection : file["connection_history"]) { | 24 | for (const auto& connection : file["connection_history"]) { |
| @@ -30,6 +32,8 @@ void TrackerConfig::Load() { | |||
| 30 | 32 | ||
| 31 | ipc_address = file["ipc_address"].as<std::string>(); | 33 | ipc_address = file["ipc_address"].as<std::string>(); |
| 32 | track_position = file["track_position"].as<bool>(); | 34 | track_position = file["track_position"].as<bool>(); |
| 35 | visible_panels = | ||
| 36 | static_cast<VisiblePanels>(file["visible_panels"].as<int>()); | ||
| 33 | } catch (const std::exception&) { | 37 | } catch (const std::exception&) { |
| 34 | // It's fine if the file can't be loaded. | 38 | // It's fine if the file can't be loaded. |
| 35 | } | 39 | } |
| @@ -43,7 +47,6 @@ void TrackerConfig::Save() { | |||
| 43 | output["asked_to_check_for_updates"] = asked_to_check_for_updates; | 47 | output["asked_to_check_for_updates"] = asked_to_check_for_updates; |
| 44 | output["should_check_for_updates"] = should_check_for_updates; | 48 | output["should_check_for_updates"] = should_check_for_updates; |
| 45 | output["hybrid_areas"] = hybrid_areas; | 49 | output["hybrid_areas"] = hybrid_areas; |
| 46 | output["show_hunt_panels"] = show_hunt_panels; | ||
| 47 | 50 | ||
| 48 | output.remove("connection_history"); | 51 | output.remove("connection_history"); |
| 49 | for (const ConnectionDetails& details : connection_history) { | 52 | for (const ConnectionDetails& details : connection_history) { |
| @@ -57,6 +60,7 @@ void TrackerConfig::Save() { | |||
| 57 | 60 | ||
| 58 | output["ipc_address"] = ipc_address; | 61 | output["ipc_address"] = ipc_address; |
| 59 | output["track_position"] = track_position; | 62 | output["track_position"] = track_position; |
| 63 | output["visible_panels"] = static_cast<int>(visible_panels); | ||
| 60 | 64 | ||
| 61 | std::ofstream filewriter(filename_); | 65 | std::ofstream filewriter(filename_); |
| 62 | filewriter << output; | 66 | filewriter << output; |
