Vixen
5cf01f31
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.

⚠ An overlay and a root child, as NodeSearchPopup is, and it was neither. It used to be a child of the tree view placed with left/top — which are relative to the view, while Show was documented as taking document space, so every panel not docked at the window's origin would have put it off by the panel's offset. Nobody saw that because nothing ever opened it (#1370). As an overlay it is drawn over whatever clips the panel, closes on Escape and on a press outside it, and keeps the focus in its field so the next letter typed lands there.

The popup is BehaviorSearchPopup.vxml (#89); this file is the accessibility modifier, the ranking rule, which reads no element, and the two elements that exist only so that markup can write an intrinsic tag's own Text.

Fields and properties (6)

  • protected override string TagName
  • public TextBox Query

    What was typed.

  • public ScrollView List

    What scrolls the rows.

  • public UiElement Results

    The rows: List's content.

  • public IReadOnlyList<BehaviorNodeType> Matches

    What is offered, best first.

  • public IReadOnlyList<BehaviorSlot> Slots

    Which slots it was opened for.

Events (1)

Methods (7)

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

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

  • protected override void OnCreated()
  • protected override void OnRemoved()
  • public void Show(BehaviorNodeSchema library, BehaviorSlot wanted, float x, float y)

    Opens it over a slot.

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

    Opens it for anything that fits one of several slots.

  • public void Rank()

    Re-ranks the rows against what has been typed.

  • public bool Pick(int index)

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

Used by (3)

  • BehaviorSearchPopupDumpTestsVixen.Editor.AssetEditors.Tests
  • BehaviorSearchTestsVixen.Editor.AssetEditors.Tests
  • BehaviorTreeViewVixen.Editor.AssetEditors