From b7b913c5c66c1ecc87ce9a46598f234f11cd115e Mon Sep 17 00:00:00 2001
From: DeadlyKitten <9684760+DeadlyKitten@users.noreply.github.com>
Date: Mon, 1 May 2023 20:47:10 -0700
Subject: [PATCH] Added check to ensure anniversary theme is only applied once.
---
ModAssistant/App.config | 3 +++
ModAssistant/Classes/Themes.cs | 3 ++-
ModAssistant/Properties/Settings.Designer.cs | 19 +++++++++++++++++--
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/ModAssistant/App.config b/ModAssistant/App.config
index 39cbd6aa..7372b3d4 100644
--- a/ModAssistant/App.config
+++ b/ModAssistant/App.config
@@ -47,6 +47,9 @@
+
+ False
+
True
diff --git a/ModAssistant/Classes/Themes.cs b/ModAssistant/Classes/Themes.cs
index ee306df7..27d4bccc 100644
--- a/ModAssistant/Classes/Themes.cs
+++ b/ModAssistant/Classes/Themes.cs
@@ -115,8 +115,9 @@ public static void LoadThemes()
/// Theme name retrieved from the settings file.
public static void FirstLoad(string savedTheme)
{
- if (DateTime.Now.Date.ToString("MM/yyyy") == "05/2023")
+ if (!Properties.Settings.Default.AppliedAnniversaryTheme && DateTime.Now.Date.ToString("MM/yyyy") == "05/2023")
{
+ Properties.Settings.Default.AppliedAnniversaryTheme = true;
ApplyTheme("Anniversary", false);
return;
}
diff --git a/ModAssistant/Properties/Settings.Designer.cs b/ModAssistant/Properties/Settings.Designer.cs
index a668f42b..618186d4 100644
--- a/ModAssistant/Properties/Settings.Designer.cs
+++ b/ModAssistant/Properties/Settings.Designer.cs
@@ -1,4 +1,4 @@
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
@@ -166,7 +166,22 @@ public string SelectedTheme {
this["SelectedTheme"] = value;
}
}
-
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool AppliedAnniversaryTheme
+ {
+ get
+ {
+ return ((bool)(this["AppliedAnniversaryTheme"]));
+ }
+ set
+ {
+ this["AppliedAnniversaryTheme"] = value;
+ }
+ }
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]