Version 1.6.0 (24-02-2018)

Jarth [02-24-18 - 13:54]
Version 1.6.0 (24-02-2018)
Filename
Changelog
SummonAssistant.lua
SummonAssistant.txt
SummonAssistant_Buttons.lua
SummonAssistant_Constants.lua
SummonAssistant_Fragments.lua
SummonAssistant_Hotkeys.lua
SummonAssistant_Menu.lua
SummonAssistant_Move.lua
diff --git a/Changelog b/Changelog
index 965d910..0d3ddfb 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,16 @@
 -------------------------------------------------------------------------------
 Summon Assistant
 -------------------------------------------------------------------------------
+Version 1.6.0 (24-02-2018)
+- Added checkbox to disable sound, when hovering the buttons
+- Refactored visibility and added checkboxes:
+-- Show bar in menu (default: false)
+-- Show bar on hud (default: true)
+--- Is the default hud
+-- Show bar on hudui (default: true)
+--- Activated with In-Game Cursor.
+- Tooltips updated for consistency.
+
 Version 1.5.0 (20-01-2018)
 - Restructured:
 -- Option to show the keybinding for each button.
diff --git a/SummonAssistant.lua b/SummonAssistant.lua
index 13ce1b2..6dea712 100644
--- a/SummonAssistant.lua
+++ b/SummonAssistant.lua
@@ -20,6 +20,7 @@ end
 function SummonAssistant.Initialize()
     -- Load saved values..
     SummonAssistant.Saved = ZO_SavedVars:New("SummonAssistant_Character", SummonAssistant.Addon.Version, nil, SummonAssistant.Default)
+
     if SummonAssistant.Saved.UseAccountSettings then
         SummonAssistant.Saved = ZO_SavedVars:NewAccountWide("SummonAssistant_Account", SummonAssistant.Addon.Version, nil, SummonAssistant.Default)
     end
@@ -38,26 +39,23 @@ function SummonAssistant:GetVersion(showMinor)
     if showMinor == false or SummonAssistant.Addon.MinorVersion == nil then
         return tostring(SummonAssistant.Addon.Version)
     end
+
     return tostring(SummonAssistant.Addon.Version) .. "." .. tostring(SummonAssistant.Addon.MinorVersion)
 end

 function SummonAssistant:RestorePanel()
-    SummonAssistant:SetFragmentBehaviour()
-
     SummonAssistant:SetButtonFrameWidth()
-
     SummonAssistant:InitializeButtons()
-
     SummonAssistant:ButtonsBackdropColor()
-
     SummonAssistant:RestorePosition()
-
     SummonAssistant:UpdateMoveFrame()
+    SummonAssistant:SetFragmentBehaviour()
 end

 function SummonAssistant:RestorePosition()
     local Top = SummonAssistant.Saved.Top
     local Left = SummonAssistant.Saved.Left
+
     SummonAssistant_Frame:ClearAnchors()
     SummonAssistant_Frame:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, Left, Top)
 end
diff --git a/SummonAssistant.txt b/SummonAssistant.txt
index c6b45ba..0a0ed3d 100644
--- a/SummonAssistant.txt
+++ b/SummonAssistant.txt
@@ -4,9 +4,9 @@
 ; States and/or other countries. All rights reserved.
 ; You can read the full terms at https://account.elderscrollsonline.com/add-on-terms

-## APIVersion: 100021 100022
+## APIVersion: 100022
 ## Title: SummonAssistant
-## Version: 1.5.0
+## Version: 1.6.0
 ## Author: Jarth
 ## Description: Summon assistant, by hotkey or button!
 ##
diff --git a/SummonAssistant_Buttons.lua b/SummonAssistant_Buttons.lua
index 7f1e498..c905ced 100644
--- a/SummonAssistant_Buttons.lua
+++ b/SummonAssistant_Buttons.lua
@@ -15,8 +15,12 @@ local SummonAssistant = SummonAssistant
 function SummonAssistant.ButtonHighlightEnter(frame)
     local highlightColor = SummonAssistant.Saved.HighlightColor
     local buttonBackdrop = GetControl(frame, "Backdrop")
+
     if buttonBackdrop ~= nil then
