Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
BTNodePalette.h
Go to the documentation of this file.
1/**
2 * @file BTNodePalette.h
3 * @brief ImGui palette for dragging BT nodes
4 * @author Olympe Engine
5 * @date 2026-02-18
6 *
7 * @details
8 * Provides an ImGui window showing all available BT node types organized
9 * by category. Supports search filtering and drag-and-drop functionality.
10 */
11
12#pragma once
13
14#include "BTNodeRegistry.h"
15#include <string>
16
17namespace Olympe {
18namespace AI {
19
20/**
21 * @class BTNodePalette
22 * @brief UI palette for BT node selection
23 *
24 * @details
25 * Renders an ImGui window with all registered BT node types. Users can
26 * search and drag nodes to create them in the editor.
27 */
29public:
31 ~BTNodePalette() = default;
32
33 /**
34 * @brief Render the palette window
35 * @param isOpen Pointer to bool controlling window visibility
36 */
37 void Render(bool* isOpen);
38
39 /**
40 * @brief Get the node type being dragged (if any)
41 * @return Type name or empty string
42 */
43 std::string GetDraggedNodeType() const { return m_draggedNodeType; }
44
45 /**
46 * @brief Check if a drag operation is in progress
47 * @return true if dragging
48 */
49 bool IsDragging() const { return m_isDragging; }
50
51 /**
52 * @brief Reset drag state (call after drop)
53 */
54 void ResetDrag() { m_isDragging = false; m_draggedNodeType.clear(); }
55
56private:
57 /**
58 * @brief Render a category section
59 * @param categoryName Display name of category
60 * @param category Category enum
61 */
62 void RenderCategory(const std::string& categoryName, BTNodeCategory category);
63
64 /**
65 * @brief Render a single node button
66 * @param typeName Node type identifier
67 */
68 void RenderNodeButton(const std::string& typeName);
69
70 std::string m_draggedNodeType;
72 char m_searchFilter[256];
73};
74
75} // namespace AI
76} // namespace Olympe
Registry of all Behavior Tree node types for AIGraphPlugin_BT.
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
UI palette for BT node selection.
std::string GetDraggedNodeType() const
Get the node type being dragged (if any)
void ResetDrag()
Reset drag state (call after drop)
void RenderCategory(const std::string &categoryName, BTNodeCategory category)
Render a category section.
void RenderNodeButton(const std::string &typeName)
Render a single node button.
void Render(bool *isOpen)
Render the palette window.
bool IsDragging() const
Check if a drag operation is in progress.
BTNodeCategory
Categories of behavior tree nodes.
< Provides AssetID and INVALID_ASSET_ID