mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-13 07:16:37 +08:00
more progress
This commit is contained in:
@ -20,6 +20,22 @@ namespace UnityExplorer.UI.Widgets.AutoComplete
|
||||
|
||||
// Instance
|
||||
|
||||
public override string Name => "AutoCompleter";
|
||||
public override UIManager.Panels PanelType => UIManager.Panels.AutoCompleter;
|
||||
|
||||
public override bool CanDragAndResize => false;
|
||||
public override bool ShouldSaveActiveState => false;
|
||||
public override bool NavButtonWanted => false;
|
||||
|
||||
public ISuggestionProvider CurrentHandler { get; private set; }
|
||||
|
||||
public ButtonListSource<Suggestion> dataHandler;
|
||||
public ScrollPool<ButtonCell> scrollPool;
|
||||
|
||||
private List<Suggestion> suggestions = new List<Suggestion>();
|
||||
|
||||
private int lastCaretPos;
|
||||
|
||||
public AutoCompleter()
|
||||
{
|
||||
OnPanelsReordered += UIPanel_OnPanelsReordered;
|
||||
@ -51,20 +67,6 @@ namespace UnityExplorer.UI.Widgets.AutoComplete
|
||||
}
|
||||
}
|
||||
|
||||
public override string Name => "AutoCompleter";
|
||||
public override UIManager.Panels PanelType => UIManager.Panels.AutoCompleter;
|
||||
|
||||
public override bool CanDrag => false;
|
||||
|
||||
public ISuggestionProvider CurrentHandler { get; private set; }
|
||||
|
||||
public ButtonListSource<Suggestion> dataHandler;
|
||||
public ScrollPool<ButtonCell> scrollPool;
|
||||
|
||||
private List<Suggestion> suggestions = new List<Suggestion>();
|
||||
|
||||
private int lastCaretPos;
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
if (!UIRoot || !UIRoot.activeSelf)
|
||||
|
@ -210,9 +210,11 @@ namespace UnityExplorer.UI.Widgets
|
||||
// If we somehow reached the end and didn't find the data index...
|
||||
if (i == rangeCache.Count - 1)
|
||||
{
|
||||
// This should never happen. We might be in a rebuild right now so don't
|
||||
// rebuild again, we could overflow the stack. Just log it.
|
||||
ExplorerCore.LogWarning($"DataHeightCache: Looking for range index of data {dataIndex} but reached the end and didn't find it.");
|
||||
if (!inRebuild)
|
||||
RebuildCache();
|
||||
else
|
||||
ExplorerCore.LogWarning($"DataHeightCache: Looking for range index of data {dataIndex} but " +
|
||||
$"reached the end and didn't find it. Count: {rangeCache.Count}, last index: {rangeCache[rangeCache.Count - 1]}");
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user