-        PlaySound(SOUNDS.QUICKSLOT_MOUSEOVER)
+        if SummonAssistant.Saved.IsAudioEnabled then
+            PlaySound(SOUNDS.QUICKSLOT_MOUSEOVER)
+        end
+
         buttonBackdrop:SetEdgeColor(highlightColor.r, highlightColor.g, highlightColor.b, highlightColor.a)
     end
 end
@@ -24,6 +28,7 @@ end
 function SummonAssistant.ButtonHighlightExit(frame)
     local edgeColor = SummonAssistant.Saved.EdgeColor
     local buttonBackdrop = GetControl(frame, "Backdrop")
+
     if buttonBackdrop ~= nil then
         buttonBackdrop:SetEdgeColor(edgeColor.r, edgeColor.g, edgeColor.b, edgeColor.a)
     end
@@ -31,6 +36,7 @@ end

 function SummonAssistant.ButtonOnClicked(button)
     local id = button:GetId()
+
     if id > 0 then
         if IsCollectibleUnlocked(id) then
             UseCollectible(id)
@@ -53,6 +59,7 @@ end

 function SummonAssistant:SetupButtonBinding(button, key, left, top)
     local buttonBinding = GetControl(button, "Binding")
+
     if buttonBinding ~= nil and SummonAssistant.Saved.ShowKeyBinding then
         SummonAssistant:HotkeyUpdateColor(buttonBinding)
         buttonBinding:SetText(SummonAssistant:HoykeyGetKey(SummonAssistant.Types[key].Name))
@@ -60,6 +67,7 @@ function SummonAssistant:SetupButtonBinding(button, key, left, top)
         buttonBinding:ClearAnchors()
         buttonBinding:SetAnchor(SummonAssistant.Saved.KeyBindingLocation, button, SummonAssistant.Saved.KeyBindingLocation, 0, 0)
     end
+
     if buttonBinding ~= nil then
         buttonBinding:SetHidden(not SummonAssistant.Saved.ShowKeyBinding)
     end
@@ -67,6 +75,7 @@ end

 function SummonAssistant:SetupButtonTexture(button, key, left, top)
     local buttonTexture = GetControl(button, "Texture")
+
     if buttonTexture ~= nil then
         button:SetHandler("OnClicked", SummonAssistant.ButtonOnClicked)
         buttonTexture:SetDrawLevel(3)
@@ -80,6 +89,7 @@ end

 function SummonAssistant:SetupButtonBackdrop(button, key, left, top)
     local buttonBackdrop = GetControl(button, "Backdrop")
+
     if buttonBackdrop ~= nil then
         buttonBackdrop:SetDrawLevel(2)
         buttonBackdrop:SetEdgeTexture(nil, 1, 1, SummonAssistant.Saved.Margin)
@@ -102,6 +112,7 @@ function SummonAssistant:SetButtonFrameWidth()
     if count > 0 then
         show = 1
     end
+
     height = SummonAssistant.Saved.Height * (SummonAssistant.Saved.Horizontal and show or count)
     width = SummonAssistant.Saved.Width * (SummonAssistant.Saved.Horizontal and count or show)

@@ -123,11 +134,13 @@ function SummonAssistant:InitializeButtons()
         local id = _value.Id
         local key = _value.Name
         local left, top = SummonAssistant:GetButtonPosition(index)
+
         if SummonAssistant.Saved.ShowAssistants[id] and IsCollectibleUnlocked(_value.Id) then
             if SummonAssistant.Buttons[key] == nil then
                 SummonAssistant.Buttons[key] = WINDOW_MANAGER:CreateControlFromVirtual("SummonAssistant_Button", SummonAssistant_Frame, "SummonAssistant_Button", key)
                 SummonAssistant.Buttons[key]:SetId(id)
             end
+
             SummonAssistant:SetupButton(SummonAssistant.Buttons[key], left, top)
             SummonAssistant:SetupButtonBinding(SummonAssistant.Buttons[key], key, left, top)
             SummonAssistant:SetupButtonBackdrop(SummonAssistant.Buttons[key], key, left, top)
@@ -144,10 +157,12 @@ end
 function SummonAssistant:GetButtonPosition(index)
     local left = 0
     local top = SummonAssistant.Saved.Height * (index - 1)
+
     if SummonAssistant.Saved.Horizontal then
         left = SummonAssistant.Saved.Width * (index - 1)
         top = 0
     end
