public record class DelegatePaletteSourceA source over a list somebody else keeps.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
What an asset browser, a scene hierarchy and a settings page each register: they have the list and know what to do with a choice, and neither of those is a reason to write a class.
⚠ It scores every entry and honours limit only when the query is empty. Stopping early on a query would return the first ten that matched rather than the ten that matched best, which is the failure that makes a palette feel broken — the thing you typed the name of is not in the list. A source over a hundred thousand assets should index rather than delegate.
Fields and properties (3)
public string CategoryWhat to call its results.
public Func<IEnumerable<string>> EntriesWhat is in it, asked each time the query changes.
public Action<string> ChosenWhat choosing one does.
Methods (2)
public DelegatePaletteSource(string Category, Func<IEnumerable<string>> Entries, Action<string> Chosen)A source over a list somebody else keeps.
public void Search(string query, List<PaletteItem> results, int limit)Adds what matches to the list.
Used by (2)
- EditorApplicationVixen.Editor.App
- PaletteTestsVixen.Editor.Ui.Tests