16#include "../../BlueprintEditor/NodeStyleRegistry.h"
17#include "../../BlueprintEditor/BTNodeGraphManager.h"
18#include "../../third_party/imgui/imgui.h"
51 const std::string& typeName = *
typeIt;
92 ImGui::PushID(typeName.c_str());
103 float r =
static_cast<float>((style.
headerColor >> 0) & 0xFF) / 255.0f;
104 float g =
static_cast<float>((style.
headerColor >> 8) & 0xFF) / 255.0f;
105 float b =
static_cast<float>((style.
headerColor >> 16) & 0xFF) / 255.0f;
106 float a =
static_cast<float>((style.
headerColor >> 24) & 0xFF) / 255.0f;
114 if (ImGui::Button(label.c_str(),
ImVec2(-1.0f, 0.0f))) {
125 ImGui::SetDragDropPayload(
"BT_NODE_TYPE", typeName.c_str(), typeName.length() + 1);
128 ImGui::Text(
"Creating: %s",
typeInfo->displayName.c_str());
130 ImGui::EndDragDropSource();
134 if (ImGui::IsItemHovered()) {
135 ImGui::BeginTooltip();
136 ImGui::Text(
"%s",
typeInfo->description.c_str());
139 if (!
typeInfo->parameterNames.empty()) {
141 ImGui::Text(
"Parameters:");
145 ImGui::BulletText(
"%s",
paramIt->c_str());
154 ImGui::Text(
"Children: exactly %d",
typeInfo->minChildren);
156 ImGui::Text(
"Children: %d to %d",
typeInfo->minChildren,
typeInfo->maxChildren);
158 }
else if (
typeInfo->minChildren >= 0) {
159 ImGui::Text(
"Children: at least %d",
typeInfo->minChildren);
161 ImGui::Text(
"Children: at most %d",
typeInfo->maxChildren);
168 ImGui::PopStyleColor();
ImGui palette for dragging BT nodes.
Registry of all Behavior Tree node types for AIGraphPlugin_BT.
ComponentTypeID GetComponentTypeID_Static()
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.
std::string m_draggedNodeType
static BTNodeRegistry & Get()
Get singleton instance.
const NodeStyle & GetStyle(NodeType type) const
Returns the style for the given node type.
static NodeStyleRegistry & Get()
Returns the singleton instance.
BTNodeCategory
Categories of behavior tree nodes.
@ Action
Leaf execution nodes (Wait, Move, Attack, etc.)
@ Composite
Flow control nodes (Selector, Sequence, Parallel)
@ Decorator
Modifiers (Inverter, Repeater, Cooldown, etc.)
@ Condition
Boolean checks (HasTarget, InRange, etc.)
< Provides AssetID and INVALID_ASSET_ID
NodeType StringToNodeType(const std::string &str)
Metadata for a behavior tree node type.
std::string displayName
Human-readable name (e.g., "Selector")
Visual descriptor for a single node type.
ImU32 headerColor
Title-bar background colour (ImNodes TitleBar colour slot).