Version 1.0.7 (07-02-2020)

Jarth [02-07-20 - 18:01]
Version 1.0.7 (07-02-2020)
-- Fixed issue when reloading the list of Collectibles, with no collection type selected
-- Increased width of settings tabs, to allow for the full text: "Collection Types"
-- Added tooltip text to the cog inside "Collection Types", and changed the wording of the text
Filename
CBs_Settings.lua
CBs_Settings.xml
CBs_Settings_Data.lua
CBs_Settings_List.lua
diff --git a/CBs_Settings.lua b/CBs_Settings.lua
index a99cd23..bcc3637 100644
--- a/CBs_Settings.lua
+++ b/CBs_Settings.lua
@@ -10,11 +10,7 @@ local base = CollectionBars
 -------------------------------------------------------------------------------------------------
 -- FUNCTIONS --
 -------------------------------------------------------------------------------------------------
-function base.InitializeSettingsSlash()
-    SLASH_COMMANDS[base.Addon.SettingsSlash] = function()
-        base.ShowSettings()
-    end
-end
+function base.InitializeSettingsSlash() SLASH_COMMANDS[base.Addon.SettingsSlash] = function() base.ShowSettings() end end

 function base.ToggleEnableSettings()
     base.Global.EnableSettings = not base.Global.EnableSettings
@@ -25,18 +21,14 @@ end
 function base.SetupToggleSettings(_type)
     local toggleSettings = GetControl(base.Global.HideAllId .. _type.Name .. "ToggleSettings")
     if toggleSettings then
-        local hideAllSettingsFunc = function()
-            base.ShowSettings(_type)
-        end
+        local hideAllSettingsFunc = function() base.ShowSettings(_type) end
         toggleSettings:SetHandler("OnClicked", hideAllSettingsFunc)
     end
 end

 function base.UpdateToggleSettings(_type)
     local offsetX = 0
-    if base.Global.EnableSettings then
-        offsetX = -19
-    end
+    if base.Global.EnableSettings then offsetX = -19 end

     if _type.FrameLabel and _type.FrameToggleSettings then
         _type.FrameToggleSettings:ClearAnchors()
@@ -53,12 +45,8 @@ end
 function base.SetupSettingsFrameHandlers(control, text, onClicked)
     control.tooltipText = text
     control:SetHandler("OnClicked", onClicked)
-    control:SetHandler("OnMouseEnter", function(_control)
-        ZO_Tooltips_ShowTextTooltip(_control, BOTTOM, _control.tooltipText)
-    end)
-    control:SetHandler("OnMouseExit", function()
-        ZO_Tooltips_HideTextTooltip()
-    end)
+    control:SetHandler("OnMouseEnter", function(_control) ZO_Tooltips_ShowTextTooltip(_control, BOTTOM, _control.tooltipText) end)
+    control:SetHandler("OnMouseExit", function() ZO_Tooltips_HideTextTooltip() end)
 end

 function base.SetupSetttingsFrame(_type)
@@ -72,11 +60,7 @@ function base.SetupSetttingsFrame(_type)
     titleControl:SetText(base.Addon.DisplayName .. " Settings")

     local closeFrame = GetControl(base.Global.SettingsFrame, "Close")
