Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
PropertyInspectorPrefab.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <memory>
5#include "./../../vector.h"
7
8namespace Olympe
9{
11 {
12 public:
15
17 void Render();
18 void Update(float deltaTime);
19
20 // Node selection
21 void SelectNode(NodeId nodeId);
22 void DeselectNode();
23 NodeId GetSelectedNode() const;
24
25 // Panel visibility and layout
26 void SetPanelWidth(float width);
27 float GetPanelWidth() const;
28
29 void SetPanelHeight(float height);
30 float GetPanelHeight() const;
31
32 void SetPanelPosition(float x, float y);
33 void GetPanelPosition(float& outX, float& outY) const;
34
35 // Content rendering options
36 void SetShowComponentInfo(bool show);
37 bool GetShowComponentInfo() const;
38
39 void SetShowPropertyGrid(bool show);
40 bool GetShowPropertyGrid() const;
41
43 bool GetShowAddPropertyButton() const;
44
45 void SetReadOnly(bool readOnly);
46 bool IsReadOnly() const;
47
48 // Property editing
49 void AddProperty(const std::string& key, const std::string& value);
50 void RemoveProperty(const std::string& key);
51 void SetProperty(const std::string& key, const std::string& value);
52 std::string GetProperty(const std::string& key) const;
53
54 // Component management
55 void AddComponent(const std::string& componentType);
56 void RemoveComponent(const std::string& componentType);
57 void EnableComponent(const std::string& componentType, bool enabled);
58
59 // Validation
60 bool ValidatePropertyValue(const std::string& propertyName, const std::string& value) const;
61 bool ValidateAllProperties() const;
62
63 private:
66 float m_panelWidth = 400.0f;
67 float m_panelHeight = 600.0f;
68 float m_panelX = 0.0f;
69 float m_panelY = 0.0f;
71 bool m_showPropertyGrid = true;
73 bool m_readOnly = false;
74
76 void RenderPropertyGrid();
79
80 void OnPropertyChanged(const std::string& key, const std::string& value);
81 void OnComponentAdded(const std::string& componentType);
82 void OnComponentRemoved(const std::string& componentType);
83 };
84}
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
void SetProperty(const std::string &key, const std::string &value)
void RemoveComponent(const std::string &componentType)
void OnComponentAdded(const std::string &componentType)
void EnableComponent(const std::string &componentType, bool enabled)
void AddProperty(const std::string &key, const std::string &value)
void RemoveProperty(const std::string &key)
std::string GetProperty(const std::string &key) const
void OnPropertyChanged(const std::string &key, const std::string &value)
void OnComponentRemoved(const std::string &componentType)
void AddComponent(const std::string &componentType)
void Initialize(EntityPrefabGraphDocument *document)
bool ValidatePropertyValue(const std::string &propertyName, const std::string &value) const
EntityPrefabGraphDocument * m_document
void GetPanelPosition(float &outX, float &outY) const
< Provides AssetID and INVALID_ASSET_ID
uint32_t NodeId
const NodeId InvalidNodeId