@@ -53,42 +53,42 @@ namespace OvEditor::Panels
53
53
*/
54
54
void UnFocus ();
55
55
56
- /* *
57
- * Unfocus the currently targeted actor without removing listeners attached to this actor
58
- */
59
- void SoftUnFocus ();
60
-
61
56
/* *
62
57
* Returns the currently selected actor
63
58
*/
64
- OvCore::ECS::Actor* GetTargetActor () const ;
65
-
66
- /* *
67
- * Create the actor inspector for the given actor
68
- */
69
- void CreateActorInspector (OvCore::ECS::Actor& p_target);
70
-
71
- /* *
72
- * Draw the given component in inspector
73
- */
74
- void DrawComponent (OvCore::ECS::Components::AComponent& p_component);
75
-
76
- /* *
77
- * Draw the given behaviour in inspector
78
- */
79
- void DrawBehaviour (OvCore::ECS::Components::Behaviour& p_behaviour);
59
+ OvTools::Utils::OptRef<OvCore::ECS::Actor> GetTargetActor () const ;
80
60
81
61
/* *
82
62
* Refresh the inspector
83
63
*/
84
64
void Refresh ();
85
65
86
66
private:
87
- OvCore::ECS::Actor* m_targetActor = nullptr ;
88
- OvUI::Widgets::Layout::Group* m_actorInfo;
89
- OvUI::Widgets::Layout::Group* m_inspectorHeader;
90
- OvUI::Widgets::Selection::ComboBox* m_componentSelectorWidget;
91
- OvUI::Widgets::InputFields::InputText* m_scriptSelectorWidget;
67
+ void _Populate ();
68
+ void _PopulateActorInfo ();
69
+ void _PopulateActorComponents ();
70
+ void _PopulateActorBehaviours ();
71
+ void _DrawAddComponentSection ();
72
+ void _DrawAddScriptSection ();
73
+ void _DrawComponent (OvCore::ECS::Components::AComponent& p_component);
74
+ void _DrawBehaviour (OvCore::ECS::Components::Behaviour& p_behaviour);
75
+ void _UpdateAddComponentButton ();
76
+ void _UpdateAddScriptButton ();
77
+
78
+ private:
79
+ OvTools::Utils::OptRef<OvCore::ECS::Actor> m_targetActor = std::nullopt;
80
+ OvUI::Widgets::Layout::Group* m_content;
81
+
82
+ OvTools::Utils::OptRef<OvUI::Widgets::Buttons::Button> m_addComponentButton;
83
+ OvTools::Utils::OptRef<OvUI::Widgets::Buttons::Button> m_addScriptButton;
84
+
85
+ // We store this here so that re-creating the inspector doesn't
86
+ // reset the selected component.
87
+ int m_selectedComponent = 0 ;
88
+
89
+ // Same as the selected component above, we want to keep the value
90
+ // of the selected script even if the inspector is re-created
91
+ std::string m_selectedScript;
92
92
93
93
uint64_t m_componentAddedListener = 0 ;
94
94
uint64_t m_componentRemovedListener = 0 ;
0 commit comments