-
nightfox authored
When displaying the menu items, rather than directly referring to the list of menu item objects, there are now a couple of functions (mainly for internal use), NumItems() (which returns the number of items) and GetItem() (which returns a specific menu item object). The intent is that calling code can replace these two functions in the DDLightbarMenu object to have the DDLightbarMenu effectively access a different list of items rather than its own list of items. This can be more efficient, for instance, in scripts that are working with a Synchronet messagebase, to avoid calling DDLightbarMenu's Add() function to add/copy a bunch of data, which can take significant time (i.e., if a messagebase contains a lot of messages). The colors.itemColor and colors.selectedItemColor properties in a DDLightbarMenu object can now be either a string (with Synchronet color/attribute codes for the item text) or an array with objects specifying color/attribute codes for different parts of an item's text string displayed on the menu. Item color arrays: Currently, colors.itemColor and colors.seletedItemColor within a DDLightbarMenu object can be either a string (containing color/attribute codes) or an array with color/attribute codes for different sections of the item strings to display in the menu. The array is to contain objects with the following properties: start: The index of the first character in the item string to apply the colors to end: One past the last character index in the string to apply the colors to attrs: The Synchronet attribute codes to apply to the section of the item string For the last item, the 'end' property can be -1, 0, or greater than the length of the item to apply the color/attribute codes to the rest of the string.
nightfox authoredWhen displaying the menu items, rather than directly referring to the list of menu item objects, there are now a couple of functions (mainly for internal use), NumItems() (which returns the number of items) and GetItem() (which returns a specific menu item object). The intent is that calling code can replace these two functions in the DDLightbarMenu object to have the DDLightbarMenu effectively access a different list of items rather than its own list of items. This can be more efficient, for instance, in scripts that are working with a Synchronet messagebase, to avoid calling DDLightbarMenu's Add() function to add/copy a bunch of data, which can take significant time (i.e., if a messagebase contains a lot of messages). The colors.itemColor and colors.selectedItemColor properties in a DDLightbarMenu object can now be either a string (with Synchronet color/attribute codes for the item text) or an array with objects specifying color/attribute codes for different parts of an item's text string displayed on the menu. Item color arrays: Currently, colors.itemColor and colors.seletedItemColor within a DDLightbarMenu object can be either a string (containing color/attribute codes) or an array with color/attribute codes for different sections of the item strings to display in the menu. The array is to contain objects with the following properties: start: The index of the first character in the item string to apply the colors to end: One past the last character index in the string to apply the colors to attrs: The Synchronet attribute codes to apply to the section of the item string For the last item, the 'end' property can be -1, 0, or greater than the length of the item to apply the color/attribute codes to the rest of the string.