-------------------------------------------------------------------------------

Jarth [07-04-20 - 06:31]
-------------------------------------------------------------------------------
 Collection bars
-------------------------------------------------------------------------------
Version 1.1.4 (04-07-2020)
- Fixed issue where category saved data would not be accessible

Version 1.1.3 (01-07-2020)
- Fixed issue where buttons would not update when pressed

Version 1.1.2 (28-06-2020)
- Fixed issue where keybindings would not show in some instances
- Fixed issue where verbose logging would not disable with debug logging
- Changed the load order, so settings is fetched before categories, to avoid loggings if not enabled

Version 1.1.1 (22-06-2020)
- Fixed issue with changing display name of the bars

Version 1.1.0 (21-06-2020)
Warning: With this version the saved variables will reset!

Highlights:
- The settings have been rearanged for consistancy and to rework some features
- In the settings, categories are now stored on the category id rather than name
-- Makes the setup language agnostic
- Added feature when selecting collectibles, to "auto select all".
-- When "auto select all" is enabled, any valid unlocked collectible will be shown
-- When this setting is set, it will not save unique collectible id´s
-- If you get new collectibles you would need to manually reload the UI (or refresh the collection, top right in the settings panel)
- LibDebugLogger have been added as an optional dependency
-- It will only log when logging is enabled in the settings

Version 1.0.11 (01-06-2020)
Highlights:
- It is now possible to alter the displayname of categories (again)
- In the categories tab, right click on the "cog"-icon for an enabled category, will navigate to the "Collectibles" tab.
- If account settings are used, and there exists character settings, these can now be deleted in the global settings tab.
-- At this time, these settings are not used

Reintroduced string format, as it gives better performance, and makes the code easier to navigate
Added formatter/formatted strings for central teksts making them reusable though out the code

Version 1.0.10 (27-05-2020)
- Updated APIVersion to 100031
- Now always show labels when opening the settings window by slash command or hotkey
-- Same toggle as right click on a label

Version 1.0.9 (25-05-2020)
- Renamed Selection to Collectibles
- If "Use account settings" is on it will no longer create Character settings.
  The setting now sets "account wide" if account settings is used, not pr character.
- Collectibles are now also ordered and named the same as the "Collections tab".
-- TODO: Implement tooltip with icon, in much the same way as "Collections tab".

Improvements:
- Streamlined naming through out the code
- Removed unused values

Version 1.0.8 (24-05-2020)
- Updated APIVersion to 100030

Menu:
- Support for LibAddonMenu-2.0 have been removed from the addon
- Setup is done solely from the settings window

Bindings:
- Added binding to open settings window
- Added 10 bindings, total is now 20

Changes to Categories (previous "collection types"):
- Renamed to Categories
- Removed the hardcoded list of Categories
- Populates types based on ZO_CollectibleCategoryData
-- A category is shown when the category or its children has usable collectibles
- Categories are now named and ordered the same as in the ESO Collections view
- A category now has an icon, the icon from the parent category is shown for sub categories.
- A parent category can collapse its children
-- The icon highlights when hovering a parent category

Texts:
- Moved "magic strings" through out the code to variables, making them reusable and allowing for better overview and reusability
- TODO: Identify patterns and improve, now nearly all strings are joined by .. not string.format.

Improvements:
- Removed Base reference from CBs_Button
- Removed Base from CBs_Button

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

Version 1.0.6 (03-11-2019)
- Updated APIVersion to 100029
- Fixed an issue when activating certan mementos:
 user:/AddOns/CollectionBars/CBs_Buttons.lua:125: operator + is not supported for nil + number
-- Added guard, so start time defaults to 0 in:
--- base:GetCooldownText(countDown, duration)
--  base.IsCollectibleUsable(button)

Version 1.0.5 (08-09-2019)
- Fixed issue hiding labels, when they are not combined, and the settings tab is not enabled
- Fixed issue with when moving the frame, and has the label anchor set other than a corner
-- Setting: "Bar anchor location" is removed, it now anchors to the "Display name anchor position on button".
-- Anchors can now be set to corners/sides/center.

Version 1.0.4 (14-08-2019)
- Updated APIVersion to 100028
- Changed the drawlevel of buttons, so they now are displayed in front of:
-- Inventory & equipment window
-- Bank, fence and store window
-- Collection bars settings
- Updated how MoveFrames are created and named.

