Download
(12 Kb)
Download
Updated: 02/25/23 01:42 PM
Compatibility:
Firesong (8.2.5)
Updated:02/25/23 01:42 PM
Created:06/07/14 09:05 PM
Monthly downloads:106
Total downloads:23,405
Favorites:2
MD5:
Categories:Miscellaneous, Data Mods, Graphic UI Mods, ToolTip, Developer Utilities, ESO Tools & Utilities
Scroll List Example  Popular! (More than 5000 hits)
Version: 2.0.2
by: pills, ShadowMau
ScrollListExample

Requries: none

Provides a simple working example of making a scroll list. The scroll list is a list of unlocked pets. When a pet is selected, it is summoned. The user can use /sle hide or /sle show to toggle the scroll list window.

>>> Entirely rewritten. The originals by pills are included for those are are curious.

Much has changed in the years since this was originally written so I decided to entirely rewrite this example. I tried to stay true to what I surmise was the original intent of the author, which was to provide a simple example that demonstrates the major elements of scroll lists. From the example, a person should learn enough to be able to apply the concepts to more complex applications. There is little error checking in this example. Error checking should be added by the programmer given their specific application.

I learned much of this from LibScroll and many of the ideas here are derived from it.

I also added in a lot of documentation and a few examples on a couple ways to accomplish the same results. I am in no way an expert in Lua, XML, or scroll lists so someone more experienced may look at this and wonder why I did something a certain way when there may be a better way to do it. Thank you for your understanding.

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

Original from pills:
A basic scroll list example stripped down from MailR Guild Mail Beta (which took its scroll list implementation from Librarian).

code is undocumented (read self-documenting). Its pretty straight forward if you just want a simple window with a scroll list.

To populate this list just move your reticle around and point at NPCs or other players. It will try to gather a couple pieces of info and then update the list. you can also click entries in the list and it will dump the contents to the chat window just to demontrate how to interact with the row entries.

hope this helps some of the authors that were having trouble getting scroll lists to work.
2.0.2 (02-25-2023)
  • API update to Firesong
  • Tested to ensure there are still no error messages

2.0.1 (05-18-2021)
  • Fixed an error identified by Baertram.

2.0.0 (04-07-2021)
  • Completely rewritten to provide a clickable scroll list of unlocked pets.
Optional Files (0)


Archived Files (3)
File Name
Version
Size
Uploader
Date
2.0.1
9kB
ShadowMau
05/18/21 03:54 AM
2.0.0
9kB
ShadowMau
04/07/21 03:39 AM
1.0.0
3kB
pills
06/07/14 09:05 PM


Post A Reply Comment Options
Unread 05/18/21, 04:07 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4964
File comments: 6033
Uploads: 78
Originally Posted by ShadowMau
Silly mistake on my part. Thank you so much for pointing that out. I guess I always tested it on a character that also had my Favorite Pets addon also loaded.
Yeah, thought the same!
Thanks for the update to the example btw, using it for my LibAddonMenu-2.0 widget "order list box" to see the needed steps. Was easier as to check ZOs code again, or my other addons
Last edited by Baertram : 05/18/21 at 04:21 AM.
Report comment to moderator  
Reply With Quote
Unread 05/18/21, 03:50 AM  
ShadowMau
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 46
Uploads: 12
Silly mistake on my part. Thank you so much for pointing that out. I guess I always tested it on a character that also had my Favorite Pets addon also loaded.
Last edited by ShadowMau : 05/18/21 at 03:57 AM.
Report comment to moderator  
Reply With Quote
Unread 05/17/21, 02:55 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4964
File comments: 6033
Uploads: 78
I'm getting this error within the populate function upon login:
Code:
user:/AddOns/ScrollListExample/ScrollListExample.lua:191: attempt to index a nil value
|rstack traceback:
user:/AddOns/ScrollListExample/ScrollListExample.lua:191: in function 'ScrollListExample.Populate'
|caaaaaa<Locals> pets = [table:1]{}, petcounter = 0, unlockedpets = 84, count = 1 </Locals>|r
user:/AddOns/ScrollListExample/ScrollListExample.lua:96: in function 'ScrollListExample.Main'
user:/AddOns/ScrollListExample/ScrollListExample.lua:320: in function 'ScrollListExample.OnAddOnLoaded'
|caaaaaa<Locals> event = 65536, addonName = "ScrollListExample" </Locals>|r
You have forgotten to change the variable name there, from FavoritePet to ScrollListExample
local index = GetCollectibleIdFromType(FavoritePet.typePets, count)
Report comment to moderator  
Reply With Quote
Unread 04/07/21, 03:42 AM  
ShadowMau
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 46
Uploads: 12
Rewritten

