36struct NodeSearchResult {
111 const std::vector<NodeSearchResult>&
GetResults()
const;
ComponentTypeID GetComponentTypeID_Static()
Singleton fuzzy-search panel for adding nodes to the graph.
int GetSelectedIndex() const
Returns the index of the currently highlighted result (-1 = none).
void SelectNext()
Moves the selection down by one step (wraps around).
void UpdateQuery(const std::string &query)
Recomputes the result list for the given query string.
bool IsOpen() const
Returns true if the panel is currently visible.
void SelectPrevious()
Moves the selection up by one step (wraps around).
std::vector< NodeSearchResult > m_Results
Current filtered/sorted results.
float GetSpawnX() const
Returns the X coordinate where the new node should be spawned.
std::function< void(const std::string &, float, float)> m_OnNodeAdd
void ConfirmSelection(int index)
Fires the OnNodeAdd callback for the result at index and closes the panel.
const std::vector< NodeSearchResult > & GetResults() const
Returns the current result list sorted by relevance (best first).
void OpenSearch(float posX, float posY)
Opens the search panel at the given graph-space position.
std::vector< NodeSearchResult > m_Catalogue
Full unfiltered catalogue.
void CloseSearch()
Closes the search panel and clears the query.
float GetSpawnY() const
Returns the Y coordinate where the new node should be spawned.
static float ComputeScore(const std::string &query, const std::string &candidate)
Compute a [0..1] relevance score; returns 0 if there is no match.
static NodeSearchPanel & Get()
Returns the single shared instance.
void SetNodeAddCallback(std::function< void(const std::string &, float, float)> callback)
Registers the callback that fires when the user confirms a node.
< Provides AssetID and INVALID_ASSET_ID
std::string category
Category label (e.g. "ControlFlow")
std::string name
Display name of the node type.
std::string nodeType
Internal type key (e.g. "Sequence")
std::string description
Short human-readable description.
float relevanceScore
Higher = better match.