Version 1.0.3 (23-06-2019)
- Updated bindings, so they update when a key is remapped in ESO settings
- Made LibAddonMenu-2.0 Optional
-- I expect to remove LibAddonMenu-2.0 completely.. eventually
- Added functionality to "Collection Bar Settings"
-- Option to select if addon should be added to the menu ("LibAddonMenu-2.0")
-- Migrated missing settings from the menu
-- Allows for adding and removing "Collection types", without reloading the LibAddonMenu
-- Allows for changing between account or user settings, without reloading the LibAddonMenu
-- Change active collection type by pressing settings-symbol/cog in "Collection types".
- Updated menu slash command to: "/cb_menu"
- Updated settings window slash command to: "/cb"

Version 1.0.2 (14-06-2019)
- Removed files for library: LibAddonMenu-2.0
-- It is still required, but files needs to be downloaded separately
- Updated the activation by hotkey, so it always tries to activate the collectible, even if a button does not exist
- Made labels clamp to the screen

Menu
- Removed sub pages in the menu, it now has a divider where one used to be
- Added tooltips declaring why items are disabled
- Moved selection of collectibles to the new "settings panel"
- Added "Toggle settings" button, to toggle settings mode
- Removed reload requirement, when toggling a collection type

Settings panel
- Added settings panel, for setting up specific collection type settings
- Right click a label to toggle settings mode
- In settings mode, all labels are shown, when collection type is selected
- Open the settings panel by pressing the cog on the label
- Functionality in the settings panel:
-- Toggle move frame
-- Reload collection
-- Show disabled collectibles of type
-- Select all collectibles of type
-- Select specific collectible of type

Version 1.0.1 (06-05-2019)
- Removed duplicate LibStub from lib: Libs\LibStub

Version 1.0.0 (27-04-2019)
Filename
CBs_Constants.lua
CBs_Settings.lua
Changelog
CollectionBars.txt
diff --git a/CBs_Constants.lua b/CBs_Constants.lua
index 9e87b39..6aed498 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 = 3, SettingsSlash = "/cb", Author = "Jarth"},
+    Addon = {Name = "CollectionBars", DisplayName = "Collection Bars", Abbreviation = "CBs", Version = 1.1, MinorVersion = 4, SettingsSlash = "/cb", Author = "Jarth"},
     AllButtons = {},
     Default = {
         UseAccountSettings = true,
@@ -161,7 +161,7 @@ function base.AddCategory(type, categoryData, parentIcons, hasChildren, parentKe
         Fragment = nil
     }
     table.insert(base.CategoriesOrdered, base.Categories[categoryId])
-    base.Default.Categories[categoryId] = {
+    base.Saved.Categories[categoryId] = {
         AutoSelectAll = false,
         Selected = {},
         Enabled = false,
diff --git a/CBs_Settings.lua b/CBs_Settings.lua
index a936a08..6668b19 100644
--- a/CBs_Settings.lua
+++ b/CBs_Settings.lua
@@ -11,7 +11,10 @@ local texts = base.Texts
 -------------------------------------------------------------------------------------------------
 -- FUNCTIONS --
 -------------------------------------------------------------------------------------------------
-function base:InitializeSettingsSlash() SLASH_COMMANDS[base.Addon.SettingsSlash] = function() base:ToggleEnableSettings(base.ShowSettings()) end end
+function base:InitializeSettingsSlash()
+    base:Debug("InitializeSettingsSlash")
+    SLASH_COMMANDS[base.Addon.SettingsSlash] = function() base:ToggleEnableSettings(base.ShowSettings()) end
+end

 function base:ToggleEnableSettings(forceShow)
     base:Debug("ToggleEnableSettings", forceShow)
diff --git a/Changelog b/Changelog
index c0c01e6..800c4dd 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,9 @@
 -------------------------------------------------------------------------------
  Collection bars
 -------------------------------------------------------------------------------
+Version 1.1.4 (04-07-2020)
+- Fixed issue where category saved data would not be accessible
+
 Version 1.1.3 (01-07-2020)
 - Fixed issue where buttons would not update when pressed

diff --git a/CollectionBars.txt b/CollectionBars.txt
index ef4c538..67288e5 100644
--- a/CollectionBars.txt
+++ b/CollectionBars.txt
@@ -6,8 +6,8 @@

 ## APIVersion: 100031
 ## Title: Collection Bars
-## AddOnVersion: 10103
-## Version: 1.1.3
+## AddOnVersion: 10104
+## Version: 1.1.4
 ## 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)
 ##