Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
GetBBValuePropertyPanel.h
Go to the documentation of this file.
1/**
2 * @file GetBBValuePropertyPanel.h
3 * @brief UI Properties panel for a GetBBValue node – variable selector with preview.
4 * @author Olympe Engine
5 * @date 2026-03-18
6 *
7 * @details
8 * GetBBValuePropertyPanel renders the Properties panel for a selected GetBBValue node.
9 * It provides:
10 * - Variable dropdown (filtered by type)
11 * - Variable type display
12 * - Default value preview
13 * - Real-time canvas updates
14 *
15 * C++14 compliant — no std::optional, structured bindings, std::filesystem.
16 */
17
18#pragma once
19
20#include <string>
21#include <vector>
22#include <functional>
23
24#include "../../TaskSystem/TaskGraphTemplate.h"
25
26namespace Olympe {
27
28/**
29 * @class GetBBValuePropertyPanel
30 * @brief ImGui sub-panel for editing GetBBValue node's blackboard variable selection.
31 *
32 * @details
33 * The panel does NOT own the template — it holds a reference.
34 * The caller is responsible for persisting changes back to the node definition.
35 */
37public:
38
39 /**
40 * @brief Constructs the panel.
41 */
42 explicit GetBBValuePropertyPanel();
43
45
46 // Non-copyable
49
50 // -----------------------------------------------------------------------
51 // State accessors
52 // -----------------------------------------------------------------------
53
54 /**
55 * @brief Sets the node name displayed in the title section.
56 */
57 void SetNodeName(const std::string& name);
58
59 /**
60 * @brief Sets the template reference for blackboard variable lookup.
61 */
63
64 /**
65 * @brief Sets the currently selected BB key.
66 */
67 void SetBBKey(const std::string& key);
68
69 /**
70 * @brief Returns the current (possibly modified) BB key.
71 */
72 const std::string& GetBBKey() const;
73
74 /**
75 * @brief Returns true if the BB key has been modified since the
76 * last call to ClearDirty().
77 */
78 bool IsDirty() const { return m_dirty; }
79
80 /**
81 * @brief Resets the dirty flag.
82 */
83 void ClearDirty() { m_dirty = false; }
84
85 // -----------------------------------------------------------------------
86 // Rendering
87 // -----------------------------------------------------------------------
88
89 /**
90 * @brief Renders the panel into the current ImGui context.
91 */
92 void Render();
93
94private:
95
96 // -----------------------------------------------------------------------
97 // Private rendering methods
98 // -----------------------------------------------------------------------
99
100 /// Renders the title section (node name in blue background).
101 void RenderTitleSection();
102
103 /// Renders the variable dropdown and info.
105
106 /// Renders variable type and default value information.
107 void RenderVariableInfo();
108
109 // -----------------------------------------------------------------------
110 // Data members
111 // -----------------------------------------------------------------------
112
113 std::string m_nodeName; ///< Node name for display
114 std::string m_bbKey; ///< Current BB key selection
115 const TaskGraphTemplate* m_template; ///< Template reference (not owned)
116 bool m_dirty = false; ///< Changed since last ClearDirty()
117};
118
119} // namespace Olympe
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
ImGui sub-panel for editing GetBBValue node's blackboard variable selection.
void RenderTitleSection()
Renders the title section (node name in blue background).
void SetBBKey(const std::string &key)
Sets the currently selected BB key.
bool IsDirty() const
Returns true if the BB key has been modified since the last call to ClearDirty().
std::string m_bbKey
Current BB key selection.
void SetNodeName(const std::string &name)
Sets the node name displayed in the title section.
void RenderVariableSelector()
Renders the variable dropdown and info.
GetBBValuePropertyPanel(const GetBBValuePropertyPanel &)=delete
GetBBValuePropertyPanel & operator=(const GetBBValuePropertyPanel &)=delete
const TaskGraphTemplate * m_template
Template reference (not owned)
void ClearDirty()
Resets the dirty flag.
void RenderVariableInfo()
Renders variable type and default value information.
bool m_dirty
Changed since last ClearDirty()
void Render()
Renders the panel into the current ImGui context.
const std::string & GetBBKey() const
Returns the current (possibly modified) BB key.
std::string m_nodeName
Node name for display.
void SetTemplate(const TaskGraphTemplate *tmpl)
Sets the template reference for blackboard variable lookup.
Immutable, shareable task graph asset.
< Provides AssetID and INVALID_ASSET_ID