109 ImGui::PopStyleColor(4);
112 ImGui::PushItemWidth(-1.0f);
115 ImGui::PopItemWidth();
121 ImGui::PopStyleVar();
125 ImGui::TextDisabled(
"Tip: Drag & drop components onto the graph to add them");
148 ImGui::PopStyleColor(3);
170 ImGui::PopStyleColor(3);
208 std::string label =
component.name +
"##" + std::to_string(
i) +
"_" + std::to_string(
j);
218 if (ImGui::IsItemHovered())
229 ImGui::GetColorU32(
ImVec4(0.9f, 0.9f, 0.9f, 1.0f)),
238 ImGui::SetDragDropPayload(
"COMPONENT_TYPE",
242 ImGui::Text(
"%s",
component.name.c_str());
244 ImGui::EndDragDropSource();
248 if (ImGui::IsItemHovered() && !
component.description.empty())
250 ImGui::SetTooltip(
"%s",
component.description.c_str());
254 ImGui::PopStyleVar();
305 SYSTEM_LOG <<
"[ComponentPalettePanel] Loading components from: " << filepath <<
"\n";
310 if (
_access(filepath.c_str(), 0) == -1)
312 SYSTEM_LOG <<
"[ComponentPalettePanel] WARNING: File does not exist: " << filepath <<
"\n";
316 std::ifstream
file(filepath);
319 SYSTEM_LOG <<
"[ComponentPalettePanel] WARNING: Could not open file: " << filepath <<
" (permissions or other I/O issue)\n";
334 SYSTEM_LOG <<
"[ComponentPalettePanel] Detected new JSON format (schemas array)\n";
344 SYSTEM_LOG <<
"[ComponentPalettePanel] WARNING: Skipping schema missing componentType\n";
348 std::string componentType =
schemaJson[
"componentType"].get<std::string>();
350 std::string description =
schemaJson.contains(
"description")
351 ?
schemaJson[
"description"].get<std::string>()
355 SYSTEM_LOG <<
"[ComponentPalettePanel] Loaded: " << componentType <<
" (" << category <<
")\n";
359 else if (
jsonData.contains(
"components") &&
jsonData[
"components"].is_array())
361 SYSTEM_LOG <<
"[ComponentPalettePanel] Detected old JSON format (components array)\n";
371 SYSTEM_LOG <<
"[ComponentPalettePanel] WARNING: Skipping component missing name or category\n";
375 std::string name =
compJson[
"name"].get<std::string>();
376 std::string category =
compJson[
"category"].get<std::string>();
377 std::string description =
compJson.contains(
"description")
378 ?
compJson[
"description"].get<std::string>()
382 SYSTEM_LOG <<
"[ComponentPalettePanel] Loaded: " << name <<
" (" << category <<
")\n";
387 SYSTEM_LOG <<
"[ComponentPalettePanel] ERROR: JSON missing 'schemas' or 'components' array\n";
406 <<
" components from JSON (" <<
m_categories.size() <<
" categories)\n";
409 catch (
const std::exception&
e)
411 SYSTEM_LOG <<
"[ComponentPalettePanel] ERROR parsing JSON: " <<
e.what() <<
"\n";