Vixen
c7401864
csharp
public sealed class BehaviorSearchPopup

Search-to-create, filtered by what may go where.

Read the guide page for this →

Remarks

NodeSearch's ranked popup, in shape and in behaviour: type a few letters, get the things whose name or category matches, best first. What is different is the filter — dropping on a composite's child row offers composites and tasks, and dropping on a node's decorator strip offers decorators — because a tree's slots are typed where a dataflow graph's ports are.

⚠ It ranks on the same rule NodeSearch does and does not share the code. That framework's search is over NodeTypeDefinition, which carries ports and a factory this library has neither of. Twenty lines of ranking against a reference to a framework whose model was deliberately not taken is the wrong trade — doc 37 § D19.

Fields and properties (6)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • protected override bool AcceptsFocus

    Whether the focus can rest on this kind of control at all.

  • public TextBox Query

    What was typed.

  • public UiElement Results

    The rows.

  • public bool IsOpen

    Whether it is showing.

  • public IReadOnlyList<BehaviorNodeType> Matches

    What is offered, best first.

Events (1)

Methods (6)

  • protected override void OnCreated()

    Builds whatever this element is made of, once, as it joins a document.

  • public void Show(BehaviorNodeSchema library, BehaviorSlot wanted, float x, float y)

    Opens it over a slot.

  • public void Close()

    Closes it.

  • public void Rank()

    Re-ranks the rows against what has been typed.

  • public static int Score(BehaviorNodeType type, string query)

    How well a type answers a query. Zero means it does not.

  • public bool Pick(int index)

    Picks the row at an index, which is what a click and the keyboard both do.

Used by (1)

  • BehaviorTreeViewVixen.Editor.AssetEditors