Download
(41 Kb)
Download
Updated: 04/26/24 02:02 PM
Pictures
File Info
Compatibility:
Scions of Ithelia (9.3.0)
Updated:04/26/24 02:02 PM
Created:01/24/23 03:57 PM
Monthly downloads:14,840
Total downloads:167,651
Favorites:101
MD5:
9.3.0
LibScrollableMenu  Updated Today!  Popular! (More than 5000 hits)
Version: 2.1
by: tomstock, Baertram
Library for scrollable menus and nested submenus at ComboBoxes.

It features:
  • Scrollable menus
  • Scrollable context menus
  • (Nested) submenus
  • Headers
  • Dividers
  • Checkboxes
  • MultiIcons
  • "Is new" state icon
  • Callbacks fired at menu open, close, submenu open close, entry mouse enter, entry mouse exit, entry selected, checkbox checked state change, isNew state change
  • Narration: Call custom function of addon to narrate or return a string to be narrated
  • Scrollable nested context menus at any control (like LibCustomMenu)

Originally developed by Kyoma in Kyoma's Titlizer. Now used in Improved Titleizer, AddonSelector, AdvancedFilters for example.


Important information - Context menus
LSM cannot work in combination with normal context menus created via ZO_Menu, as this is not scrollable.
As for example all inventory context menus use ZO_Menu you cannot use LSM there, only LibCustomMenu (which is based on ZO_Menu).

You can use LSM as scrollHelper on a ZO_ComboBox control, or as new context menu at any custom control, or at least any control where another context menu via ZO_Menu wasn't added yet. Both cannot be used in combination!
What you can do though is replace your LCM implementation with LSM so you remove ZO_Menu context menus and make them scrollable.
But using both on the same control in combination won't work.


Known Issues


Developer reference
Read the Github readme file and check file LSM_test.lua for example code


Add a scrolhelper (dropdown scrollable) to a ZO_ComboBox:
API syntax:
Code:
--Adds a scrollable dropdown to the comboBoxControl, replacing the original dropdown, and enabling scrollable submenus (even with nested scrolable submenus)
--	control parent 							Must be the parent control of the comboBox
--	control comboBoxContainer 				Must be any ZO_ComboBox control (e.g. created from virtual template ZO_ComboBox)
--  table options:optional = {
--		number visibleRowsDropdown:optional		Number or function returning number of shown entries at 1 page of the scrollable comboBox's opened dropdown
--		number visibleRowsSubmenu:optional		Number or function returning number of shown entries at 1 page of the scrollable comboBox's opened submenus
--		boolean sortEntries:optional			Boolean or function returning boolean if items in the main-/submenu should be sorted alphabetically: ZO_SORT_ORDER_UP or ZO_SORT_ORDER_DOWN
--		table sortType:optional					table or function returning table for the sort type, e.g. ZO_SORT_BY_NAME, ZO_SORT_BY_NAME_NUMERIC
--		boolean sortOrder:optional				Boolean or function returning boolean for the sort order
-- 		string font:optional				 	String or function returning a string: font to use for the dropdown entries
-- 		number spacing:optional,	 			Number or function returning a Number: Spacing between the entries
--		boolean disableFadeGradient:optional	Boolean or function returning a boolean: for the fading of the top/bottom scrolled rows
--		table headerColor:optional				table (ZO_ColorDef) or function returning a color table with r, g, b, a keys and their values: for header entries
--		table normalColor:optional				table (ZO_ColorDef) or function returning a color table with r, g, b, a keys and their values: for all normal (enabled) entries
--		table disabledColor:optional 			table (ZO_ColorDef) or function returning a color table with r, g, b, a keys and their values: for all disabled entries
-- 		function preshowDropdownFn:optional 	function function(ctrl) codeHere end: to run before the dropdown shows
--		table	XMLRowTemplates:optional		Table or function returning a table with key = row type of lib.scrollListRowTypes and the value = subtable having
--												"template" String = XMLVirtualTemplateName,
--												rowHeight number = ZO_COMBO_BOX_ENTRY_TEMPLATE_HEIGHT,
--												setupFunc = function(control, data, list)
--													local comboBox = ZO_ComboBox_ObjectFromContainer(comboBoxContainer) -- comboBoxContainer = The ZO_ComboBox control you created via WINDOW_MANAGER:CreateControlFromVirtual("NameHere", yourTopLevelControlToAddAsAChild, "ZO_ComboBox")
--													comboBox:SetupEntryLabel(control, data, list)
--												end
--												-->See local table "defaultXMLTemplates" in LibScrollableMenu
--												-->Attention: If you do not specify all template attributes, the non-specified will be mixedIn from defaultXMLTemplates[entryType_ID] again!
--		{
--			[lib.scrollListRowTypes.ENTRY_ID] = 		{ template = "XMLVirtualTemplateRow_ForEntryId", ... }
--			[lib.scrollListRowTypes.SUBMENU_ENTRY_ID] = { template = "XMLVirtualTemplateRow_ForSubmenuEntryId", ... },
--			...
--		}
--		table	narrate:optional				Table or function returning a table with key = narration event and value = function called for that narration event.
--												Each functions signature/parameters is shown below!
--												-> The function either builds your narrateString and narrates it in your addon.
--												   Or you must return a string as 1st return param (and optionally a boolean "stopCurrentNarration" as 2nd return param. If this is nil it will be set to false!)
--													and let the library here narrate it for you via the UI narration
--												Optional narration events can be:
--												"OnComboBoxMouseEnter" 	function(m_dropdownObject, comboBoxControl)  Build your narrateString and narrate it now, or return a string and let the library narrate it for you end
--												"OnComboBoxMouseExit"	function(m_dropdownObject, comboBoxControl) end
--												"OnMenuShow"			function(m_dropdownObject, dropdownControl, nil, nil) end
--												"OnMenuHide"			function(m_dropdownObject, dropdownControl) end
--												"OnSubMenuShow"			function(m_dropdownObject, parentControl, anchorPoint) end
--												"OnSubMenuHide"			function(m_dropdownObject, parentControl) end
--												"OnEntryMouseEnter"		function(m_dropdownObject, entryControl, data, hasSubmenu) end
--												"OnEntryMouseExit"		function(m_dropdownObject, entryControl, data, hasSubmenu) end
--												"OnEntrySelected"		function(m_dropdownObject, entryControl, data, hasSubmenu) end
--												"OnCheckboxUpdated"		function(m_dropdownObject, checkboxControl, data) end
--			Example:	narrate = { ["OnComboBoxMouseEnter"] = myAddonsNarrateComboBoxOnMouseEnter, ... }
--  }
function AddCustomScrollableComboBoxDropdownMenu(parent, comboBoxContainer, options)
Added new API functions to create the scrollable (nested) context menus at any control,like LibCustomMenu does.
API syntax:
Code:
Entry types:
LSM_ENTRY_TYPE_NORMAL
LSM_ENTRY_TYPE_DIVIDER
LSM_ENTRY_TYPE_HEADER
LSM_ENTRY_TYPE_CHECKBOX


