Quantcast
Multiple Scroll Lists - ESOUI
Thread Tools Display Modes
06/13/21, 10:38 PM   #1
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 286
Multiple Scroll Lists

The same as this thread, how does one make two or three scroll lists side by side?

My variation of that is I want to make three columns. The first two would set the index or key for the table for the other columns.

I am hoping someone has a suggestion and a way to do this as well because I have been tracking loot for almost a year now and vendors and such. Although I think my tracking method is inherently broken and inaccurate for NPCs. Despite all the possible things that are broken about the mod I want to view the location in one column, the NPC name in another and then the contents in the third. What very little I have done with scroll lists I think I can make the xml, and then override the scroll list to build the masterList part of it. Once I have that I might be able to make a SetupRow function.
Code:
    <TopLevelControl movable="true" mouseEnabled="true" name="ProvisionerColumnMapName" hidden="true">
      <Dimensions x="260" y="720"/>
    </TopLevelControl>

    <TopLevelControl movable="true" mouseEnabled="true" name="ProvisionerColumnNpcName" hidden="true">
      <Dimensions x="450" y="720"/>
    </TopLevelControl>

    <TopLevelControl movable="true" mouseEnabled="true" name="ProvisionerColumnItems" hidden="true">
      <Dimensions x="450" y="720"/>
    </TopLevelControl>
It's knowing how to know if I select something in column one (the map) how do I then make that the index for column two (The NPC) so that column three has the proper contents. What do you use to indicate I have selected the row in xxx column?
__________________
Admin for TES5Edit, occasional LOOT masterlist contributor, and Wrye Bash contributor. I also maintain special Fallout 3 and Fallout NV versions of Wrye Flash.

Last edited by Sharlikran : 06/13/21 at 10:55 PM.
  Reply With Quote
06/14/21, 02:06 AM   #2
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 3,597
afaik you can only use, via function ZO_ScrollList_EnableSelection, the ZO_SortFilterList's callback function selectCallback which you need to define then.
But this is fired as the row is selected, not a single column!
Reacting to a single column is not possible afaik as the row is mouse enabled and always "overwrites" the mouse handlers for the single columns.
At least I did not manage to get it to work yet.
e.g. I tried to enable a <OnMouseUp> handler within the row's virtual template XML columns. But it never fired.

Lua Code:
  1. local selectCallback = function(previouslySelectedData, selectedData, reselectingDuringRebuild)
  2. --do stuff
  3. end
  4.  
  5. ZO_ScrollList_AddDataType(scrollListControl, dataTypeId, templateName, rowHeight, setupFunction, rowHideCallback, dataTypeSelectSound, resetControlCallback)
  6.     ZO_ScrollList_EnableSelection(scrollListControl, selectTemplate, selectCallback)

To your question about multiple lists:
You could build 3 ZO_SortFilterLists via XML templates.
See here how:
https://wiki.esoui.com/How_to..._do_...templated_rows

Name them list1, list2 and list3 and give them their XML row templates with the columns you need.

As the functions of ZO_SortFilterList fire in this order:
ZO_SortFilterList:RefreshData() => BuildMasterList() => FilterScrollList() => SortScrollList() => CommitScrollList()

Enable the row selection in list1, like shown above via ZO_ScrollList_EnableSelection, and in the selectCallback define some code to update the entries of the list 2 according to your selection in list 1.
You can use the function list2:RefreshData() which will call list2:BuildMasterList() and list2:FilterScrollList() etc then.

And update the entries of list3 as the list2's CommitScrollList function is called so that entries in list3 are based on list2.

This way you can filter the list3 based on list 2 entries, list2 based on the selected enty of list1 as well.

Last edited by Baertram : 06/14/21 at 02:12 AM.
  Reply With Quote
06/14/21, 02:10 AM   #3
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 286
Okay that is fine. If I select row X in column one then I can simply store that information somehow as the key to my table so it is accessed as myItemList[key1] which key1 is the row selected. I am sure it will work after I start it but it doesn't seem simple at first.
__________________
Admin for TES5Edit, occasional LOOT masterlist contributor, and Wrye Bash contributor. I also maintain special Fallout 3 and Fallout NV versions of Wrye Flash.
  Reply With Quote
06/14/21, 02:15 AM   #4
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 3,597
Not sure how your row's columns look like and what you want to show when but if you only need the data of 1 of the columns of th row just simply use this data entry then for your needs?
e.g. the row got 10 columns but only the data.mapId is needed.
No matter what was selected then just use selectedData.mapId in the selectedCallback function to populate the entries of list2 and list3.

It's only difficult f you e.g. hot mapId, zoneId in your row, as 2 columns. And depending on your selected row BUT ALSO the selected column (mapId or zoneId) the list2 and list3 should update.
You maybe able to use the moc() function to get the control below the mouse/name of the column below the mouse, and in the selectedCallback check the colun below the mouse to get if it's mapId or zoneId.

Last edited by Baertram : 06/14/21 at 02:17 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Multiple Scroll Lists

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off