Made some minor updates in hope of solving the issue where custom text-colour cannot be saved.

Richard Atterfalk [03-11-19 - 07:46]
Made some minor updates in hope of solving the issue where custom text-colour cannot be saved.
Filename
toxicIRC.lua
toxicIRC.txt
diff --git a/toxicIRC.lua b/toxicIRC.lua
index 0fb12c2..8f6db1e 100644
--- a/toxicIRC.lua
+++ b/toxicIRC.lua
@@ -20,7 +20,8 @@ local optionsData = {
             setFunc = function(r,g,b,a) toxicIRCAddon.savedVariables.colors.r=r, toxicIRCAddon.savedVariables.colors.g=g, toxicIRCAddon.savedVariables.colors.b=b end,
             tooltip = "Set the color of the text.",
             width = "full",
-            requiresReload = false, -- boolean, if set to true, the warning text will contain a notice that changes are only applied after an UI reload and any change to the value will make the "Apply Settings" button appear on the panel which will reload the UI when pressed (optional)
+
+            requiresReload = true, -- boolean, if set to true, the warning text will contain a notice that changes are only applied after an UI reload and any change to the value will make the "Apply Settings" button appear on the panel which will reload the UI when pressed (optional)
             -- default = {r = defaults.r, g = defaults.g, b = defaults.b, a = defaults.a}, --(optional) table of default color values (or default = defaultColor, where defaultColor is a table with keys of r, g, b[, a]) or a function that returns the color
             -- reference = "MyAddonColorpicker" -- unique global reference to control (optional)
     }
@@ -43,7 +44,6 @@ function toxicIRCAddon:checkName(msg)
             end
         end
     end
-    return nil
 end

 function toxicIRCAddon:IRCStyle(text)
@@ -80,9 +80,11 @@ function toxicIRCAddon:Initialize()
     end)

     defaults = {
-        r = 1,
-        g = 1,
-        b = 0
+        colors = {
+            r = 1,
+            g = 1,
+            b = 0
+        }
     }

     self.savedVariables = ZO_SavedVars:New("toxicIRCSavedVariables", 1, nil, defaults)
diff --git a/toxicIRC.txt b/toxicIRC.txt
index 63378c0..dfcb46e 100644
--- a/toxicIRC.txt
+++ b/toxicIRC.txt
@@ -1,7 +1,7 @@
 ## Title: ToxicIRC
 ## Author: ToxicSky
 ## Version: 0.9
-## APIVersion: 100025
+## APIVersion: 100026
 ## SavedVariables: toxicIRCSavedVariables
 ## Description: Adds a different colour of your name when someone writes it. This is to keep better track of conversations, no matter if it is in zone-, guild or group-chat.
 ## DependsOn: LibAddonMenu-2.0