-    if closeFrame then
-        base.SetupSettingsFrameHandlers(closeFrame, "Close", function(buttonControl)
-            buttonControl:GetParent():SetHidden(true)
-        end)
-    end
+    if closeFrame then base.SetupSettingsFrameHandlers(closeFrame, "Close", function(buttonControl) buttonControl:GetParent():SetHidden(true) end) end
     local moveFrame = GetControl(base.Global.SettingsFrame, "Move")
     if moveFrame then
         base.SetupSettingsFrameHandlers(moveFrame, "Toggle move frame", function()
@@ -87,17 +71,17 @@ function base.SetupSetttingsFrame(_type)
     end
     local refreshFrame = GetControl(base.Global.SettingsFrame, "Refresh")
     if refreshFrame then
-        base.SetupSettingsFrameHandlers(refreshFrame, "Reload collection list", function()
-            base.CreateCollection(_type)
-            base.RestoreFrame(_type)
+        base.SetupSettingsFrameHandlers(refreshFrame, "Reload list of 'Collectibles'\nHint: Usefull after gaining a new collectible)", function()
+            if base.Global.SettingsList._type ~= nil then
+                base.CreateCollection(base.Global.SettingsList._type)
+                base.RestoreFrame(base.Global.SettingsList._type)
+            end
             base.RestoreCombineLabels()
             base.Global.SettingsList:RefreshData()
         end)
     end

-    for controlName, displayName in pairs(base.Global.SettingsFilters) do
-        base.SetupSettingsFilter(base.Global.SettingsFrame, controlName, displayName)
-    end
+    for controlName, displayName in pairs(base.Global.SettingsFilters) do base.SetupSettingsFilter(base.Global.SettingsFrame, controlName, displayName) end
 end

 function base.SetupSettingsFilter(control, controlName, displayName)
@@ -113,9 +97,7 @@ end

 function base.ShowSettings(_type)
     local show = base.Global.SettingsFrame == nil
-    if show then
-        base.SetupSetttingsFrame(_type)
-    end
+    if show then base.SetupSetttingsFrame(_type) end

     show = show or base.Global.SettingsFrame:IsHidden() or _type ~= base.Global.SettingsList._type
     base.Global.SettingsFrame:SetHidden(not show)
@@ -127,7 +109,7 @@ function base.ShowSettings(_type)
 end

 function base.UpdateSettingsType(show, _type)
-    if base.Global.SettingsLabel ~= nil then
-        base.Global.SettingsLabel:SetText(show and _type and _type.Name or "Global")
-    end
+    if base.Global.SettingsList ~= nil then base.Global.SettingsList._type = _type end
+
+    if base.Global.SettingsLabel ~= nil then base.Global.SettingsLabel:SetText(show and _type and _type.Name or "Global") end
 end
diff --git a/CBs_Settings.xml b/CBs_Settings.xml
index e670c0b..170f115 100644
--- a/CBs_Settings.xml
+++ b/CBs_Settings.xml
@@ -27,23 +27,23 @@

         <Button name="$(parent)General" inherits="ZO_DefaultButton" clickSound="Click" relativeTo="$(parent)">
           <Anchor point="TOPLEFT" relativeTo="$(parent)Label" relativePoint="BOTTOMLEFT" offsetY="15"/>
-          <Dimensions x="120" y="22" />
+          <Dimensions x="122" y="22" />
         </Button>
         <Button name="$(parent)CollectionTypes" inherits="ZO_DefaultButton" clickSound="Click" relativeTo="$(parent)">
           <Anchor point="TOPLEFT" relativeTo="$(parent)General" relativePoint="TOPRIGHT" />
-          <Dimensions x="120" y="22" />
+          <Dimensions x="122" y="22" />
         </Button>
         <Button name="$(parent)Selection" inherits="ZO_DefaultButton" clickSound="Click" relativeTo="$(parent)">
           <Anchor point="TOPLEFT" relativeTo="$(parent)CollectionTypes" relativePoint="TOPRIGHT" />
-          <Dimensions x="120" y="22" />
+          <Dimensions x="122" y="22" />
         </Button>
         <Button name="$(parent)Collection" inherits="ZO_DefaultButton" clickSound="Click" relativeTo="$(parent)">
           <Anchor point="TOPLEFT" relativeTo="$(parent)Selection" relativePoint="TOPRIGHT" />
-          <Dimensions x="120" y="22" />
+          <Dimensions x="122" y="22" />
         </Button>
         <Button name="$(parent)Combined" inherits="ZO_DefaultButton" clickSound="Click" relativeTo="$(parent)">
           <Anchor point="BOTTOMLEFT" relativeTo="$(parent)Collection" relativePoint="TOPLEFT" offsetY="-5" />
-          <Dimensions x="120" y="22" />
+          <Dimensions x="122" y="22" />
         </Button>

         <Control name="$(parent)List" inherits="ZO_ScrollList">
diff --git a/CBs_Settings_Data.lua b/CBs_Settings_Data.lua
index 37723c6..dd58db2 100644
--- a/CBs_Settings_Data.lua
+++ b/CBs_Settings_Data.lua
@@ -289,7 +289,7 @@ function base.AppendMasterListTypeCollectionTypes(self, typeSelection)
         self:AppendRow_Checkbox_CogButton(typeSelection, {
             cId = _type.Id,
             name = string.format("Show %s", _type.Name),
-            tooltipText = string.format("When ON the collection type: %s will enabled\nSelect by pressing settings-symbol/cog", _type.Name),
+            tooltipText = string.format("When ON the collection type: %s will enabled\nPress the 'cog' to display collectible in: 'Collectibles' and 'Collection bar'", _type.Name),
             funcGet = function()
                 return _type.Saved.Enabled
             end,
diff --git a/CBs_Settings_List.lua b/CBs_Settings_List.lua
index 1b0dcc5..a8fbea1 100644
--- a/CBs_Settings_List.lua
+++ b/CBs_Settings_List.lua
@@ -140,7 +140,7 @@ function CBs_Settings_List:SetupRow_Checkbox_CogButton(control, data)
         local isEnabled = control.data.funcGet and control.data.funcGet()
         ZO_CheckButton_SetEnableState(control.cogButton, isEnabled)
         control.cogButton:SetAlpha(isEnabled and 1 or 0.5)
-        control.cogButton:SetHandler("OnClicked", function()
+        self.base.SetupSettingsFrameHandlers(control.cogButton, data.tooltipText, function()
             PlaySound(SOUNDS.SINGLE_SETTING_RESET_TO_DEFAULT)
             control.data.funcCog(control.slider, data.default)
         end)