--Adds a new entry to the context menu entries with the shown text, where the callback function is called once the entry is clicked.
--If entries is provided the entry will be a submenu having those entries. The callback can be used, if entries are passed in, too (to select a special entry and not an enry of the opening submenu).
--But usually it should be nil if entries are specified, as each entry in entries got it's own callback then.
--Existing context menu entries will be kept (until ClearCustomScrollableMenu will be called)
--
--Example - Normal entry without submenu
--AddCustomScrollableMenuEntry("Test entry 1", function() d("test entry 1 clicked") end, LibScrollableMenu.LSM_ENTRY_TYPE_NORMAL, nil, nil)
--Example - Normal entry with submenu
--AddCustomScrollableMenuEntry("Test entry 1", function() d("test entry 1 clicked") end, LibScrollableMenu.LSM_ENTRY_TYPE_NORMAL, {
--	{
--		label = "Test submenu entry 1", --optional String or function returning a string. If missing: Name will be shown and used for clicked callback value
--		name = "TestValue1" --String or function returning a string if label is givenm name will be only used for the clicked callback value
--		isHeader = false, -- optional boolean or function returning a boolean Is this entry a non clickable header control with a headline text?
--		isDivider = false, -- optional boolean or function returning a boolean Is this entry a non clickable divider control without any text?
--		isCheckbox = false, -- optional boolean or function returning a boolean Is this entry a clickable checkbox control with text?
--		isNew = false, --  optional booelan or function returning a boolean Is this entry a new entry and thus shows the "New" icon?
--		entries = { ... see above ... }, -- optional table containing nested submenu entries in this submenu -> This entry opens a new nested submenu then. Contents of entries use the same values as shown in this example here
--		contextMenuCallback = function(ctrl) ... end, -- optional function for a right click action, e.g. show a scrollable context menu at the menu entry
-- }
--}, --[[additionalData]] { isNew = true, normalColor = ZO_ColorDef, highlightColor = ZO_ColorDef, disabledColor = ZO_ColorDef, font = "ZO_FontGame" } )
function AddCustomScrollableMenuEntry(text, callback, entryType, entries, additionalData)


--Adds an entry having a submenu (or maybe nested submenues) in the entries table/entries function whch returns a table
--> See examples for the table "entries" values above AddCustomScrollableMenuEntry
--Existing context menu entries will be kept (until ClearCustomScrollableMenu will be called)
function AddCustomScrollableSubMenuEntry(text, entries)


--Adds a divider line to the context menu entries
--Existing context menu entries will be kept (until ClearCustomScrollableMenu will be called)
function AddCustomScrollableMenuDivider()


--Pass in a table/function returning a table with predefined context menu entries and let them all be added in order of the table's number key
--Existing context menu entries will be kept (until ClearCustomScrollableMenu will be called)
function AddCustomScrollableMenuEntries(contextMenuEntries)


