16#include "../ECS_Entity.h"
18#include "../json_helper.h"
80 std::map<std::string, std::map<std::string, Color>>
nodeColors;
Command pattern implementation for behavior tree editor undo/redo.
Graph layout engine for behavior tree visualization.
Data-driven behavior tree system for AI decision making.
BTStatus
Behavior tree node execution status.
@ Running
Node is currently executing.
BTNodeType
Behavior tree node types.
AIMode
AI behavior modes for NPCs.
ComponentTypeID GetComponentTypeID_Static()
Manages undo/redo stacks for editor commands.
Computes clean hierarchical layouts for behavior trees.
Main debug window for behavior tree runtime visualization.
~BehaviorTreeDebugWindow()
void RenderBlackboardSection()
void RenderBezierConnection(const Vector &start, const Vector &end, uint32_t color, float thickness, float tangent)
uint32_t GetNodeColorByStatus(BTNodeType type, BTStatus status) const
Vector CalculatePanOffset(const Vector &graphCenter, const Vector &viewportSize) const
bool IsConnectionValid(uint32_t parentId, uint32_t childId) const
uint32_t m_dragSourceNodeId
BehaviorTreeAsset m_editingTree
float m_autoRefreshInterval
void RenderBehaviorTreeGraph()
std::vector< BTValidationMessage > m_validationMessages
int m_imnodesEditorContext
uint32_t GetPinColor(uint32_t nodeId, PinType pinType) const
void Initialize()
Initialize the debug window.
SDL_Renderer * m_separateRenderer
ImGuiContext * m_separateImGuiContext
void RenderInspectorPanel()
void RenderNodeGraphPanel()
void RenderEntityListPanel()
BehaviorTreeAsset CreateFromTemplate(int templateIndex, const std::string &name)
bool ValidateConnection(uint32_t parentId, uint32_t childId) const
std::vector< EntityDebugInfo > m_filteredEntities
void DestroySeparateWindow()
void ToggleVisibility()
Toggle window visibility (creates/destroys separate window)
std::deque< ExecutionLogEntry > m_executionLog
void RenderExecutionLog()
void UpdateEntitySorting()
BehaviorTreeDebugWindow()
void RenderNode(const BTNode *node, const BTNodeLayout *layout, bool isCurrentNode)
void HandleNodeDeletion()
void UpdateEntityFiltering()
void HandleNodeDuplication()
std::vector< uint32_t > m_selectedNodes
PinType m_dragSourcePinType
void ApplyConfigToLayout()
SDL_Window * m_separateWindow
void RenderNodeProperties()
EntityID m_selectedEntity
json SerializeTreeToJson(const BehaviorTreeAsset &tree) const
BTLayoutDirection m_layoutDirection
BTGraphLayoutEngine m_layoutEngine
std::string m_currentFilePath
void GetGraphBounds(Vector &outMin, Vector &outMax) const
std::map< BTNodeType, std::map< BTStatus, BTColor > > m_nodeColors
void CreateSeparateWindow()
void Shutdown()
Shutdown and cleanup.
std::vector< LinkInfo > m_linkMap
const size_t MAX_LOG_ENTRIES
void RenderNodePins(const BTNode *node, const BTNodeLayout *layout)
void Render()
Render the debug window (in separate SDL3 window)
std::vector< BTNodeLayout > m_currentLayout
void RenderEditorToolbar()
EntityID m_lastCenteredEntity
Vector SnapToGrid(const Vector &pos) const
void RenderEntityEntry(const EntityDebugInfo &info)
void RenderNodeConnections(const BTNode *node, const BTNodeLayout *layout, const BehaviorTreeAsset *tree)
uint32_t m_inspectedNodeId
void RenderValidationPanel()
bool m_imnodesInitialized
std::vector< EntityDebugInfo > m_entities
void RenderInSeparateWindow()
uint32_t GetNodeColor(BTNodeType type) const
void AddExecutionEntry(EntityID entity, uint32_t nodeId, const std::string &nodeName, BTStatus status)
Add an execution log entry.
float GetSafeZoom() const
bool m_showNodeProperties
bool IsVisible() const
Check if window is visible.
void HandleNodeCreation(BTNodeType nodeType)
std::string GetCurrentTimestamp() const
void ProcessEvent(SDL_Event *event)
Process SDL events for separate window.
bool m_showValidationPanel
BTCommandStack m_commandStack
const char * GetNodeIcon(BTNodeType type) const
PinType
Type of connection pin on a node.
@ Output
Output pin (right side of node in horizontal layout)
@ Input
Input pin (left side of node in horizontal layout)
BTLayoutDirection
Layout direction for behavior tree visualization.
@ TopToBottom
Traditional top-down layout (vertical)
Represents a single node in a behavior tree.
RGBA color value (0-255 range)
Configuration loaded from BT_config.json.
std::map< std::string, std::map< std::string, Color > > nodeColors
float connectionThickness
float pinOutlineThickness
Layout information for a single behavior tree node.
Cached debug information for a single entity.
Single entry in the execution log.
float timeAgo
Time since entry (seconds)
EntityID entity
Entity that executed.
BTStatus status
Execution result.
std::string nodeName
Node name.
uint32_t nodeId
Node that was executed.
Visual connection pin on a behavior tree node.
PinType type
Pin type (input or output)
uint32_t nodeId
ID of the node this pin belongs to.
Vector worldPos
World position of the pin.
std::vector< uint32_t > connectedTo
IDs of connected nodes.