More Experimental stuff with save files

Talen-Shei [08-09-15 - 17:37]
More Experimental stuff with save files
Filename
KeyBindSwapper.lua
diff --git a/KeyBindSwapper.lua b/KeyBindSwapper.lua
index 966b7e7..3658d0a 100644
--- a/KeyBindSwapper.lua
+++ b/KeyBindSwapper.lua
@@ -351,8 +351,12 @@ end


 function InitializePlugin ()
-	KBS.Character = ZO_SavedVars:New(KBS.SettingsFile, KBS.SAVED_VAR_VERSION, nil, KBS.Defaults.Character, nil)
-	KBS.Global = ZO_SavedVars:NewAccountWide(KBS.SettingsFile, KBS.SAVED_VAR_VERSION, nil, KBS.Defaults.Global, KBS.SVProfile)
+    if type(KeyBindSwapperSettings) ~= "table" then
+        KeyBindSwapperSettings = KBS.Defaults.Global
+    else
+        KBS.Global = KeyBindSwapperSettings
+    end
+	KBS.Character = ZO_SavedVars:New(KBS.SettingsFile, KBS.SAVED_VAR_VERSION, nil, KBS.Defaults.Character, KBS.SVProfile)
 	EVENT_MANAGER:UnregisterForEvent("KeyBindSwapper", EVENT_ADD_ON_LOADED)
 	if KBS.Character.SyncMode == "Automatic" then
 		setKeyBinds()