--Populate a new scrollable context menu with the defined entries table/a functinon returning the entries.
--Existing context menu entries will be reset, because ClearCustomScrollableMenu will be called!
--You can add more entries later, prior to showing, via AddCustomScrollableMenuEntry / AddCustomScrollableMenuEntries functions too
function AddCustomScrollableMenu(entries, options)


--Set the options (visible rows max, etc.) for the scrollable context menu, or any passed in 2nd param comboBoxContainer
-->See possible options above AddCustomScrollableComboBoxDropdownMenu
function SetCustomScrollableMenuOptions(options, comboBoxContainer)


--Show the custom scrollable context menu now at the control controlToAnchorTo, using optional options.
--If controlToAnchorTo is nil it will be anchored to the current control's position below the mouse, like ZO_Menu does
--Existing context menu entries will be kept (until ClearCustomScrollableMenu will be called)
function ShowCustomScrollableMenu(controlToAnchorTo, options)


--Hide the custom scrollable context menu and clear it's entries, clear internal variables, mouse clicks etc.
function ClearCustomScrollableMenu()
You can basically search & replace the first params of AddCustomMenuItem and AddCustomSubMenuItem with the
LibScrollableMenu's API functions AddCustomScrollableMenuEntry and AddCustomScrollableSubMenuEntry



GitHub
https://github.com/tomstock1337/eso-LibScrollableMenu

Planned features
-Custom header / title
-Text search at header, filtering the menu and submenu entries
-Support for LibCustomMenu (replace it and ZO_Menu e.g. at inventory rows)
2.1 IsJustaGhost, Baertram - 2024-04-26
- Fixed comboBoxClass:OnGlobalMouseUp(eventCode, ...) must close all submenus and the main menu (dropdown) of the ZO_ComboBox if we right click on the main comboBox to show a context menu there
- Fixed improved OnGlobalMouseUp functionality
- Fixed submenu defaults not inheriting from parent on initialize
- Fixed callbacks for OnMenuOpen and OnMenuHide, OnSubmenuHide and OnSubmenuShow somehow fire very often, instead of once where needed.
- Fixed callbacks for OnRowEnter and OnRowExit somehow fire twice, instead of once
- Fixed name of widthPadding in row template
- Fixed height will recalculate on each open (respecting functions returning values of the entris)
- Fixed spacing, width and scollbars
- Fixed an issue where dropdowns could display a scroll bar when not necessary
- Fixed data.tooltip and data.customTooltip function with show & hide
- Fixed all API functions for context menus to accept entries as function returning a table too
- Fixed enabled state of entries not firing any onMouseEnter/-exit handlers anymore
- Fixed a lot of other smaller errors

- Exposed row setup functions to object to allow addon use in custom setupFunction of custom virtual XML template
- Changed API function's AddCustomScrollableMenuEntry last parameter isNew into table additionalData, to pass in several additional data table values (defined by LSM and custom addon ones)
- Changed rows which open a submenu, and got a callback function, will be shown light green now at their highlight

