Implement Options panel, some cleanups

This commit is contained in:
Sinai
2021-05-13 23:03:30 +10:00
parent ccd08c3a63
commit 89022db5fc
22 changed files with 315 additions and 150 deletions

View File

@ -18,7 +18,7 @@ namespace UnityExplorer.UI.Widgets.AutoComplete
public class AutoCompleteModal : UIPanel
{
public static AutoCompleteModal Instance => UIManager.AutoCompleter;
public static AutoCompleteModal Instance => UIManager.GetPanel<AutoCompleteModal>(UIManager.Panels.AutoCompleter);
public override string Name => "AutoCompleter";
public override UIManager.Panels PanelType => UIManager.Panels.AutoCompleter;
@ -201,6 +201,6 @@ namespace UnityExplorer.UI.Widgets.AutoComplete
// not savable
}
public override string GetSaveData() => null;
public override string GetSaveDataFromConfigManager() => null;
}
}

View File

@ -10,7 +10,7 @@ using UnityExplorer.UI.Widgets;
namespace UnityExplorer.UI.Widgets
{
public class ButtonListSource<T> : IPoolDataSource<ButtonCell>
public class ButtonListSource<T> : ICellPoolDataSource<ButtonCell>
{
internal ScrollPool<ButtonCell> ScrollPool;

View File

@ -6,7 +6,7 @@ using UnityEngine;
namespace UnityExplorer.UI.Widgets
{
public interface IPoolDataSource<T> where T : ICell
public interface ICellPoolDataSource<T> where T : ICell
{
int ItemCount { get; }

View File

@ -27,7 +27,7 @@ namespace UnityExplorer.UI.Widgets
this.ScrollRect = scrollRect;
}
public IPoolDataSource<T> DataSource { get; set; }
public ICellPoolDataSource<T> DataSource { get; set; }
public readonly List<T> CellPool = new List<T>();
@ -143,7 +143,7 @@ namespace UnityExplorer.UI.Widgets
//private bool Initialized;
/// <summary>Should be called only once, when the scroll pool is created.</summary>
public void Initialize(IPoolDataSource<T> dataSource, Action onHeightChangedListener = null)
public void Initialize(ICellPoolDataSource<T> dataSource, Action onHeightChangedListener = null)
{
this.DataSource = dataSource;
HeightCache = new DataHeightCache<T>(this);

View File

@ -11,7 +11,7 @@ using UnityExplorer.UI.Widgets;
namespace UnityExplorer.UI.Widgets
{
public class TransformTree : IPoolDataSource<TransformCell>
public class TransformTree : ICellPoolDataSource<TransformCell>
{
public Func<IEnumerable<GameObject>> GetRootEntriesMethod;