+
     return left, top
 end

@@ -158,6 +173,7 @@ function SummonAssistant:ButtonsBackdropColor()
     for _, _value in ipairs(SummonAssistant.OrderedTypes) do
         if SummonAssistant.Buttons[_value.Name] ~= nil then
             local buttonBackdrop = GetControl(SummonAssistant.Buttons[_value.Name], "Backdrop")
+
             if buttonBackdrop ~= nil then
                 buttonBackdrop:SetCenterColor(centerColor.r, centerColor.g, centerColor.b, centerColor.a)
                 buttonBackdrop:SetEdgeColor(edgeColor.r, edgeColor.g, edgeColor.b, edgeColor.a)
diff --git a/SummonAssistant_Constants.lua b/SummonAssistant_Constants.lua
index 077a4ec..7880ce0 100644
--- a/SummonAssistant_Constants.lua
+++ b/SummonAssistant_Constants.lua
@@ -11,7 +11,7 @@ SummonAssistant = {}
 SummonAssistant.Addon = {
     Name = "SummonAssistant",
     DisplayName = "Summon Assistant",
-    Version = 1.5,
+    Version = 1.6,
     MinorVersion = 0,
     SlashCommand = "/sa",
     Author = "Jarth",
@@ -29,7 +29,9 @@ SummonAssistant.Default = {
     FontColor = {r = 0.9, g = 0.9, b = 0.9, a = 0.9},
     UseAccountSettings = true,
     Horizontal = true,
-    HideBarInMenu = true,
+    ShowBarInMenu = false,
+    ShowBarOnHud = true,
+    ShowBarOnHudUI = true,
     Margin = 2,
     Height = 60,
     Width = 60,
@@ -40,7 +42,8 @@ SummonAssistant.Default = {
         [301] = IsCollectibleUnlocked(301)
     },
     KeyBindingLocation = BOTTOM,
-    ShowKeyBinding = true
+    ShowKeyBinding = true,
+    IsAudioEnabled = true
 }
 SummonAssistant.Global = {
     IsMoveEnabled = false,
diff --git a/SummonAssistant_Fragments.lua b/SummonAssistant_Fragments.lua
index 8037dbd..b332c89 100644
--- a/SummonAssistant_Fragments.lua
+++ b/SummonAssistant_Fragments.lua
@@ -11,32 +11,46 @@ local SummonAssistant = SummonAssistant
 -------------------------------------------------------------------------------------------------
 -- PRIVATE FUNCTIONS --
 -------------------------------------------------------------------------------------------------
-function SummonAssistant:SetFragmentBehaviour(menuOpen)
-    if SummonAssistant.Fragment == nil then
-        SummonAssistant.Fragment = ZO_HUDFadeSceneFragment:New(SummonAssistant_Frame)
+function SummonAssistant:SetFragmentBehaviour()
+    local base = SummonAssistant
+    local frame = SummonAssistant_Frame
+    local saved = base.Saved
+    local fragment = base.Fragment
+    local currentScene = SCENE_MANAGER:GetCurrentScene()
+    local frameIsHidden = true
+
+    if fragment == nil then
+        base.Fragment = ZO_HUDFadeSceneFragment:New(frame)
+        fragment = base.Fragment
     end

-    if SummonAssistant.Saved.HideBarInMenu then
-        SummonAssistant:AddControlToFrame(menuOpen)
+    if saved.ShowBarInMenu then
+        SCENE_MANAGER:GetScene("gameMenuInGame"):AddFragment(fragment)
+
+        -- Case where the user changes visibility in the settings
+        if currentScene ~= nil and currentScene:GetName() == "gameMenuInGame" then
+            frameIsHidden = false
+        end
     else
-        SummonAssistant:RemoveControlToFrame(menuOpen)
+        SCENE_MANAGER:GetScene("gameMenuInGame"):RemoveFragment(fragment)
     end
-end

-function SummonAssistant:AddControlToFrame(menuOpen)
-    if menuOpen then
-        SummonAssistant_Frame:SetHidden(true)
-    end
+    if saved.ShowBarOnHud then
+        HUD_SCENE:AddFragment(fragment)

-    SCENE_MANAGER:GetScene("hud"):AddFragment(SummonAssistant.Fragment)
-    SCENE_MANAGER:GetScene("hudui"):AddFragment(SummonAssistant.Fragment)
-end
+        -- Case when landing on a scene, before a transition
+        if currentScene == nil then
+            frameIsHidden = false
+        end
+    else
+        HUD_SCENE:RemoveFragment(fragment)
+    end

-function SummonAssistant:RemoveControlToFrame(menuOpen)
-    if menuOpen then
-        SummonAssistant_Frame:SetHidden(false)
+    if saved.ShowBarOnHudUI then
+        HUD_UI_SCENE:AddFragment(fragment)
+    else
+        HUD_UI_SCENE:RemoveFragment(fragment)
     end

-    SCENE_MANAGER:GetScene("hud"):RemoveFragment(SummonAssistant.Fragment)
-    SCENE_MANAGER:GetScene("hudui"):RemoveFragment(SummonAssistant.Fragment)
+    frame:SetHidden(frameIsHidden)
 end
diff --git a/SummonAssistant_Hotkeys.lua b/SummonAssistant_Hotkeys.lua
index afbeb05..66aa780 100644
--- a/SummonAssistant_Hotkeys.lua
+++ b/SummonAssistant_Hotkeys.lua
@@ -21,8 +21,10 @@ end

 function SummonAssistant:HoykeyGetKey(keyBinding)
     local result = ""
+
     if keyBinding then
         local keyBindingTable = {GetHighestPriorityActionBindingInfoFromName("SummonAssistant_" .. keyBinding)}
+
         for _, keyValue in pairs(keyBindingTable) do
             if keyValue > 0 then
                 result = SummonAssistant:HotkeyGetKeyName(result, keyValue)
@@ -45,11 +47,13 @@ end

 function SummonAssistant:HotkeyUpdateColor(frame)
     local fontColor = SummonAssistant.Saved.FontColor
+
     frame:SetColor(fontColor.r, fontColor.g, fontColor.b, fontColor.a)
 end

 function SummonAssistant:HotKeyGetLocationValue(value)
     local result
+
     if value == "bottom" then
         result = BOTTOM
     elseif value == "bottomleft" then
@@ -69,11 +73,13 @@ function SummonAssistant:HotKeyGetLocationValue(value)
     elseif value == "topright" then
         result = TOPRIGHT
     end
+
     return result
 end

 function SummonAssistant:HotKeyGetLocationText(value)
     local result
+
     if value == BOTTOM then
         result = "bottom"
     elseif value == BOTTOMLEFT then
@@ -93,5 +99,6 @@ function SummonAssistant:HotKeyGetLocationText(value)
     elseif value == TOPRIGHT then
         result = "topright"
     end
+
     return result
 end
diff --git a/SummonAssistant_Menu.lua b/SummonAssistant_Menu.lua
index 1ae648f..40dd189 100644
--- a/SummonAssistant_Menu.lua
+++ b/SummonAssistant_Menu.lua
@@ -35,7 +35,7 @@ function SummonAssistant:CreateSettingsWindow()
         },
         [2] = {
             type = "description",
-            text = string.format("Here you can adjust the %s works.\nSlash command: %s", SummonAssistant.Addon.DisplayName, SummonAssistant.Addon.SlashCommand)
+            text = string.format("Here you can setup %s.\nSlash command: %s", SummonAssistant.Addon.DisplayName, SummonAssistant.Addon.SlashCommand)
         },
         [3] = {
             type = "checkbox",
@@ -57,39 +57,28 @@ function SummonAssistant:CreateSettingsWindow()
             end
         },
         [4] = {
-            type = "checkbox",
-            name = "Bar orientation horizontal",
-            tooltip = "When ON the bar will orientate horizontally.",
-            default = SummonAssistant.Default.Horizontal,
-            getFunc = function()
-                return SummonAssistant.Saved.Horizontal
-            end,
-            setFunc = function(newValue)
-                SummonAssistant.Saved.Horizontal = newValue
-                SummonAssistant:RestorePanel()
-            end
+            type = "submenu",
+            name = "Assistants",
+            tooltip = "Allows you to choose what assistant buttons you wants to see.",
+            controls = {
+                [1] = {
+                    type = "description",
+                    text = "Choose what assistant buttons you want to see."
+                }
+            }
         },
         [5] = {
-            type = "checkbox",
-            name = "Hide bar in menu",
-            tooltip = "When ON the bar will hide when a menu is opened.",
-            default = SummonAssistant.Default.HideBarInMenu,
-            getFunc = function()
-                return SummonAssistant.Saved.HideBarInMenu
-            end,
-            setFunc = function(newValue)
-                SummonAssistant.Saved.HideBarInMenu = newValue
-                SummonAssistant:SetFragmentBehaviour(true)
-            end
-        },
-        [6] = {
             type = "submenu",
             name = "Position and size",
-            tooltip = "Settings regarding position and size.",
+            tooltip = "Setup position and size.",
             controls = {
                 [1] = {
+                    type = "description",
+                    text = "Here you can setup position and size \n(Unlock to move the bar)."
+                },
+                [2] = {
                     type = "checkbox",
-                    name = "Show bar position",
+                    name = "Unlock bar",
                     tooltip = "When ON the bar will show the X,Y position of the top left corner, when the mouse enters and drags the panel around.",
                     disabled = function()
                         local count = 0
@@ -115,7 +104,20 @@ function SummonAssistant:CreateSettingsWindow()
                         SummonAssistant:RestorePanel()
                     end
                 },
-                [2] = {
+                [3] = {
+                    type = "checkbox",
+                    name = "Bar orientation horizontal",
+                    tooltip = "When ON the bar will orientate horizontally.",
+                    default = SummonAssistant.Default.Horizontal,
+                    getFunc = function()
+                        return SummonAssistant.Saved.Horizontal
+                    end,
+                    setFunc = function(newValue)
+                        SummonAssistant.Saved.Horizontal = newValue
+                        SummonAssistant:RestorePanel()
+                    end
+                },
+                [4] = {
                     type = "slider",
                     name = "Choose button margin",
                     tooltip = "It is at this time, 'not possible' to move/drag the frame, when the margin is set to 0",
@@ -130,7 +132,7 @@ function SummonAssistant:CreateSettingsWindow()
                     min = 1,
                     max = 50
                 },
-                [3] = {
+                [5] = {
                     type = "slider",
                     name = "Choose button height",
                     default = SummonAssistant.Default.Height,
@@ -144,7 +146,7 @@ function SummonAssistant:CreateSettingsWindow()
                     min = 1,
                     max = 100
                 },
-                [4] = {
+                [6] = {
                     type = "slider",
                     name = "Choose button width",
                     default = SummonAssistant.Default.Width,
@@ -158,7 +160,7 @@ function SummonAssistant:CreateSettingsWindow()
                     min = 1,
                     max = 100
                 },
-                [5] = {
+                [7] = {
                     type = "slider",
                     name = "Choose snap size when moving",
                     default = SummonAssistant.Default.SnapSize,
@@ -172,7 +174,7 @@ function SummonAssistant:CreateSettingsWindow()
                     min = 1,
                     max = 10
                 },
-                [6] = {
+                [8] = {
                     type = "checkbox",
                     name = "Show hotkey's on bar",
                     tooltip = "When ON the hotkey's will be shown on the bar.",
@@ -186,7 +188,7 @@ function SummonAssistant:CreateSettingsWindow()
                     end,
                     width = "half"
                 },
-                [7] = {
+                [9] = {
                     type = "dropdown",
                     name = "Hotkey label location",
                     tooltip = "Select hotkey label location",
@@ -203,39 +205,25 @@ function SummonAssistant:CreateSettingsWindow()
                         SummonAssistant:RestorePanel()
                     end,
                     width = "half"
-                },
-                [8] = {
-                    type = "colorpicker",
-                    name = "Font Color",
-                    default = SummonAssistant.Default.FontColor,
-                    tooltip = "Changes of the bar font color.",
-                    getFunc = function()
-                        return SummonAssistant.Saved.FontColor.r, SummonAssistant.Saved.FontColor.g, SummonAssistant.Saved.FontColor.b, SummonAssistant.Saved.FontColor.a
-                    end,
-                    setFunc = function(r, g, b, a)
-                        SummonAssistant.Saved.FontColor = {r = r, g = g, b = b, a = a}
-                        SummonAssistant:RestorePanel()
-                    end,
-                    width = "half"
                 }
             }
         },
-        [7] = {
+        [6] = {
             type = "submenu",
             name = "Colors",
-            tooltip = "Allows you to change colors.",
+            tooltip = "Setup button and frame font colors.",
             controls = {
                 [1] = {
                     type = "description",
-                    text = "Here you can adjust the colors."
+                    text = "Here you can setup the button and frame font colors."
                 },
                 [2] = {
                     type = "colorpicker",
                     name = "Button background Color",
+                    tooltip = "Changes the background color of the buttons.",
                     default = function()
                         return SummonAssistant.Default.CenterColor
                     end,
-                    tooltip = "Changes the background color of the buttons.",
                     getFunc = function()
                         return SummonAssistant.Saved.CenterColor.r, SummonAssistant.Saved.CenterColor.g, SummonAssistant.Saved.CenterColor.b, SummonAssistant.Saved.CenterColor.a
                     end,
@@ -248,10 +236,10 @@ function SummonAssistant:CreateSettingsWindow()
                 [3] = {
                     type = "colorpicker",
                     name = "Button edge Color",
+                    tooltip = "Changes the edgecolor of the buttons.",
                     default = function()
                         return SummonAssistant.Default.EdgeColor
                     end,
-                    tooltip = "Changes the edgecolor of the buttons.",
                     getFunc = function()
                         return SummonAssistant.Saved.EdgeColor.r, SummonAssistant.Saved.EdgeColor.g, SummonAssistant.Saved.EdgeColor.b, SummonAssistant.Saved.EdgeColor.a
                     end,
@@ -264,10 +252,10 @@ function SummonAssistant:CreateSettingsWindow()
                 [4] = {
                     type = "colorpicker",
                     name = "Button highlight Color",
+                    tooltip = "Changes the highlight color of the buttons.",
                     default = function()
                         return SummonAssistant.Default.HighlightColor
                     end,
-                    tooltip = "Changes the highlight color of the buttons.",
                     getFunc = function()
                         return SummonAssistant.Saved.HighlightColor.r, SummonAssistant.Saved.HighlightColor.g, SummonAssistant.Saved.HighlightColor.b, SummonAssistant.Saved.HighlightColor.a
                     end,
@@ -276,17 +264,91 @@ function SummonAssistant:CreateSettingsWindow()
                         SummonAssistant:RestorePanel()
                     end,
                     width = "half"
+                },
+                [5] = {
+                    type = "colorpicker",
+                    name = "Frame font color",
+                    default = SummonAssistant.Default.FontColor,
+                    tooltip = "Changes of the frame font color.",
+                    getFunc = function()
+                        return SummonAssistant.Saved.FontColor.r, SummonAssistant.Saved.FontColor.g, SummonAssistant.Saved.FontColor.b, SummonAssistant.Saved.FontColor.a
+                    end,
+                    setFunc = function(r, g, b, a)
+                        SummonAssistant.Saved.FontColor = {r = r, g = g, b = b, a = a}
+                        SummonAssistant:RestorePanel()
+                    end,
+                    width = "half"
+                }
+            }
+        },
+        [7] = {
+            type = "submenu",
+            name = "Audio",
+            tooltip = "Setup audio.",
+            controls = {
+                [1] = {
+                    type = "description",
+                    text = "Here you can setup the audio."
+                },
+                [2] = {
+                    type = "checkbox",
+                    name = "Play hover audio",
+                    tooltip = "When ON hover events on the bar, will play audio.",
+                    default = function()
+                        return SummonAssistant.Global.IsAudioEnabled
+                    end,
+                    getFunc = function()
+                        return SummonAssistant.Saved.IsAudioEnabled
+                    end,
+                    setFunc = function(newValue)
+                        SummonAssistant.Saved.IsAudioEnabled = newValue
+                    end
                 }
             }
         },
         [8] = {
             type = "submenu",
             name = "Visibility",
-            tooltip = "Allows you to choose what assistant buttons you wants to see.",
+            tooltip = "Setup visibility",
             controls = {
                 [1] = {
-                    type = "description",
-                    text = "Select assistant buttons you want enabled."
+                    type = "checkbox",
+                    name = "Show bar in menu",
+                    tooltip = "When ON the bar will show when a menu is opened.",
+                    default = SummonAssistant.Default.ShowBarInMenu,
+                    getFunc = function()
+                        return SummonAssistant.Saved.ShowBarInMenu
+                    end,
+                    setFunc = function(newValue)
+                        SummonAssistant.Saved.ShowBarInMenu = newValue
+                        SummonAssistant:SetFragmentBehaviour()
+                    end
+                },
+                [2] = {
+                    type = "checkbox",
+                    name = "Show bar on hud",
+                    tooltip = "When ON the bar will show the bar on the hud.",
+                    default = SummonAssistant.Default.ShowBarOnHud,
+                    getFunc = function()
+                        return SummonAssistant.Saved.ShowBarOnHud
+                    end,
+                    setFunc = function(newValue)
+                        SummonAssistant.Saved.ShowBarOnHud = newValue
+                        SummonAssistant:SetFragmentBehaviour()
+                    end
+                },
+                [3] = {
+                    type = "checkbox",
+                    name = "Show bar in hudui",
+                    tooltip = "When ON the bar will show the bar on the hudui.",
+                    default = SummonAssistant.Default.ShowBarOnHudUI,
+                    getFunc = function()
+                        return SummonAssistant.Saved.ShowBarOnHudUI
+                    end,
+                    setFunc = function(newValue)
+                        SummonAssistant.Saved.ShowBarOnHudUI = newValue
+                        SummonAssistant:SetFragmentBehaviour()
+                    end
                 }
             }
         }
@@ -307,7 +369,8 @@ function SummonAssistant:CreateSettingsWindow()
                 SummonAssistant:RestorePanel()
             end
         }
-        table.insert(optionsData[8].controls, index + 1, line)
+        table.insert(optionsData[4].controls, index + 1, line)
     end
+
     LAM2:RegisterOptionControls(SummonAssistant.Addon.Name, optionsData)
 end
diff --git a/SummonAssistant_Move.lua b/SummonAssistant_Move.lua
index e95cf2f..b80e3ab 100644
--- a/SummonAssistant_Move.lua
+++ b/SummonAssistant_Move.lua
@@ -15,6 +15,7 @@ local SummonAssistant = SummonAssistant
 function SummonAssistant:UpdateMoveFrame()
     local moveFrame = SummonAssistant.MoveFrame
     local onMouseEnter, onMouseExit, onMouseDown, onMouseUp = nil, nil, nil, nil
+
     if SummonAssistant.Global.IsMoveEnabled then
         moveFrame = SummonAssistant:GetOrCreateMoveFrame()
         onMouseEnter = SummonAssistant.MoveFrameOnEnter
@@ -46,6 +47,7 @@ function SummonAssistant:GetOrCreateMoveFrame(show)
     if SummonAssistant.MoveFrame == nil then
         local newMoveFrame = SummonAssistant.WM:CreateControlFromVirtual(nil, GuiRoot, "SummonAssistant_MoveFrame")
         local targetFrame = SummonAssistant_Frame
+
         --Variable is used to define what savedVariable the Frame refers to.
         newMoveFrame.TargetFrame = targetFrame

@@ -85,6 +87,7 @@ function SummonAssistant:GetOrCreateMoveFrame(show)

         SummonAssistant.MoveFrame = newMoveFrame
     end
+
     return SummonAssistant.MoveFrame
 end

@@ -115,7 +118,9 @@ end

 function SummonAssistant.MoveFrameUpdateText(frame, position)
     local labelTextTopLeft = ""
+
     frame.labelCenter:SetText(string.format("%s,%s", frame:GetWidth(), frame:GetHeight()))
+
     if (position) then
         labelTextTopLeft = string.format("%s,%s", frame.TargetFrame:GetLeft(), frame.TargetFrame:GetTop())
     end
@@ -142,6 +147,7 @@ function SummonAssistant.MoveFrameUpdateColor(frame)
     local centerColor = SummonAssistant.Saved.CenterColor
     local edgeColor = SummonAssistant.Saved.EdgeColor
     local fontColor = SummonAssistant.Saved.FontColor
+
     frame.overlay:SetCenterColor(centerColor.r, centerColor.g, centerColor.b, centerColor.a)
     frame.overlay:SetEdgeColor(edgeColor.r, edgeColor.g, edgeColor.b, edgeColor.a)
     frame.labelCenter:SetColor(fontColor.r, fontColor.g, fontColor.b, fontColor.a)