Add variable, datum sanity for user added slots
Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
+2
-2
@@ -92,7 +92,7 @@ namespace GraphCanvas
|
||||
}
|
||||
else if (sourceSlotType == DataSlotType::Reference)
|
||||
{
|
||||
DataSlotRequestBus::EventResult(converted, GetTargetSlotId(), &DataSlotRequests::ConvertToReference);
|
||||
DataSlotRequestBus::EventResult(converted, GetTargetSlotId(), &DataSlotRequests::ConvertToReference, false);
|
||||
}
|
||||
}
|
||||
else if (m_dragContext == DragContext::MoveSource)
|
||||
@@ -103,7 +103,7 @@ namespace GraphCanvas
|
||||
}
|
||||
else if (targetSlotType == DataSlotType::Reference)
|
||||
{
|
||||
DataSlotRequestBus::EventResult(converted, GetSourceSlotId(), &DataSlotRequests::ConvertToReference);
|
||||
DataSlotRequestBus::EventResult(converted, GetSourceSlotId(), &DataSlotRequests::ConvertToReference, false);
|
||||
}
|
||||
}
|
||||
else if (m_dragContext == DragContext::TryConnection)
|
||||
|
||||
@@ -294,9 +294,9 @@ namespace GraphCanvas
|
||||
}
|
||||
}
|
||||
|
||||
bool DataSlotComponent::ConvertToReference()
|
||||
bool DataSlotComponent::ConvertToReference(bool isNewSlot)
|
||||
{
|
||||
if (CanConvertToReference())
|
||||
if (CanConvertToReference(isNewSlot))
|
||||
{
|
||||
AZ::EntityId nodeId = GetNode();
|
||||
GraphId graphId;
|
||||
@@ -307,7 +307,7 @@ namespace GraphCanvas
|
||||
ScopedGraphUndoBlocker undoBlocker(graphId);
|
||||
|
||||
bool convertedToReference = false;
|
||||
GraphModelRequestBus::EventResult(convertedToReference, graphId, &GraphModelRequests::ConvertSlotToReference, Endpoint(nodeId, GetEntityId()));
|
||||
GraphModelRequestBus::EventResult(convertedToReference, graphId, &GraphModelRequests::ConvertSlotToReference, Endpoint(nodeId, GetEntityId()), isNewSlot);
|
||||
|
||||
if (convertedToReference)
|
||||
{
|
||||
@@ -326,8 +326,9 @@ namespace GraphCanvas
|
||||
return m_dataSlotType == DataSlotType::Reference;
|
||||
}
|
||||
|
||||
bool DataSlotComponent::CanConvertToReference() const
|
||||
bool DataSlotComponent::CanConvertToReference([[maybe_unused]] bool isNewSlot) const
|
||||
{
|
||||
// #sc_user_slot_variable_ux make sure this can be converted to reference, or created as one
|
||||
bool canToggleReference = false;
|
||||
|
||||
if (m_canConvertSlotTypes && DataSlotUtils::IsValueDataSlotType(m_dataSlotType) && !HasConnections())
|
||||
@@ -336,7 +337,7 @@ namespace GraphCanvas
|
||||
GraphId graphId;
|
||||
|
||||
SceneMemberRequestBus::EventResult(graphId, nodeId, &SceneMemberRequests::GetScene);
|
||||
GraphModelRequestBus::EventResult(canToggleReference, graphId, &GraphModelRequests::CanConvertSlotToReference, Endpoint(nodeId, GetEntityId()));
|
||||
GraphModelRequestBus::EventResult(canToggleReference, graphId, &GraphModelRequests::CanConvertSlotToReference, Endpoint(nodeId, GetEntityId()), isNewSlot);
|
||||
}
|
||||
|
||||
return canToggleReference;
|
||||
|
||||
@@ -47,8 +47,8 @@ namespace GraphCanvas
|
||||
////
|
||||
|
||||
// DataSlotRequestBus
|
||||
bool ConvertToReference() override;
|
||||
bool CanConvertToReference() const override;
|
||||
bool ConvertToReference(bool isNewSlot = false) override;
|
||||
bool CanConvertToReference(bool isNewSlot = false) const override;
|
||||
|
||||
bool ConvertToValue() override;
|
||||
bool CanConvertToValue() const override;
|
||||
|
||||
Reference in New Issue
Block a user