diff --git a/CBs_Constants.lua b/CBs_Constants.lua index da41b10..8d40160 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 = 10, SettingsSlash = "/cb", Author = "Jarth"}, + Addon = {Name = "CollectionBars", DisplayName = "Collection Bars", Abbreviation = "CBs", Version = 1.1, MinorVersion = 11, SettingsSlash = "/cb", Author = "Jarth"}, AllButtons = {}, Default = { UseAccountSettings = true, @@ -61,6 +61,23 @@ base.Texts.CombineFrameNameHideAll = string.format("%s%s", base.Texts.CombineFra base.Texts.AccountKey = string.format("%s_Account", base.Addon.Name) base.Texts.CharacterKey = string.format("%s_Character", base.Addon.Name) +base.IconState = {NORMAL = 1, OVER = 2, PRESSED = 3, DISABLED = 4} +base.ToggleButtonState = {OPEN = true, CLOSED = false} +base.ToggleButtonIcon = { + [base.ToggleButtonState.OPEN] = { + [base.IconState.NORMAL] = "EsoUI/Art/Buttons/tree_open_up.dds", + [base.IconState.OVER] = "EsoUI/Art/Buttons/tree_open_over.dds", + [base.IconState.PRESSED] = "EsoUI/Art/Buttons/tree_open_down.dds", + [base.IconState.DISABLED] = "EsoUI/Art/Buttons/tree_open_disabled.dds" + }, + [base.ToggleButtonState.CLOSED] = { + [base.IconState.NORMAL] = "EsoUI/Art/Buttons/tree_closed_up.dds", + [base.IconState.OVER] = "EsoUI/Art/Buttons/tree_closed_over.dds", + [base.IconState.PRESSED] = "EsoUI/Art/Buttons/tree_closed_down.dds", + [base.IconState.DISABLED] = "EsoUI/Art/Buttons/tree_closed_disabled.dds" + } +} + ------------------------------------------------------------------------------------------------- -- FUNCTIONS -- ------------------------------------------------------------------------------------------------- diff --git a/CBs_Settings_Data.lua b/CBs_Settings_Data.lua index b61db39..2a9b67d 100644 --- a/CBs_Settings_Data.lua +++ b/CBs_Settings_Data.lua @@ -274,14 +274,19 @@ function base.AppendMasterListTypeCategories(self, listType) for _, category in ipairs(base.CategoriesOrdered or {}) do local toolTipText = "" + local icon + if category.HasChildren then toolTipText = string.format("Click to toggle subcategories for\n%s", category.Name) + icon = base.ToggleButtonIcon[base.ToggleButtonState.OPEN] else toolTipText = string.format("When ON the collection category:\n%s will enabled\n\nPress the 'cog' to display collectible in the tabs: 'Collectibles' and 'Category'\n and Right click wil also change the tab", category.Name) + icon = category.Icon end + local data = { cId = category.Id, - icon = category.Icon, + icon = icon, name = string.format("Show %s", category.Name), hasChildren = category.HasChildren, parentKey = category.ParentKey, diff --git a/CBs_Settings_List.lua b/CBs_Settings_List.lua index a963e20..636f268 100644 --- a/CBs_Settings_List.lua +++ b/CBs_Settings_List.lua @@ -174,6 +174,7 @@ function CBs_Settings_List:SetupRow_Category_Title(control, data) if data.hasChildren then control:SetHandler("OnMouseUp", function() base.Global.ShowChildren[data.name] = not base.Global.ShowChildren[data.name] + data.icon = base.ToggleButtonIcon[base.Global.ShowChildren[data.name] == base.ToggleButtonState.OPEN] base.Global.Settings.List:RefreshFilters() end) funcMouseEnter = function(_control) @@ -443,17 +444,17 @@ function CBs_Settings_List.SetupIcon(control, data, funcMouseEnter, funcMouseExi if control.icon ~= nil then local hasIcon = data.icon ~= nil control.icon:SetHidden(not hasIcon) - control.icon:SetTexture(data.icon and data.icon[1]) + control.icon:SetTexture(data.icon and data.icon[base.IconState.NORMAL]) - if data.icon[1] ~= nil and data.icon[3] ~= nil then + if data.icon[base.IconState.NORMAL] ~= nil and data.icon[base.IconState.OVER] ~= nil then control:SetHandler("OnMouseEnter", function() - control.icon:SetTexture(data.icon[3]) + control.icon:SetTexture(data.icon[base.IconState.OVER]) if funcMouseEnter ~= nil then funcMouseEnter(control) end end) control:SetHandler("OnMouseExit", function() - control.icon:SetTexture(data.icon[1]) + control.icon:SetTexture(data.icon[base.IconState.NORMAL]) if funcMouseExit ~= nil then funcMouseExit(control) end diff --git a/Changelog b/Changelog index 3915633..c72e2f6 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,10 @@ ------------------------------------------------------------------------------- Collection bars ------------------------------------------------------------------------------- +Version 1.1.11 (28-01-2022) +- Changed icon for categories with subcategories to better indicate the action +- Changed to use OVER not PRESSED icon + Version 1.1.10 (22-08-2021) - Formatted files and updated version diff --git a/CollectionBars.txt b/CollectionBars.txt index a990ec6..350bd2c 100644 --- a/CollectionBars.txt +++ b/CollectionBars.txt @@ -5,8 +5,8 @@ ; You can read the full terms at https://account.elderscrollsonline.com/add-on-terms ## Title: Collection Bars -## APIVersion: 100035 -## Version: 1.1.10 +## APIVersion: 101032 +## Version: 1.1.11 ## Author: Jarth ## Description: Show collection bars and activate collections with key or button press. Settings window: /cb. LibDebugLogger can be used for logging can be enabled in the settings ## OptionalDependsOn: LibDebugLogger