7#include "BlueprintEditor.h"
10#include "../TaskSystem/TaskGraphTypes.h"
11#include "../third_party/imgui/imgui.h"
18 : m_TypeFilterSelection(0)
21 m_AvailableTypes = {
"All",
"EntityBlueprint",
"BehaviorTree",
"Prefab",
"Trigger",
"FX",
"Sound"};
33 std::cout <<
"AssetBrowser: Initialized with root path: " <<
assetsRootPath << std::endl;
41 std::cout <<
"AssetBrowser: Refreshed asset tree from backend" << std::endl;
47 if (
node->isDirectory)
74 ImGui::SetNextItemWidth(200.0f);
81 ImGui::Text(
"Search");
86 ImGui::SetNextItemWidth(150.0f);
98 ImGui::Text(
"Type Filter");
101 ImGui::SameLine(0.0f, 20.0f);
102 if (ImGui::Button(
"Refresh"))
119 if (
node->isDirectory)
132 if (!
node->isDirectory)
135 std::string label =
node->name;
136 if (!
node->isDirectory && !
node->type.empty())
137 label +=
" [" +
node->type +
"]";
142 if (ImGui::IsItemClicked())
144 if (!
node->isDirectory)
153 if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(0))
155 if (!
node->isDirectory)
157 std::cout <<
"AssetBrowser: Double-clicked asset: " <<
node->fullPath << std::endl;
160 if (
node->type ==
"BehaviorTree" ||
node->type ==
"HFSM" ||
161 node->type ==
"VisualScript" ||
node->type ==
"TaskGraph" ||
162 node->type ==
"Generic")
164 std::cout <<
"AssetBrowser: Opening " <<
node->type <<
" in editor" << std::endl;
170 std::cout <<
"AssetBrowser: Opening asset via callback" << std::endl;
177 if (ImGui::IsItemHovered())
179 if (
node->type ==
"BehaviorTree" ||
node->type ==
"HFSM" ||
180 node->type ==
"VisualScript" ||
node->type ==
"TaskGraph" ||
181 node->type ==
"Generic")
183 ImGui::SetTooltip(
"Double-click to open in editor");
185 else if (!
node->isDirectory)
187 ImGui::SetTooltip(
"Double-click to open");
193 if (
node->isDirectory)
204 if (ImGui::Begin(
"Asset Browser"))
233 ImGui::TextColored(
ImVec4(1.0f, 0.3f, 0.3f, 1.0f),
238 ImGui::TextColored(
ImVec4(0.7f, 0.7f, 0.7f, 1.0f),
239 "No blueprint files found.");
318 ImGui::TextColored(
ImVec4(0.5f, 1.0f, 0.5f, 1.0f),
319 "Drag nodes to the graph to add them");
324 ImGui::Selectable(label);
328 ImGui::SetDragDropPayload(
"VS_NODE_TYPE_ENUM", &
enumValue,
sizeof(
uint8_t));
329 ImGui::Text(
"%s", label);
330 ImGui::EndDragDropSource();
333 if (ImGui::IsItemHovered())
335 ImGui::SetTooltip(
"%s", tooltip);
378 ImGui::TextColored(
ImVec4(0.7f, 0.7f, 0.7f, 1.0f),
379 "Tip: Drag & drop nodes onto the graph canvas");
ComponentTypeID GetComponentTypeID_Static()
bool HasSelection() const
void RenderTreeNode(const std::shared_ptr< AssetNode > &node)
std::vector< std::string > m_AvailableTypes
std::function< void(const std::string &)> m_OnAssetOpen
std::string m_SelectedAssetPath
void Initialize(const std::string &assetsRootPath)
void SetAssetOpenCallback(std::function< void(const std::string &)> callback)
int m_TypeFilterSelection
bool PassesFilter(const std::shared_ptr< AssetNode > &node) const
std::string GetSelectedAssetPath() const
std::shared_ptr< AssetNode > GetAssetTree() const
void SetAssetRootPath(const std::string &path)
void SelectAsset(const std::string &assetPath)
void OpenGraphInEditor(const std::string &assetPath)
static BlueprintEditor & Get()
< Provides AssetID and INVALID_ASSET_ID
TaskNodeType
Identifies the role of a node in the task graph.
@ AtomicTask
Leaf node that executes a single atomic task.
@ While
Conditional loop (Loop / Completed exec outputs)
@ SubGraph
Sub-graph call (SubTask)
@ DoOnce
Single-fire execution (reset via Reset pin)
@ Delay
Timer (Completed exec output after N seconds)
@ GetBBValue
Data node – reads a Blackboard key.
@ MathOp
Data node – arithmetic operation (+, -, *, /)
@ SetBBValue
Data node – writes a Blackboard key.
@ ForEach
Iterate over BB list (Loop Body / Completed exec outputs)
@ Switch
Multi-branch on value (N exec outputs)
@ EntryPoint
Unique entry node for VS graphs (replaces Root)
@ Branch
If/Else conditional (Then / Else exec outputs)
@ VSSequence
Execute N outputs in order ("VS" prefix avoids collision with BT Sequence=1)