Version 1.1.8 (31-08-2020)

Ulrik Larsen [08-31-20 - 07:55]
Version 1.1.8 (31-08-2020)
- Fixed issue where the category type would not be set for categories.
-- Resulting in Unlocked count not being set, and sliders not working.
Filename
CBs_Constants.lua
CBs_Helpers.lua
Changelog
CollectionBars.txt
diff --git a/CBs_Constants.lua b/CBs_Constants.lua
index 6d215f1..1f4091d 100644
--- a/CBs_Constants.lua
+++ b/CBs_Constants.lua
@@ -7,7 +7,7 @@ Filename: CBs_Constants.lua
 -------------------------------------------------------------------------------------------------
 CollectionBars = {
     WM = GetWindowManager(),
-    Addon = {Name = "CollectionBars", DisplayName = "Collection Bars", Abbreviation = "CBs", Version = 1.1, MinorVersion = 7, SettingsSlash = "/cb", Author = "Jarth"},
+    Addon = {Name = "CollectionBars", DisplayName = "Collection Bars", Abbreviation = "CBs", Version = 1.1, MinorVersion = 8, SettingsSlash = "/cb", Author = "Jarth"},
     AllButtons = {},
     Default = {
         UseAccountSettings = true,
@@ -137,8 +137,10 @@ end
 function base.GetCategoryTypeFromCollectible(categoryData)
     base:Debug("GetCategoryType", categoryData)
     local categoryType = nil
-    local collectibles = categoryData:GetCollectibleDataBySpecializedSort()
-    if base.HasAny(collectibles) then categoryType = collectibles[1]:GetCategoryType() end
+    for _, collectible in ZO_CollectibleCategoryData.SortedCollectibleIterator(categoryData, {ZO_CollectibleData.IsShownInCollection}) do
+        categoryType = collectible:GetCategoryType()
+        break
+    end

     return categoryType
 end
diff --git a/CBs_Helpers.lua b/CBs_Helpers.lua
index 2f417e7..1e7a59e 100644
--- a/CBs_Helpers.lua
+++ b/CBs_Helpers.lua
@@ -227,8 +227,14 @@ end

 function base:HasAny(array)
     base:Debug("HasAny", array)
-    if array ~= nil then for _ in pairs(array) do return true end end
-    return false
+    local hasAny = false
+    if array ~= nil then
+        for _ in pairs(array) do
+            hasAny = true
+            break
+        end
+    end
+    return hasAny
 end

 function base:SetControlText(control, text)
diff --git a/Changelog b/Changelog
index eab5508..db7fa7f 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,10 @@
 -------------------------------------------------------------------------------
  Collection bars
 -------------------------------------------------------------------------------
+Version 1.1.8 (31-08-2020)
+- Fixed issue where the category type would not be set for categories.
+-- Resulting in Unlocked count not being set, and sliders not working.
+
 Version 1.1.7 (29-08-2020)
 - Updated APIVersion to 100032
 - Categories are no longer filtered, it shows the same list as the ESO Collections view.
diff --git a/CollectionBars.txt b/CollectionBars.txt
index 0caa7f4..b6a68d5 100644
--- a/CollectionBars.txt
+++ b/CollectionBars.txt
@@ -6,8 +6,8 @@

 ## APIVersion: 100032
 ## Title: Collection Bars
-## AddOnVersion: 10107
-## Version: 1.1.7
+## AddOnVersion: 10108
+## Version: 1.1.8
 ## Author: Jarth
 ## Description: Show collection bars and activate collections with key or button press. Shortcuts: Settings window: /cb OptionalDependsOn: LibDebugLogger (Logging can be enabled in settings)
 ##