Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
InspectorPanel.h
Go to the documentation of this file.
1/*
2 * Olympe Blueprint Editor - Inspector Panel
3 *
4 * Dynamic inspector that adapts to context:
5 * - Shows node properties when a graph node is selected
6 * - Shows entity components when a runtime entity is selected
7 * - Shows live LocalBlackboard values when a debug blackboard is registered
8 */
9
10#pragma once
11
12#include <string>
13#include <memory>
14#include <unordered_map>
15
16namespace Olympe
17{
18 // Forward declarations
19 class LocalBlackboard;
20 class ActionParametersPanel;
21
23 {
24 None,
27 AssetFile // New context for asset file metadata
28 };
29
30 /**
31 * InspectorPanel - Adaptive inspector panel
32 * Displays properties based on current selection context.
33 *
34 * Runtime debug overlay:
35 * Call SetDebugBlackboard() with a pointer to the live LocalBlackboard of
36 * the currently executing task graph to make InspectorPanel show its values
37 * as an overlay section. Pass nullptr to hide the section.
38 * The pointer is not owned and must remain valid for the frame duration.
39 */
41 {
42 public:
45
46 void Initialize();
47 void Shutdown();
48 void Render();
49 void RenderContent(); // Render without window wrapper - for fixed layout
50
51 /**
52 * @brief Register a live LocalBlackboard to display in the inspector.
53 * @param bb Pointer to the blackboard (non-owning). nullptr removes it.
54 */
55 static void SetDebugBlackboard(const LocalBlackboard* bb);
56
57 /**
58 * @brief Get the active InspectorPanel instance (singleton access).
59 * Returns nullptr if not initialized.
60 */
62
63 /**
64 * @brief Set the active InspectorPanel instance.
65 * Called internally by Initialize().
66 */
68
69 /**
70 * @brief Set the currently selected action node for parameter editing.
71 * @param taskID The task ID (e.g., "log_message", "patrol_path")
72 * @param nodeName The display name of the node
73 * @param parameters Map of parameter name -> value
74 */
75 void SetSelectedActionNode(const std::string& taskID,
76 const std::string& nodeName,
77 const std::unordered_map<std::string, std::string>& parameters);
78
79 /**
80 * @brief Clear the current action node selection.
81 */
83
84 /**
85 * @brief Get the action parameters panel (for direct access if needed).
86 */
88
89 private:
95 void RenderComponentProperties(uint64_t entityId, const std::string& componentType);
96
98
100 std::unique_ptr<ActionParametersPanel> m_actionPanel;
102
103 // Singleton instance pointer
105 };
106}
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
ImGui sub-panel for editing action node parameters.
InspectorPanel - Adaptive inspector panel Displays properties based on current selection context.
static void SetInstance(InspectorPanel *instance)
Set the active InspectorPanel instance.
void RenderComponentProperties(uint64_t entityId, const std::string &componentType)
void ClearSelectedActionNode()
Clear the current action node selection.
static const LocalBlackboard * s_DebugBlackboard
static InspectorPanel * GetInstance()
Get the active InspectorPanel instance (singleton access).
void SetSelectedActionNode(const std::string &taskID, const std::string &nodeName, const std::unordered_map< std::string, std::string > &parameters)
Set the currently selected action node for parameter editing.
ActionParametersPanel * GetActionPanel()
Get the action parameters panel (for direct access if needed).
static void SetDebugBlackboard(const LocalBlackboard *bb)
Register a live LocalBlackboard to display in the inspector.
static InspectorPanel * s_Instance
std::unique_ptr< ActionParametersPanel > m_actionPanel
InspectorContext DetermineContext()
Simple map-based blackboard for task graph runtime state.
< Provides AssetID and INVALID_ASSET_ID