Skip to content

Commit

Permalink
Fix de-/serialisation of Timer colours
Browse files Browse the repository at this point in the history
  • Loading branch information
zorael committed Feb 24, 2025
1 parent 1d448ba commit 2d048cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/kameloso/plugins/timer.d
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public:
json["timeThreshold"] = JSONValue(this.timeThreshold);
json["messageCountStagger"] = JSONValue(this.messageCountStagger);
json["timeStagger"] = JSONValue(this.timeStagger);
json["colour"] = JSONValue(this.colour);
json["suspended"] = JSONValue(this.suspended);
json["lines"] = null;
json["lines"].array = null;
Expand Down Expand Up @@ -293,6 +294,9 @@ public:
// Be careful with suspended since it was not in the original JSON scheme
timer.suspended = json.getOrFallback("suspended", false);

// Likewise. Use the .init value as fallback
timer.colour = json.getOrFallback("colour", timer.colour);

foreach (const lineJSON; json["lines"].array)
{
timer.lines ~= lineJSON.str;
Expand Down

0 comments on commit 2d048cc

Please sign in to comment.