Finally got the scrollpool working properly with dynamic content height

This commit is contained in:
Sinai
2021-04-19 23:47:25 +10:00
parent 7a253fa0a0
commit 300b35c2d3
8 changed files with 149 additions and 160 deletions

View File

@ -14,13 +14,13 @@ namespace UnityExplorer.UI.Widgets
public Action<ButtonCell<T>> OnClick;
public ButtonListCell<T> list;
public ButtonListSource<T> list;
public GameObject uiRoot;
public Text buttonText;
public Button button;
public ButtonCell(ButtonListCell<T> list, GameObject uiRoot, Button button, Text text)
public ButtonCell(ButtonListSource<T> list, GameObject uiRoot, Button button, Text text)
{
this.list = list;
this.uiRoot = uiRoot;

View File

@ -9,7 +9,7 @@ using UnityExplorer.UI.Widgets;
namespace UnityExplorer.UI.Widgets
{
public class ButtonListCell<T> : IPoolDataSource
public class ButtonListSource<T> : IPoolDataSource
{
internal ScrollPool Scroller;
@ -28,7 +28,7 @@ namespace UnityExplorer.UI.Widgets
}
private string currentFilter;
public ButtonListCell(ScrollPool infiniteScroller, Func<List<T>> getEntriesMethod,
public ButtonListSource(ScrollPool infiniteScroller, Func<List<T>> getEntriesMethod,
Action<ButtonCell<T>, int> setICellMethod, Func<T, string, bool> shouldDisplayMethod,
Action<ButtonCell<T>> onCellClickedMethod)
{