From 5af3499c56460eeba1cc04dc1c3d6bdad31c309a Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Wed, 6 Jan 2021 01:33:50 -0500
Subject: [PATCH] Fix skin change notification to include color reset

---
 indra/newview/app_settings/settings_alchemy.xml      | 11 +++++++++++
 indra/newview/llappviewer.cpp                        |  2 +-
 indra/newview/skins/default/xui/en/notifications.xml |  7 +++++++
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/indra/newview/app_settings/settings_alchemy.xml b/indra/newview/app_settings/settings_alchemy.xml
index 76db5db97bf..edf5441ff19 100644
--- a/indra/newview/app_settings/settings_alchemy.xml
+++ b/indra/newview/app_settings/settings_alchemy.xml
@@ -508,5 +508,16 @@
       <key>Value</key>
       <boolean>0</boolean>
     </map>
+    <key>ResetUserColorsOnLogout</key>
+    <map>
+      <key>Comment</key>
+      <string>Saves an empty color file on login to start fresh on next launch</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
   </map>
 </llsd>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index c536a73e5c1..31d981fd982 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1921,7 +1921,7 @@ bool LLAppViewer::cleanup()
 	// save their rects on delete.
 	gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
 
-	LLUIColorTable::instance().saveUserSettings();
+	LLUIColorTable::instance().saveUserSettings(gSavedSettings.getBool("ResetUserColorsOnLogout"));
 
 	// PerAccountSettingsFile should be empty if no user has been logged on.
 	// *FIX:Mani This should get really saved in a "logoff" mode.
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 912a6e62405..477c79988fc 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -1607,6 +1607,13 @@ This debug setting change will take effect after you restart [APP_NAME].
    name="ChangeSkin"
    type="alertmodal">
 The new skin will appear after you restart [APP_NAME].
+Would you like to reset modified colors back to their defaults?
+   <tag>confirm</tag>
+   <usetemplate
+    canceltext="Cancel"
+    name="yesnocancelbuttons"
+    notext="No"
+    yestext="Yes"/>
   </notification>
 
   <notification
-- 
GitLab