Skip to content

Commit

Permalink
Updated C++ example to use updated APIs.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Galvan <[email protected]>
  • Loading branch information
cgalvan committed Oct 26, 2021
1 parent d05ddef commit b828fa3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpp_gems/ShapeExample/Code/Source/ShapeExampleWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace ShapeExample

// Find the icon registered for this component by its type id
AZStd::string editorIconPath;
AzToolsFramework::EditorRequestBus::BroadcastResult(editorIconPath, &AzToolsFramework::EditorRequestBus::Events::GetComponentEditorIcon, typeId, nullptr);
AzToolsFramework::EditorRequestBus::BroadcastResult(editorIconPath, &AzToolsFramework::EditorRequests::GetComponentTypeEditorIcon, typeId);
QString iconPath = QString::fromUtf8(editorIconPath.c_str());

// Create a button with the shape components name and icon
Expand Down Expand Up @@ -125,9 +125,9 @@ namespace ShapeExample
if (m_addShapeNameSuffix->isChecked())
{
AZStd::vector<AZStd::string> componentNames;
AzToolsFramework::EditorComponentAPIBus::BroadcastResult(
EditorComponentAPIBus::BroadcastResult(
componentNames,
&AzToolsFramework::EditorComponentAPIRequests::FindComponentTypeNames,
&EditorComponentAPIRequests::FindComponentTypeNames,
AZ::ComponentTypeList{ typeId }
);

Expand All @@ -144,7 +144,7 @@ namespace ShapeExample
}

// Add the corresponding shape component for the button we pressed to the newly created entity
EntityCompositionRequestBus::Broadcast(&EntityCompositionRequests::AddComponentsToEntities, EntityIdList{ newEntityId }, AZ::ComponentTypeList{ typeId });
EditorComponentAPIBus::Broadcast(&EditorComponentAPIRequests::AddComponentsOfType, newEntityId, AZ::ComponentTypeList{ typeId });
}

void ShapeExampleWidget::OnNameInputTextChanged(const QString& text)
Expand Down

0 comments on commit b828fa3

Please sign in to comment.