Extract editor interaction states
This commit is contained in:
@@ -28,6 +28,7 @@ void InspectorPanel::OnSelectionChanged(const SelectionChangedEvent& event) {
|
||||
m_context->GetUndoManager().FinalizeInteractiveChange();
|
||||
}
|
||||
m_selectedEntityId = event.primarySelection;
|
||||
m_addComponentPopup.Clear();
|
||||
}
|
||||
|
||||
void InspectorPanel::Render() {
|
||||
@@ -78,7 +79,7 @@ void InspectorPanel::RenderGameObject(::XCEngine::Components::GameObject* gameOb
|
||||
}
|
||||
|
||||
if (Actions::DrawInspectorAction(Actions::MakeAddComponentButtonAction(gameObject != nullptr))) {
|
||||
ImGui::OpenPopup("AddComponent");
|
||||
m_addComponentPopup.RequestOpen();
|
||||
}
|
||||
RenderAddComponentPopup(gameObject);
|
||||
|
||||
@@ -97,6 +98,8 @@ void InspectorPanel::RenderEmptyState(const char* title, const char* subtitle) {
|
||||
}
|
||||
|
||||
void InspectorPanel::RenderAddComponentPopup(::XCEngine::Components::GameObject* gameObject) {
|
||||
m_addComponentPopup.ConsumeOpenRequest("AddComponent");
|
||||
|
||||
if (!UI::BeginTitledPopup("AddComponent", "Components")) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user