From 5e20e80afa5379a3ea984089fcf7003ce0a800b3 Mon Sep 17 00:00:00 2001
From: Gabriel Lima <44784408+gablm@users.noreply.github.com>
Date: Mon, 14 Oct 2024 00:24:33 +0100
Subject: [PATCH] [Playtime Stats] Fix deserialization not being able to set
properties
me dumb
---
.../GamePlaytime/RegistryClass/CollapsePlaytime.cs | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/CollapseLauncher/Classes/GameManagement/GamePlaytime/RegistryClass/CollapsePlaytime.cs b/CollapseLauncher/Classes/GameManagement/GamePlaytime/RegistryClass/CollapsePlaytime.cs
index 4be65e65a..b8780e8a5 100644
--- a/CollapseLauncher/Classes/GameManagement/GamePlaytime/RegistryClass/CollapsePlaytime.cs
+++ b/CollapseLauncher/Classes/GameManagement/GamePlaytime/RegistryClass/CollapsePlaytime.cs
@@ -30,28 +30,28 @@ internal class CollapsePlaytime
/// Default: TimeSpan.Zero
///
[JsonIgnore]
- public TimeSpan TotalPlaytime { get; private set; } = TimeSpan.Zero;
+ public TimeSpan TotalPlaytime { get; set; } = TimeSpan.Zero;
///
/// Represents the daily playtime.
/// The ControlDate field is used to check if this value should be reset.
/// Default: TimeSpan.Zero
///
- public TimeSpan DailyPlaytime { get; private set; } = TimeSpan.Zero;
+ public TimeSpan DailyPlaytime { get; set; } = TimeSpan.Zero;
///
/// Represents the weekly playtime.
/// The ControlDate field is used to check if this value should be reset.
/// Default: TimeSpan.Zero
///
- public TimeSpan WeeklyPlaytime { get; private set; } = TimeSpan.Zero;
+ public TimeSpan WeeklyPlaytime { get; set; } = TimeSpan.Zero;
///
/// Represents the monthly playtime.
/// The ControlDate field is used to check if this value should be reset.
/// Default: TimeSpan.Zero
///
- public TimeSpan MonthlyPlaytime { get; private set; } = TimeSpan.Zero;
+ public TimeSpan MonthlyPlaytime { get; set; } = TimeSpan.Zero;
///
/// Represents the total time the last/current session lasted.
@@ -71,14 +71,13 @@ internal class CollapsePlaytime
/// This date is used to check if a specific playtime statistic should be reset.
/// Default: DateTime.Today
///
- public DateTime ControlDate { get; private set; } = DateTime.Today;
+ public DateTime ControlDate { get; set; } = DateTime.Today;
#endregion
#region Methods
#nullable enable
///
- /// Reads from the Registry and deserializes the contents.
- /// Converts RegistryKey values if they are of type DWORD (that is, if they were saved by the old implementation).
+ /// Reads from the Registry and deserializes the contents.
///
public static CollapsePlaytime Load(RegistryKey root, int hashID)
{