Fixed a bug where loading to a new area when the UI was off would unintentially saved settings in the off state.

Brad Lambert [06-04-18 - 05:25]
Fixed a bug where loading to a new area when the UI was off would unintentially saved settings in the off state.
Filename
UltimateUIHider/UltimateUIHider.lua
UltimateUIHider/UltimateUIHider.txt
diff --git a/UltimateUIHider/UltimateUIHider.lua b/UltimateUIHider/UltimateUIHider.lua
index 805faf1..e66b19c 100644
--- a/UltimateUIHider/UltimateUIHider.lua
+++ b/UltimateUIHider/UltimateUIHider.lua
@@ -1,6 +1,6 @@
 UltimateUIHider = {}
 UltimateUIHider.name = "UltimateUIHider"
-UltimateUIHider.version = 1.7002
+UltimateUIHider.version = 1.74

 UltimateUIHider.default = {
     isInterfaceEventHandler = 0,
@@ -34,8 +34,6 @@ function UltimateUIHider.setSettingsFromFile()

     SetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_ENABLED, UltimateUIHider.savedVariables.defaultChatBubbles)
     SetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_SPEED_MODIFIER, UltimateUIHider.savedVariables.defaultChatBubbleSpeed)
-
-
 end

 --Saves current settings to file.
@@ -52,7 +50,6 @@ function UltimateUIHider.saveSettingsToFile()
         UltimateUIHider.savedVariables.defaultAllNamePlates = GetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALL_NAMEPLATES)
         UltimateUIHider.savedVariables.defaultChatBubbles =  GetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_ENABLED)
         UltimateUIHider.savedVariables.defaultChatBubbleSpeed =  GetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_SPEED_MODIFIER)
-
     end
 end

@@ -68,6 +65,9 @@ end
 --Turns off UI
 --Sets all settings to zero.
 function UltimateUIHider.turnOffUI()
+-- Applying a patch to not save data when turning off the UI. This fixes problems when loading into new areas
+-- when the UI is in the off position.
+--[=====[
     SetSetting(SETTING_TYPE_IN_WORLD, IN_WORLD_UI_SETTING_INTERACTABLE_GLOW_ENABLED, 0)
     SetSetting(SETTING_TYPE_IN_WORLD, IN_WORLD_UI_SETTING_TARGET_GLOW_ENABLED, 0)
     SetSetting(SETTING_TYPE_UI, UI_SETTING_SHOW_QUEST_BESTOWER_INDICATORS, 0)
@@ -79,6 +79,18 @@ function UltimateUIHider.turnOffUI()
     SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALL_NAMEPLATES, 0)
     SetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_ENABLED, 0)
     SetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_SPEED_MODIFIER, 1)
+--]=====]
+    SetSetting(SETTING_TYPE_IN_WORLD, IN_WORLD_UI_SETTING_INTERACTABLE_GLOW_ENABLED, "false", DO_NOT_SAVE_TO_PERSISTED_DATA)
+    SetSetting(SETTING_TYPE_IN_WORLD, IN_WORLD_UI_SETTING_TARGET_GLOW_ENABLED, "false", DO_NOT_SAVE_TO_PERSISTED_DATA)
+    SetSetting(SETTING_TYPE_UI, UI_SETTING_SHOW_QUEST_BESTOWER_INDICATORS, "false", DO_NOT_SAVE_TO_PERSISTED_DATA)
+    SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_GROUP_INDICATORS, "false", DO_NOT_SAVE_TO_PERSISTED_DATA)
+    SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_FOLLOWER_INDICATORS, "false", DO_NOT_SAVE_TO_PERSISTED_DATA)
+    SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALLIANCE_INDICATORS, NAMEPLATE_CHOICE_NEVER, DO_NOT_SAVE_TO_PERSISTED_DATA)
+    SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_RESURRECT_INDICATORS, "false", DO_NOT_SAVE_TO_PERSISTED_DATA)
+    SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALL_HEALTHBARS, "false", DO_NOT_SAVE_TO_PERSISTED_DATA)
+    SetSetting(SETTING_TYPE_NAMEPLATES, NAMEPLATE_TYPE_ALL_NAMEPLATES, "false", DO_NOT_SAVE_TO_PERSISTED_DATA)
+    SetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_ENABLED, "false", DO_NOT_SAVE_TO_PERSISTED_DATA)
+    SetSetting(SETTING_TYPE_CHAT_BUBBLE, CHAT_BUBBLE_SETTING_SPEED_MODIFIER, "0.80000001")
 end

 --Toggle UI on an off.
@@ -132,4 +144,4 @@ end
 EVENT_MANAGER:RegisterForEvent(UltimateUIHider.name, EVENT_ADD_ON_LOADED, UltimateUIHider.OnAddOnLoaded)

 --Slash commands
-SLASH_COMMANDS["/hideui"] = UltimateUIHider.UltimateUIHiderToggler
\ No newline at end of file
+SLASH_COMMANDS["/hideui"] = UltimateUIHider.UltimateUIHiderToggler
diff --git a/UltimateUIHider/UltimateUIHider.txt b/UltimateUIHider/UltimateUIHider.txt
index 9456a34..cb8a939 100644
--- a/UltimateUIHider/UltimateUIHider.txt
+++ b/UltimateUIHider/UltimateUIHider.txt
@@ -1,8 +1,8 @@
 ## Title: UltimateUIHider
 ## Author: SilentShanx
 ## Description: This addon will allow you to hide your ui including player markers.
-## Version: 1.7002
-## APIVersion: 100015
+## Version: 1.74
+## APIVersion: 100022
 ## SavedVariables: UltimateUIHiderSavedVariables

 UltimateUIHider.lua