20#include "../NodeGraphShared/BTGraphDocumentConverter.h"
21#include "../BlueprintEditor/BTNodeGraphManager.h"
22#include "../BlueprintEditor/NodeGraphPanel.h"
23#include "../BlueprintEditor/EditorContext.h"
26#include "../ECS_Components_AI.h"
27#include "../third_party/imgui/imgui.h"
46 SYSTEM_LOG <<
"[BTDebugWindow] NodeGraph debug mode initialized (Runtime/Read-Only)"
64 SYSTEM_LOG <<
"[BTDebugWindow] NodeGraph debug mode shutdown" << std::endl;
76 ImGui::TextDisabled(
"Select an entity from the list to view its behavior tree");
83 ImGui::TextColored(
ImVec4(1.f, 0.4f, 0.4f, 1.f),
84 "Selected entity has no BehaviorTreeRuntime_data");
97 ImGui::TextColored(
ImVec4(1.f, 0.5f, 0.f, 1.f),
98 "BehaviorTree asset not found (ID: %u)",
btRuntime.AITreeAssetId);
116 ImGui::TextColored(
ImVec4(1.f, 0.3f, 0.3f, 1.f),
117 "Failed to convert BT graph");
134 SYSTEM_LOG <<
"[BTDebugWindow] Loaded graph for tree '" <<
tree->name
150 static_cast<int>(
btRuntime.AICurrentNodeIndex));
155 btRuntime.lastStatus == 1 ?
"Success" :
"Failure";
157 ImGui::TextColored(
ImVec4(0.4f, 1.f, 0.4f, 1.f),
158 "Tree: %s | Active node: #%u | Status: %s",
Runtime debugger for behavior tree visualization and inspection.
Data-driven behavior tree system for AI decision making.
ComponentTypeID GetComponentTypeID_Static()
static BehaviorTreeManager & Get()
const BehaviorTreeAsset * GetTreeByAnyId(uint32_t treeId) const
void RenderNodeGraphDebugPanel()
EntityID m_selectedEntity
void ShutdownNodeGraphDebugMode()
NodeGraphPanel m_nodeGraphPanel
uint32_t m_lastDebugTreeId
void InitNodeGraphDebugMode()
static EditorContext & Get()
bool CloseGraph(int graphId)
void SetActiveGraph(int graphId)
NodeGraph * GetGraph(int graphId)
int CreateGraph(const std::string &name, const std::string &type)
static NodeGraphManager & Get()
static void SetActiveDebugNode(int localNodeId)
Set the local node ID that is currently executing.
static NodeGraph * FromBehaviorTree(const BehaviorTreeAsset *tree)
Converts a BehaviorTreeAsset into a heap-allocated NodeGraph.
static void SyncActiveNode(NodeGraph *graph, uint32_t currentNodeId)
Synchronises the active-node metadata in an existing NodeGraph.
static World & Get()
Get singleton instance (short form)
< Provides AssetID and INVALID_ASSET_ID