about summary refs log tree commit diff stats
path: root/src/tracker_config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tracker_config.cpp')
-rw-r--r--src/tracker_config.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tracker_config.cpp b/src/tracker_config.cpp index 129dbbc..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"]) {
@@ -29,6 +31,9 @@ void TrackerConfig::Load() {
29 } 31 }
30 32
31 ipc_address = file["ipc_address"].as<std::string>(); 33 ipc_address = file["ipc_address"].as<std::string>();
34 track_position = file["track_position"].as<bool>();
35 visible_panels =
36 static_cast<VisiblePanels>(file["visible_panels"].as<int>());
32 } catch (const std::exception&) { 37 } catch (const std::exception&) {
33 // It's fine if the file can't be loaded. 38 // It's fine if the file can't be loaded.
34 } 39 }
@@ -42,7 +47,6 @@ void TrackerConfig::Save() {
42 output["asked_to_check_for_updates"] = asked_to_check_for_updates; 47 output["asked_to_check_for_updates"] = asked_to_check_for_updates;
43 output["should_check_for_updates"] = should_check_for_updates; 48 output["should_check_for_updates"] = should_check_for_updates;
44 output["hybrid_areas"] = hybrid_areas; 49 output["hybrid_areas"] = hybrid_areas;
45 output["show_hunt_panels"] = show_hunt_panels;
46 50
47 output.remove("connection_history"); 51 output.remove("connection_history");
48 for (const ConnectionDetails& details : connection_history) { 52 for (const ConnectionDetails& details : connection_history) {
@@ -55,6 +59,8 @@ void TrackerConfig::Save() {
55 } 59 }
56 60
57 output["ipc_address"] = ipc_address; 61 output["ipc_address"] = ipc_address;
62 output["track_position"] = track_position;
63 output["visible_panels"] = static_cast<int>(visible_panels);
58 64
59 std::ofstream filewriter(filename_); 65 std::ofstream filewriter(filename_);
60 filewriter << output; 66 filewriter << output;