- Added options.disableFadeGradient, options.headerColor, options.normalColor, options.disabledColor
- Added disabledColor and normalColor to options
- Added item.enabled to processNameString and updateLabelsStrings, for if it is a function, it is updated the same as name and label.
- Added dynamic selectable item based on control.selectable and has callback
- Added Callback OnDropdownMenuAdded which can change the options of a dropdown pre-init
- Added API function RunCustomScrollableMenuItemsCallback(comboBox, item, myAddonCallbackFunc, filterEntryTypes, fromParentMenu, ...)
- Added LibDebugLogger and function dLog for logging with and w/o LDL. See slash commands /lsmdebug and /lsmdebugverbose (verbose logging still needs to be manually enabled within LibDebugLogger's Startup config file! Tags: LibScrollableMenu and LibScrollableMenu/Verbose)


2.0 IsJustaGhost, Baertram - 2024-03-21
- Fixed: width update of entries (no abbreviated texts)
- Fixed: data.label (string or function returning a string)
- Fixed: SetTimeout menus opening/closing
- Added: Callback for dropdown menu added (pre-init!) "OnDropdownMenuAdded"

1.9 Baertram - 2024-03-11 - Compatible with API101041 "Scions of Ithelia"
!A very huge thanks to IsJustaGhost for all his work on recoding the total library to get it compatible with Scions of Ithelia!

-Made compatible with Scions of Ithelia
-Fixed several bugs

-> Attention: Some API functions for context menus changed in param/signature
Please check your addon's API function signature:
--AddCustomScrollableMenu(entries, options) -> Removed 1st param parentCtrl
--SetCustomScrollableMenuOptions(options) -> Removed 2nd param scrollHelper (maybe readded. currently this function will onyl work for ContextMenus. If you want to change the options of a dropdown, it's currently not possible anymore after creating the dropdown. We are working on an a way.
--ShowCustomScrollableMenu(controlToAnchorTo, options) -> Removed 2nd to 4th params controlToAnchorTo, point, relativePoint, offsetX, offsetY and replaced 2nd with options



-Added new dropdown options for the menus:
["font"] = "ESOFontNameHere" -- String or function returning a string: font to use for the dropdown entries
["spacing"] = 1, -- Number or function returning a Number : Spacing between the entries
["preshowDropdownFn"] = function(ctrl) end, --function to run before the dropdown shows

-> See documentation above API function AddCustomScrollableComboBoxDropdownMenu

1.8 Baertram - 2024-02-26 - Not compatible with API101041 "Scions of Ithelia"!
-Fixed ignoreCallback at menu entries without a callback function (not playing a sound on selection, not closing the menu/submenu on selection)
-Added data.enabled for the menu/submenu entries. If enabled == false, there won't be any selection highlight and clickable entry

1.7 IsJustaGhost & Baertram - 2024-01-12
Added new API functions to create the scrollable (nested) menus at any control as a context menu like LibCustomMenu does.

API syntax:
Code:
Entry types:
LSM_ENTRY_TYPE_NORMAL 
LSM_ENTRY_TYPE_DIVIDER 
LSM_ENTRY_TYPE_HEADER
LSM_ENTRY_TYPE_CHECKBOX 


--Adds a new entry to the context menu entries with the shown text, which calls the callback function once clicked.
--If entries is provided the entry will be a submenu having those entries. The callback can only be used if entries are passed in
--but normally it should be nil in that case
function AddCustomScrollableMenuEntry(text, callback, entryType, entries, isNew)

--Adds an entry having a submenu (or maybe nested submenues) in the entries table
function AddCustomScrollableSubMenuEntry(text, entries)

--Adds a divider line to the context menu entries
function AddCustomScrollableMenuDivider()

--Pass in a table with predefined context menu entries and let them all be added in order of the table's number key
function AddCustomScrollableMenuEntries(contextMenuEntries)

--Set the options (visible rows max, etc.) for the scrollable context menu
function SetCustomScrollableMenuOptions(options, scrollHelper)

--Add a new scrollable context menu with the defined entries table.
--You can add more entries later via AddCustomScrollableMenuEntry function too
function AddCustomScrollableMenu(parent, entries, options)

--Show the custom scrollable context menu now
function ShowCustomScrollableMenu(controlToAnchorTo, point, relativePoint, offsetX, offsetY, options)

--Hide the custom scrollable context menu and clear internal variables, mouse clicks etc.
function ClearCustomScrollableMenu()
You can basically search & replace the first params of AddCustomMenuItem and AddCustomSubMenuItem with the
LibScrollableMenu's API functions AddCustomScrollableMenuEntry and AddCustomScrollableSubMenuEntry


1.6 Baertram
Fixed main menu entry callbacks not firing anymore

1.5 Baertram (thanks to IsJustaGhost)
Changed hooks and fixed insecure error occurring at housing editor

1.4 Baertram (thanks to Dakjaniels)
Fixed XML resizeToFitDescendents error

1.3 Baertram
Fixed lua error onMouseEnter (narration related)

1.2 IsJustaGhost/Baertram
-Made compatible with API101040
-Many fixes and improvements
-Added features of LibCustomMenu (headers, dividers, checkboxes)
-Added support for UI narration (custom addon function called, either narrating itsself or returning a string to be narrated)

For developers: See Github repositorie's readm file for infos, and check the LSM_test.lua file for example code.

1.1
-API Bump
1.0
-Initial Version
Archived Files (11)
File Name
Version
Size
Uploader
Date
2.0
29kB
Baertram
03/21/24 05:38 AM
1.9
28kB
Baertram
03/11/24 03:10 AM
1.8
31kB
Baertram
02/26/24 03:42 AM
1.7
27kB
Baertram
01/11/24 06:09 PM
1.6
23kB
Baertram
12/10/23 11:26 AM
1.5
23kB
Baertram
12/09/23 06:05 PM
1.4
22kB
Baertram
11/13/23 02:59 PM
1.3
22kB
Baertram
10/31/23 04:15 AM
1.2
22kB
Baertram
10/30/23 03:56 AM
1.1
7kB
tomstock
03/19/23 02:51 PM
1.0
7kB
01/24/23 03:57 PM


Post A Reply Comment Options
Unread 04/01/24, 06:35 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4989
File comments: 6040
Uploads: 78
Re: Re: Re: Inventory implementation

If your addon adds a custom control to the inventoryRow, like a marker icon or similar, you could use that cntrol to show a custom LSM scrollable context menu at it.
Or you could use the image of the item, and make a right click contex menu there:


Just adding it to the default row's right click context menu won't work.
But depending on your usecase, if you only want to add 2 enries like "Add to banked set" or "Reove frm banked set" it would be just enough to use LibScrollableMenu to add that entries to the normal inventory menu.
You can even use a submenu there like "XL Gear Banker" -> "Add to set", "Remove from set", "...", "..."

Originally Posted by B7TxSpeed
Originally Posted by Baertram
Originally Posted by B7TxSpeed
Hey,
I'm trying to use this lib in XLGearBanker to address the issue of the sets list being too long to display in a standard submenu entry in an inventory slot menu.
So far, I haven't been able to make it work.

I tried to replace AddCustomSubMenuItem with AddCustomScrollableSubMenuEntry but it just does not display. I don't have much experience with custom UI elements, but I know I'm missing something.
I pushed my update on this PR: https://github.com/B7TxSpeed/XLGearBanker/pull/1
Could you provide some examples or help if you have time, please?
LSM cannot work in combination with normal context menus created via ZO_Menu, as this is not scrollable.
And as all inventory context menus use ZO_Menu you cannot use LSm there, only LibCustomMenu (which is based on ZO_Menu).

Either you need to rewrite ALL inventory context menus to use LSM instead, and that would make you rewrite all vanilla code (ending with insecure error messages every here and there most probably) or there is no way to use LSM "in combination" with inventory context menus.

You can use LSM as scrollHelper on a ZOComboBox or as new context menu at any custom control or at least any control where another context menu via ZO_Menu wasn't added yet. Both cannot be used in combination, you can only replace your LCM implementation with LSM so you remove ZO_Menu context menus.

I've updated the description and added that info, sorry for the confusion.
LSM is based on ZO_ComboBox's dropdownObject which uses a ZO_SortFilterList (and thus is scrollable) where LibCustomMenu and vanilla code AddMenuItem use ZO_Menu which is no scrollable list. Both cannot be used in combination.
Ok, thanks for the quick answer!
I guess I'll have to find another way and not use the inventory context menus for that purpose.
Last edited by Baertram : 04/01/24 at 06:38 AM.
Report comment to moderator  
Reply With Quote
Unread 03/31/24, 04:11 PM  
B7TxSpeed
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 10
Uploads: 2
Re: Re: Inventory implementation

Originally Posted by Baertram
Originally Posted by B7TxSpeed
Hey,
I'm trying to use this lib in XLGearBanker to address the issue of the sets list being too long to display in a standard submenu entry in an inventory slot menu.
So far, I haven't been able to make it work.

I tried to replace AddCustomSubMenuItem with AddCustomScrollableSubMenuEntry but it just does not display. I don't have much experience with custom UI elements, but I know I'm missing something.
I pushed my update on this PR: https://github.com/B7TxSpeed/XLGearBanker/pull/1
Could you provide some examples or help if you have time, please?
LSM cannot work in combination with normal context menus created via ZO_Menu, as this is not scrollable.
And as all inventory context menus use ZO_Menu you cannot use LSm there, only LibCustomMenu (which is based on ZO_Menu).

Either you need to rewrite ALL inventory context menus to use LSM instead, and that would make you rewrite all vanilla code (ending with insecure error messages every here and there most probably) or there is no way to use LSM "in combination" with inventory context menus.

You can use LSM as scrollHelper on a ZOComboBox or as new context menu at any custom control or at least any control where another context menu via ZO_Menu wasn't added yet. Both cannot be used in combination, you can only replace your LCM implementation with LSM so you remove ZO_Menu context menus.

I've updated the description and added that info, sorry for the confusion.
LSM is based on ZO_ComboBox's dropdownObject which uses a ZO_SortFilterList (and thus is scrollable) where LibCustomMenu and vanilla code AddMenuItem use ZO_Menu which is no scrollable list. Both cannot be used in combination.
Ok, thanks for the quick answer!
I guess I'll have to find another way and not use the inventory context menus for that purpose.
Report comment to moderator  
Reply With Quote
Unread 03/31/24, 12:43 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4989
File comments: 6040
Uploads: 78
Re: Inventory implementation

Originally Posted by B7TxSpeed
Hey,
I'm trying to use this lib in XLGearBanker to address the issue of the sets list being too long to display in a standard submenu entry in an inventory slot menu.
So far, I haven't been able to make it work.

I tried to replace AddCustomSubMenuItem with AddCustomScrollableSubMenuEntry but it just does not display. I don't have much experience with custom UI elements, but I know I'm missing something.
I pushed my update on this PR: https://github.com/B7TxSpeed/XLGearBanker/pull/1
Could you provide some examples or help if you have time, please?
LSM cannot work in combination with normal context menus created via ZO_Menu, as this is not scrollable.
And as all inventory context menus use ZO_Menu you cannot use LSm there, only LibCustomMenu (which is based on ZO_Menu).

Either you need to rewrite ALL inventory context menus to use LSM instead, and that would make you rewrite all vanilla code (ending with insecure error messages every here and there most probably) or there is no way to use LSM "in combination" with inventory context menus.

You can use LSM as scrollHelper on a ZOComboBox or as new context menu at any custom control or at least any control where another context menu via ZO_Menu wasn't added yet. Both cannot be used in combination, you can only replace your LCM implementation with LSM so you remove ZO_Menu context menus.

I've updated the description and added that info, sorry for the confusion.
LSM is based on ZO_ComboBox's dropdownObject which uses a ZO_SortFilterList (and thus is scrollable) where LibCustomMenu and vanilla code AddMenuItem use ZO_Menu which is no scrollable list. Both cannot be used in combination.
Last edited by Baertram : 03/31/24 at 12:49 PM.
Report comment to moderator  
Reply With Quote
Unread 03/31/24, 08:27 AM  
B7TxSpeed
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 10
Uploads: 2
Inventory implementation

Hey,
I'm trying to use this lib in XLGearBanker to address the issue of the sets list being too long to display in a standard submenu entry in an inventory slot menu.
So far, I haven't been able to make it work.

I tried to replace AddCustomSubMenuItem with AddCustomScrollableSubMenuEntry but it just does not display. I don't have much experience with custom UI elements, but I know I'm missing something.
I pushed my update on this PR: https://github.com/B7TxSpeed/XLGearBanker/pull/1
Could you provide some examples or help if you have time, please?
Report comment to moderator  
Reply With Quote
Unread 03/23/24, 10:00 AM  
IsJustaGhost
AddOn Author - Click to view AddOns

Forum posts: 38
File comments: 280
Uploads: 23
Yes, m_sortsItems is true by default. Which is correct as it matches that in ZO_ComboBox. However, the issue was with submenus not inheriting those m_* variables on initialize. This was more of a laps in thought on my part.
This inheritance should be rectified in the next update.
However, it will only effect newly created submenus. If any of these internal values are changed after a submenu is created, it will not be effected by the change.

I'm looking at some options of dealing with this.
Report comment to moderator  
Reply With Quote
Unread 03/21/24, 09:44 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4989
File comments: 6040
Uploads: 78
Hi code, thanks for that info.

I'm not sure it's a bug with the default values.
IsJustaGhost said he mixes in the original ZO_ComboBox settings (like sorting) with the LSM default values, and it should only add missing settings and overwrite them with the LSM defaults -> Which basically are the ZO_ComboBox default values -> Sorting is true in default comboboxes).
-> Probably that is not working as intended then.

Might be that LSM scrollhelper is added to AF combobox before sorting get's disabled at AF, and that way LSM is not recognizing the "option" change" afterwards.
Code:
AF_FilterBar:Initialize(inventoryName, tradeSkillname, groupName, subfilterNames, excludeTheseButtons)
1st combobox
line 162 2nd scroll helper with no options.sortEntries
line 499 3rd manual comboBox:SetSortsItems(false)

And 3rd does not update options.scrollEntries in self.dropdown.scrollHelper
I'm working on some AF changes and add it there to the options passd in to LSM, to use sortEntries = false then too.
Code:
self.dropdown.scrollHelper = AddCustomScrollableComboBoxDropdownMenu(self.control, self.dropdown,
            {   visibleRowsDropdown=settings.dropdownVisibleRows,
                visibleRowsSubmenu=settings.dropdownVisibleSubmenuRows,
                --dropdown=comboBoxObject
                font = "ZoFontGameSmall",
                sortEntries = false, --> add this
            }
    )


Originally Posted by code65536
There is a problem with Advanced Filters in Update 41, resulting from a behavioral change in LibScrollableMenu.

Originally, Advanced Filters did not sort the menu items, and instead will display them in the order in which the menu was populated. For example, a filter for item quality might have "Normal", "Fine", "Superior", "Epic", ..., in the order of low to high quality.

But in Update 41, Advanced Filters now sorts that alphabetically, so the menu now shows "Epic", "Fine", ..., which is a pretty useless sort order for this filter.

The cause of this problem is the addition of the "sortEntries" parameter in LibScrollableMenu, which defaults to true.

I'm writing about this bug here, under LibScrollableMenu instead of under AF, because I personally think that the fault lies mostly with the library's selection of a bad default for the "sortEntries" parameter. Overriding the order specified by the the calling addon is surprising behavior. This is especially true since this a change in behavior from previous versions, and there was no mention of it in the changelog.

As such, I believe that this behavior should have been opt-in, rather than opt-out. The default should be "false", and addons that want an alphabetical sort order should have to explicitly opt in.

(Alternatively, if you believe that alphabetical sort should be the default for the library, then Advanced Filters will need to explicitly specify a sortEntries parameter of false during initialization, but, again, I strongly believe that the better solution is to not have a library do unexpected things by default.)
Last edited by Baertram : 03/21/24 at 10:06 AM.
Report comment to moderator  
Reply With Quote
Unread 03/21/24, 09:33 AM  
code65536
AddOn Author - Click to view AddOns

Forum posts: 21
File comments: 374
Uploads: 40
There is a problem with Advanced Filters in Update 41, resulting from a behavioral change in LibScrollableMenu.

Originally, Advanced Filters did not sort the menu items, and instead will display them in the order in which the menu was populated. For example, a filter for item quality might have "Normal", "Fine", "Superior", "Epic", ..., in the order of low to high quality.

But in Update 41, Advanced Filters now sorts that alphabetically, so the menu now shows "Epic", "Fine", ..., which is a pretty useless sort order for this filter.

The cause of this problem is the addition of the "sortEntries" parameter in LibScrollableMenu, which defaults to true.

I'm writing about this bug here, under LibScrollableMenu instead of under AF, because I personally think that the fault lies mostly with the library's selection of a bad default for the "sortEntries" parameter. Overriding the order specified by the the calling addon is surprising behavior. This is especially true since this a change in behavior from previous versions, and there was no mention of it in the changelog.

As such, I believe that this behavior should have been opt-in, rather than opt-out. The default should be "false", and addons that want an alphabetical sort order should have to explicitly opt in.

(Alternatively, if you believe that alphabetical sort should be the default for the library, then Advanced Filters will need to explicitly specify a sortEntries parameter of false during initialization, but, again, I strongly believe that the better solution is to not have a library do unexpected things by default.)
Last edited by code65536 : 03/21/24 at 09:37 AM.
Report comment to moderator  
Reply With Quote
Unread 03/11/24, 04:45 AM  
ChrisK

Forum posts: 0
File comments: 176
Uploads: 0
Thanks, Baertram & IsJustaGhost for the work on our favorite addons
Report comment to moderator  
Reply With Quote
Unread 03/11/24, 03:11 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4989
File comments: 6040
Uploads: 78
1.9 Baertram - 2024-03-11 - Compatible with API101041 "Scions of Ithelia"
!A very huge thanks to IsJustaGhost for all his work on recoding the total library to get it compatible with Scions of Ithelia!

-Made compatible with Scions of Ithelia
-Fixed several bugs

-> Attention: Some API functions for context menus changed in param/signature
Please check your addon's API function signature:

--AddCustomScrollableMenu(entries, options) -> Removed 1st param parentCtrl
--SetCustomScrollableMenuOptions(options) -> Removed 2nd param scrollHelper (maybe readded. currently this function will onyl work for ContextMenus. If you want to change the options of a dropdown, it's currently not possible anymore after creating the dropdown. We are working on an a way.
--ShowCustomScrollableMenu(controlToAnchorTo, options) -> Removed 2nd to 4th params controlToAnchorTo, point, relativePoint, offsetX, offsetY and replaced 2nd with options
Report comment to moderator  
Reply With Quote
Unread 01/29/24, 03:12 PM  
Gamer1986PAN
AddOn Author - Click to view AddOns

Forum posts: 87
File comments: 652
Uploads: 2
Guess the current PTS patch does break LibScrollableMenu:

Code:
user:/AddOns/LibScrollableMenu/LibScrollableMenu.lua:547: attempt to index a nil value
stack traceback:
user:/AddOns/LibScrollableMenu/LibScrollableMenu.lua:547: in function 'ScrollableDropdownHelper:Initialize'
/EsoUI/Libraries/Utility/BaseObject.lua:231: in function 'ZO_InitializingObject:New'
user:/AddOns/LibScrollableMenu/LibScrollableMenu.lua:1385: in function 'ScrollableSubmenu:Initialize'
/EsoUI/Libraries/Utility/BaseObject.lua:231: in function 'ZO_InitializingObject:New'
user:/AddOns/LibScrollableMenu/LibScrollableMenu.lua:1340: in function 'getScrollableSubmenu'
user:/AddOns/LibScrollableMenu/LibScrollableMenu.lua:2092: in function 'onAddonLoaded'
Just to make sure you are aware of that and we get a fast fix for it.
Report comment to moderator  
Reply With Quote
Unread 12/10/23, 07:12 PM  
Smugger21
 
Smugger21's Avatar
AddOn Author - Click to view AddOns

Forum posts: 4
File comments: 23
Uploads: 1
Re: Re: Update causes Advanced Filters to stop working

Originally Posted by Baertram
Hi, by not working you mean what exactly? Entries in teh dropdown filterboxes are missing in total? Clicking the entries does nothing?
Any Screenshots to explain more?
Sorry, I guess I was not entirely clear, it seems to be that items in the menu when clicked on are not having their event/function fired off.
And when I woke up I just realized that the menu items that didn't work were on the main menu and things that did work were in Sub-Menus.


Originally Posted by Baertram
The filter dropdown does show the filters, like level filter, for me properly.
Clicking one level range in the submenu does not filter anything then for you?
It is displayed, it just does not fire the event it is supposed to I guess

Originally Posted by Baertram
Edit:
Seems that the callbacks of the filters do not work if they are "no submenu". As "Filters" -> 1 to 10 works, but others like "Heal staff" does not.
On it
LOL I just seen this edit as I was replying and yup, that is what seems to be the issue.

Originally Posted by Baertram
Think I found out what is happening and was able to fix it.
I see you put out an update, I will check to see if it is fixed now.
EDIT: Yup, seems to be good, everything seems to be working correctly again with this update!

Thank You.
Last edited by Smugger21 : 12/10/23 at 07:30 PM.
Report comment to moderator  
Reply With Quote
Unread 12/10/23, 10:27 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4989
File comments: 6040
Uploads: 78
Think I found out what is happening and was able to fix it.
Last edited by Baertram : 12/10/23 at 11:27 AM.
Report comment to moderator  
Reply With Quote
Unread 12/10/23, 06:33 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4989
File comments: 6040
Uploads: 78
Re: Update causes Advanced Filters to stop working

Hi, by not working you mean what exactly? Entries in teh dropdown filterboxes are missing in total? Clicking the entries does nothing?
Any Screenshots to explain more?

The filter dropdown does show the filters, like level filter, for me properly.
Clicking one level range in the submenu does not filter anything then for you?

Did you test to disable ALL other addons AND AF filter dropdown plugins and only run AF alone?

Which other AF plugins do you use and which do not work, and which work?
If you disable your local AF plugin, does it work then?

Thank you

Edit:
Seems that the callbacks of the filters do not work if they are "no submenu". As "Filters" -> 1 to 10 works, but others like "Heal staff" does not.
On it

Originally Posted by Smugger21
So I did all the testing I could and finally figured out which addon caused the issue.

This recent update causes the Built-In Advanced Filters menu items to stop working, however the Custom Advanced Filter Plugin I made still works (It sorts based on TTC Prices, I have not uploaded it yet, it is something my wife and I use), some of the other Custom Plugin Filters also stopped working, some still do but none of the Built-In AF filters worked.

Reverting back to version 1.4 of this Lib and it is now working again.

If you need me to send you my custom plugin that still works with the update, let me know.
I guess it seems odd that some of plugins work but Built-In functions of AF do not.

Note that no Error actually occurs, it just fails.

Also another note, if I try to change the filter back to "All" after changing it to something that did not work, and I try to switch to any other normal in-game Filter or Sub-Filter (EG From Weapons to Armor or Even inside Armor > Light to Medium) that when I switch back to the In-Game Filter/Sub-Filter that I had change the AF on, it is back to the last failed filter setting.

So here to be more specific, I have a bunch of Consumables in my Junk, if I switch to the In-Game Sub-Filter under Junk to Consumables, and switch it to "Crafted" it does not work, and then when I switch it back to "All" (which actually fails also) and switch to the All Junk Sub-Filter, and go back to the Consumables Sub-Filter, the AF is set back to "Crafted".

Hope this helps in understanding what is going on...
I have reverted back to 1.4 for now.
Last edited by Baertram : 12/10/23 at 09:39 AM.
Report comment to moderator  
Reply With Quote
Unread 12/10/23, 04:07 AM  
Smugger21
 
Smugger21's Avatar
AddOn Author - Click to view AddOns

Forum posts: 4
File comments: 23
Uploads: 1
Update causes Advanced Filters to stop working

So I did all the testing I could and finally figured out which addon caused the issue.

This recent update causes the Built-In Advanced Filters menu items to stop working, however the Custom Advanced Filter Plugin I made still works (It sorts based on TTC Prices, I have not uploaded it yet, it is something my wife and I use), some of the other Custom Plugin Filters also stopped working, some still do but none of the Built-In AF filters worked.

Reverting back to version 1.4 of this Lib and it is now working again.

If you need me to send you my custom plugin that still works with the update, let me know.
I guess it seems odd that some of plugins work but Built-In functions of AF do not.

Note that no Error actually occurs, it just fails.

Also another note, if I try to change the filter back to "All" after changing it to something that did not work, and I try to switch to any other normal in-game Filter or Sub-Filter (EG From Weapons to Armor or Even inside Armor > Light to Medium) that when I switch back to the In-Game Filter/Sub-Filter that I had change the AF on, it is back to the last failed filter setting.

So here to be more specific, I have a bunch of Consumables in my Junk, if I switch to the In-Game Sub-Filter under Junk to Consumables, and switch it to "Crafted" it does not work, and then when I switch it back to "All" (which actually fails also) and switch to the All Junk Sub-Filter, and go back to the Consumables Sub-Filter, the AF is set back to "Crafted".

Hope this helps in understanding what is going on...
I have reverted back to 1.4 for now.
Last edited by Smugger21 : 12/10/23 at 04:12 AM.
Report comment to moderator  
Reply With Quote
Unread 12/02/23, 07:53 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4989
File comments: 6040
Uploads: 78
Originally Posted by ewscharf
Originally Posted by Baertram
Check your PM here please for a test BETA version, hope it works for you.
It's perfect. Thank you so much!
Thanks for the test. Credits of the fix go to IsJustaGhost
Last edited by Baertram : 12/02/23 at 07:53 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: