Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
VariablePropertyPanel.h
Go to the documentation of this file.
1/**
2 * @file VariablePropertyPanel.h
3 * @brief UI Properties panel for a Variable node – variable selector.
4 * @author Olympe Engine
5 * @date 2026-03-20
6 *
7 * @details
8 * VariablePropertyPanel renders the Properties panel for a selected Variable (GetBBValue) node.
9 * It provides a variable dropdown selector identical to GetBBValuePropertyPanel.
10 *
11 * Phase 24.1: Data Pure Nodes
12 *
13 * C++14 compliant — no std::optional, structured bindings, std::filesystem.
14 */
15
16#pragma once
17
18#include <string>
19#include <vector>
20#include <functional>
21
22#include "../../TaskSystem/TaskGraphTemplate.h"
23
24namespace Olympe {
25
26/**
27 * @class VariablePropertyPanel
28 * @brief ImGui sub-panel for editing Variable node's blackboard variable selection.
29 *
30 * Identical to GetBBValuePropertyPanel - provides variable dropdown selector.
31 */
33public:
34
35 /**
36 * @brief Constructs the panel.
37 */
38 explicit VariablePropertyPanel();
39
41
42 // Non-copyable
45
46 // -----------------------------------------------------------------------
47 // State accessors
48 // -----------------------------------------------------------------------
49
50 /**
51 * @brief Sets the node name displayed in the title section.
52 */
53 void SetNodeName(const std::string& name);
54
55 /**
56 * @brief Sets the template reference for blackboard variable lookup.
57 */
59
60 /**
61 * @brief Sets the currently selected BB key.
62 */
63 void SetBBKey(const std::string& key);
64
65 /**
66 * @brief Returns the current (possibly modified) BB key.
67 */
68 const std::string& GetBBKey() const;
69
70 /**
71 * @brief Returns true if the BB key has been modified since the
72 * last call to ClearDirty().
73 */
74 bool IsDirty() const { return m_dirty; }
75
76 /**
77 * @brief Resets the dirty flag.
78 */
79 void ClearDirty() { m_dirty = false; }
80
81 // -----------------------------------------------------------------------
82 // Rendering
83 // -----------------------------------------------------------------------
84
85 /**
86 * @brief Renders the panel into the current ImGui context.
87 */
88 void Render();
89
90private:
91
92 // -----------------------------------------------------------------------
93 // Private state
94 // -----------------------------------------------------------------------
95
96 std::string m_nodeName;
97 std::string m_selectedBBKey;
99 bool m_dirty;
100 std::vector<std::string> m_availableVariables;
101
102 /// @brief Rebuilds the list of available blackboard variables.
103 void RebuildVariableList();
104};
105
106} // namespace Olympe
107
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
Immutable, shareable task graph asset.
ImGui sub-panel for editing Variable node's blackboard variable selection.
std::vector< std::string > m_availableVariables
const std::string & GetBBKey() const
Returns the current (possibly modified) BB key.
bool IsDirty() const
Returns true if the BB key has been modified since the last call to ClearDirty().
void Render()
Renders the panel into the current ImGui context.
VariablePropertyPanel(const VariablePropertyPanel &)=delete
void ClearDirty()
Resets the dirty flag.
void RebuildVariableList()
Rebuilds the list of available blackboard variables.
const TaskGraphTemplate * m_template
void SetBBKey(const std::string &key)
Sets the currently selected BB key.
void SetTemplate(const TaskGraphTemplate *tmpl)
Sets the template reference for blackboard variable lookup.
VariablePropertyPanel & operator=(const VariablePropertyPanel &)=delete
VariablePropertyPanel()
Constructs the panel.
void SetNodeName(const std::string &name)
Sets the node name displayed in the title section.
< Provides AssetID and INVALID_ASSET_ID