Since so many places recommend this for people to learn how to use scroll lists, I have rewritten it to cover the basics. It is nothing fancy, but should give people a start. Hopefully this will help some people as they learn.
Report comment to moderator  
Reply With Quote
Unread 03/26/21, 09:29 AM  
ShadowMau
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 46
Uploads: 12
Thowing Errors

I just tried to use this to learn how to make scroll lists. When loaded it generated a bunch of error messages. If you are looking to learn how to make scroll lists, I suggest also looking at libscroll and the provided examples.
Report comment to moderator  
Reply With Quote
Unread 12/11/16, 01:23 PM  
Mitsarugi
 
Mitsarugi's Avatar
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 225
Uploads: 12
Re: Resurrected to work with ESO 2.6 One Tamriel

Originally Posted by ziggr
I used this example (and MailR and Master Merchant) to learn a bit about ZO_SortFilterList. Thank you so much for extracting this from MailR and publishing it.

As others have noted, this sample stopped working a while ago. But with a couple few changes, it works!

Changes, displayed on GitHub
  • Do not call UnitList:Initialize() from UnitList:New(). Someone else will call it for you. Calling it here causes double-initialization and duplicate item errors.
  • Fix SLE.MouseUp() to display fields that exist in data. Sample code addressed "gender" and "level" which do not exist.
  • Fix XML to refer to "zone", not "recipient".

Now to take what you've taught me, and apply it to my own add-on...
Line 111 of the .Lua file "race=tagetRace" should be "race=targetRace", fixes it
Report comment to moderator  
Reply With Quote
Unread 10/28/16, 04:03 PM  
ziggr
 
ziggr's Avatar
AddOn Author - Click to view AddOns

Forum posts: 27
File comments: 275
Uploads: 10
Resurrected to work with ESO 2.6 One Tamriel

I used this example (and MailR and Master Merchant) to learn a bit about ZO_SortFilterList. Thank you so much for extracting this from MailR and publishing it.

As others have noted, this sample stopped working a while ago. But with a couple few changes, it works!

Changes, displayed on GitHub
  • Do not call UnitList:Initialize() from UnitList:New(). Someone else will call it for you. Calling it here causes double-initialization and duplicate item errors.
  • Fix SLE.MouseUp() to display fields that exist in data. Sample code addressed "gender" and "level" which do not exist.
  • Fix XML to refer to "zone", not "recipient".

Now to take what you've taught me, and apply it to my own add-on...
Report comment to moderator  
Reply With Quote
Unread 06/03/15, 11:31 AM  
Argusus
AddOn Author - Click to view AddOns

Forum posts: 120
File comments: 113
Uploads: 2
This is very helpful!
Report comment to moderator  
Reply With Quote
Unread 10/10/14, 08:24 PM  
pills
AddOn Author - Click to view AddOns

Forum posts: 11
File comments: 77
Uploads: 6
Re: ScrollList Parent

Originally Posted by skobyjay
How does the ZO_SortFilterList know the "ZO_ScrollList" object to render itself inside? I'm wanting to make a window with 2 of these Scroll lists and not having any luck.
been awhile since ive looked at this. I believe you need to make a control a la the xml file in this example. Then when ytou instantiate your ZO_SortFilterList you tell it what control to attach itself to. There should be a New() function that is called in Init()
Report comment to moderator  
Reply With Quote
Unread 10/09/14, 09:39 PM  
Argusus
AddOn Author - Click to view AddOns

Forum posts: 120
File comments: 113
Uploads: 2
ScrollList Parent

How does the ZO_SortFilterList know the "ZO_ScrollList" object to render itself inside? I'm wanting to make a window with 2 of these Scroll lists and not having any luck.
Report comment to moderator  
Reply With Quote
Unread 06/08/14, 08:11 AM  
pills
AddOn Author - Click to view AddOns

Forum posts: 11
File comments: 77
Uploads: 6
Originally Posted by Saftsuse
Īm not an author, so im guessing thats why I dont understand what this is for. I jsut thought it seemed interesting that it gathers info by pointing at stuff with the reticle.
heh yeah its not going to be terrible useful for anyone not an author. certain things in the api arent as well documented as others so its nice to have examples of how to get some features working for other authors so they can turn around addons quicker and not bang their head as much.

I just needed a quick way to fill the list so you get enough items to be able to scroll. if you can think of a way to make it useful im more than happy to oblige
Report comment to moderator  
Reply With Quote
Unread 06/08/14, 02:32 AM  
Saftsuse
 
Saftsuse's Avatar

Forum posts: 13
File comments: 149
Uploads: 0
Īm not an author, so im guessing thats why I dont understand what this is for. I jsut thought it seemed interesting that it gathers info by pointing at stuff with the reticle.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: