Ember
Loading...
Searching...
No Matches
BehaviorTreeConfig.h
Go to the documentation of this file.
1#pragma once
2
3#include "Types/Color.h"
4#include "Types/String.h"
5#include <functional>
6#include <string>
7#include <vector>
8
9namespace EmberCore {
10
19 public:
23 struct SyncSettings {
24 bool enableHierarchyToScene = true; // Enable hierarchy → scene sync
25 bool enableSceneToHierarchy = true; // Enable scene → hierarchy sync
26 bool enableAutoCenter = true; // Enable automatic centering on selection
27 bool enableSelectionHighlight = true; // Enable visual selection highlighting
28 bool enableHoverEffects = true; // Enable hover visual effects
29
30 // Advanced sync options
31 bool centerWithAnimation = false; // Animate centering transitions
32 float centeringSpeed = 1.0f; // Speed of centering animation (0.1-5.0)
33 bool preventSyncLoops = true; // Prevent infinite sync loops
34 };
35
40 // Node colors
41 EmberCore::Color selectedNodeColor = EmberCore::Color(100, 149, 237); // Cornflower blue
42 EmberCore::Color hoveredNodeColor = EmberCore::Color(144, 238, 144); // Light green
44
45 // Border colors
49
50 // Visual feedback intensity
51 int selectionBorderWidth = 3; // Width of selection border (1-5)
52 int hoverBorderWidth = 2; // Width of hover border (1-5)
53 float highlightOpacity = 1.0f; // Opacity of highlights (0.0-1.0)
54
55 // Animation settings
56 bool enableAnimations = true; // Enable visual animations
57 int animationDuration = 200; // Animation duration in ms (50-1000)
58 };
59
64 bool enableDoubleClickExpand = true; // Double-click to expand/collapse nodes
65 bool enableRightClickMenu = true; // Right-click context menus
66 bool enableKeyboardNavigation = true; // Keyboard navigation support
67 bool enableDragAndDrop = false; // Drag and drop functionality
68
69 // Mouse interaction
70 bool requireCtrlForMultiSelect = true; // Require Ctrl for multi-selection
71 bool enableMiddleClickCenter = true; // Middle-click to center on node
72 int doubleClickSpeed = 500; // Double-click speed in ms (100-1000)
73 };
74
79 bool enableSyncLogging = false; // Log synchronization events
80 bool enablePerformanceMetrics = false; // Show performance metrics
81 bool enableDebugOverlay = false; // Show debug information overlay
82 bool verboseLogging = false; // Enable verbose logging
83 };
84
85 public:
88
89 // Configuration access
91 const SyncSettings &GetSyncSettings() const { return syncSettings_; }
92
95
98
101
102 // Configuration management
103 void ResetToDefaults();
104 bool LoadFromFile(const EmberCore::String &filename);
105 bool SaveToFile(const EmberCore::String &filename) const;
106
107 // Change notification system
108 using ConfigChangeCallback = std::function<void(const std::string &category, const std::string &setting)>;
109 void RegisterChangeCallback(const ConfigChangeCallback &callback);
111
112 // Convenience methods for common operations
113 void SetSyncEnabled(bool hierarchyToScene, bool sceneToHierarchy);
114 void SetCenteringEnabled(bool enabled, bool animated = false);
115 void SetHighlightingEnabled(bool enabled);
116 void SetDebugMode(bool enabled);
117
118 // Validation
119 bool ValidateSettings() const;
120 std::vector<std::string> GetValidationErrors() const;
121
122 private:
127
128 std::vector<ConfigChangeCallback> changeCallbacks_;
129
130 // Helper methods
131 void NotifyChange(const std::string &category, const std::string &setting);
132 void ClampValues(); // Ensure all values are within valid ranges
133};
134
142 public:
144
146 const BehaviorTreeConfig &GetConfig() const { return config_; }
147
148 // Quick access methods
149 bool IsSyncEnabled(bool hierarchyToScene) const;
150 bool IsCenteringEnabled() const;
151 bool IsHighlightingEnabled() const;
152
153 private:
156};
157
158} // namespace EmberCore
const BehaviorTreeConfig & GetConfig() const
static BehaviorTreeConfigManager & GetInstance()
bool IsSyncEnabled(bool hierarchyToScene) const
Configuration settings for the behavior tree editor.
void UnregisterChangeCallback(const ConfigChangeCallback &callback)
const VisualSettings & GetVisualSettings() const
InteractionSettings & GetInteractionSettings()
const SyncSettings & GetSyncSettings() const
std::function< void(const std::string &category, const std::string &setting)> ConfigChangeCallback
InteractionSettings interactionSettings_
std::vector< ConfigChangeCallback > changeCallbacks_
const InteractionSettings & GetInteractionSettings() const
bool LoadFromFile(const EmberCore::String &filename)
void NotifyChange(const std::string &category, const std::string &setting)
const DebugSettings & GetDebugSettings() const
bool SaveToFile(const EmberCore::String &filename) const
void SetSyncEnabled(bool hierarchyToScene, bool sceneToHierarchy)
std::vector< std::string > GetValidationErrors() const
void SetCenteringEnabled(bool enabled, bool animated=false)
void RegisterChangeCallback(const ConfigChangeCallback &callback)
Main types header for EmberCore.
std::string String
Framework-agnostic string type.
Definition String.h:14
Debugging and development settings.
Interaction behavior configuration settings.
Synchronization configuration settings.
Visual appearance configuration settings.
RGBA color with 8-bit components.
Definition Color.h:10