6#include "BlueprintEditor.h"
10#include "../third_party/imgui/imgui.h"
27 std::cout <<
"[InspectorPanel] Initialized\n";
32 std::cout <<
"[InspectorPanel] Shutdown\n";
37 ImGui::Begin(
"Inspector");
57 ImGui::Text(
"No selection");
58 ImGui::TextWrapped(
"Select an entity or asset file to inspect its properties.");
87 ImGui::Text(
"Node Properties");
93 ImGui::Text(
"Node inspector coming soon...");
103 ImGui::Text(
"No entity selected");
104 ImGui::TextWrapped(
"Select an entity from the Asset Browser or Entities panel to inspect its properties.");
110 ImGui::Text(
"Entity: %s",
info.name.c_str());
115 ImGui::Text(
"Components:");
119 if (components.empty())
121 ImGui::Text(
" (no components)");
125 for (
const auto& componentType : components)
127 if (ImGui::CollapsingHeader(componentType.c_str()))
139 if (properties.empty())
141 ImGui::Text(
" (no editable properties)");
145 for (
auto&
prop : properties)
147 ImGui::PushID(
prop.name.c_str());
149 if (
prop.type ==
"float")
151 float value = std::stof(
prop.value);
152 if (ImGui::DragFloat(
prop.name.c_str(), &value, 1.0f))
156 entityId, componentType,
prop.name, std::to_string(value)
160 else if (
prop.type ==
"int")
162 int value = std::stoi(
prop.value);
163 if (ImGui::DragInt(
prop.name.c_str(), &value))
166 entityId, componentType,
prop.name, std::to_string(value)
170 else if (
prop.type ==
"bool")
172 bool value = (
prop.value ==
"true" ||
prop.value ==
"1");
173 if (ImGui::Checkbox(
prop.name.c_str(), &value))
176 entityId, componentType,
prop.name, value ?
"true" :
"false"
180 else if (
prop.type ==
"string")
196 ImGui::Text(
"%s: %s",
prop.name.c_str(),
prop.value.c_str());
210 ImGui::Text(
"No asset selected");
223 ImGui::TextColored(
ImVec4(0.5f, 0.8f, 1.0f, 1.0f),
"Asset: %s",
filename.c_str());
228 ImGui::TextColored(
ImVec4(1.0f, 0.3f, 0.3f, 1.0f),
"Invalid or malformed asset");
231 ImGui::TextWrapped(
"Error: %s", metadata.
errorMessage.c_str());
237 ImGui::Text(
"Type: %s", metadata.
type.c_str());
240 if (!metadata.
name.empty())
242 ImGui::Text(
"Name: %s", metadata.
name.c_str());
248 ImGui::TextWrapped(
"Description: %s", metadata.
description.c_str());
254 if (metadata.
type ==
"BehaviorTree" || metadata.
type ==
"HFSM")
256 ImGui::Text(
"Nodes: %d", metadata.
nodeCount);
258 if (!metadata.
nodes.empty() && ImGui::CollapsingHeader(
"Node List"))
263 ImGui::BulletText(
"%s",
node.c_str());
269 if (ImGui::Button(
"Open in Node Graph Editor"))
274 else if (metadata.
type ==
"EntityBlueprint")
278 if (!metadata.
components.empty() && ImGui::CollapsingHeader(
"Component List"))
283 ImGui::BulletText(
"%s",
comp.c_str());
ComponentTypeID GetComponentTypeID_Static()
std::string GetSelectedAssetPath() const
AssetMetadata GetAssetMetadata(const std::string &filepath)
uint64_t GetSelectedEntity() const
void OpenGraphInEditor(const std::string &assetPath)
static BlueprintEditor & Get()
std::vector< std::string > GetEntityComponents(EntityID entity) const
static EntityInspectorManager & Get()
EntityInfo GetEntityInfo(EntityID entity) const
std::vector< ComponentPropertyInfo > GetComponentProperties(EntityID entity, const std::string &componentType)
bool SetComponentProperty(EntityID entity, const std::string &componentType, const std::string &propertyName, const std::string &value)
void RenderEntityInspector()
void RenderComponentProperties(uint64_t entityId, const std::string &componentType)
InspectorContext DetermineContext()
void RenderNodeInspector()
void RenderAssetFileInspector()