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
@@ -97,7 +97,7 @@ namespace GraphCanvas
|
||||
// Only want to try to convert to references when we have no connections
|
||||
if (!hasConnections)
|
||||
{
|
||||
DataSlotRequestBus::EventResult(acceptConnection, sourceEndpoint.GetSlotId(), &DataSlotRequests::CanConvertToReference);
|
||||
DataSlotRequestBus::EventResult(acceptConnection, sourceEndpoint.GetSlotId(), &DataSlotRequests::CanConvertToReference, false);
|
||||
}
|
||||
}
|
||||
else if (targetType == DataSlotType::Value)
|
||||
@@ -115,7 +115,7 @@ namespace GraphCanvas
|
||||
// Only want to try to convert to references when we have no connections
|
||||
if (!hasConnections)
|
||||
{
|
||||
DataSlotRequestBus::EventResult(acceptConnection, targetEndpoint.GetSlotId(), &DataSlotRequests::CanConvertToReference);
|
||||
DataSlotRequestBus::EventResult(acceptConnection, targetEndpoint.GetSlotId(), &DataSlotRequests::CanConvertToReference, false);
|
||||
}
|
||||
}
|
||||
else if (sourceType == DataSlotType::Value)
|
||||
|
||||
+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;
|
||||
|
||||
@@ -70,8 +70,8 @@ namespace GraphCanvas
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
|
||||
using BusIdType = AZ::EntityId;
|
||||
|
||||
virtual bool ConvertToReference() = 0;
|
||||
virtual bool CanConvertToReference() const = 0;
|
||||
virtual bool ConvertToReference(bool isNewSlot = false) = 0;
|
||||
virtual bool CanConvertToReference(bool isNewSlot = false) const = 0;
|
||||
|
||||
virtual bool ConvertToValue() = 0;
|
||||
virtual bool CanConvertToValue() const = 0;
|
||||
|
||||
@@ -125,12 +125,12 @@ namespace GraphCanvas
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool ConvertSlotToReference([[maybe_unused]] const Endpoint& endpoint)
|
||||
virtual bool ConvertSlotToReference([[maybe_unused]] const Endpoint& endpoint, [[maybe_unused]] bool isNewSlot)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool CanConvertSlotToReference([[maybe_unused]] const Endpoint& endpoint)
|
||||
virtual bool CanConvertSlotToReference([[maybe_unused]] const Endpoint& endpoint, [[maybe_unused]] bool isNewSlot)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -145,12 +145,13 @@ namespace GraphCanvas
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool CanPromoteToVariable([[maybe_unused]] const Endpoint& endpoint) const
|
||||
virtual bool CanPromoteToVariable([[maybe_unused]] const Endpoint& endpoint, [[maybe_unused]] bool isNewSlot = false) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool PromoteToVariableAction([[maybe_unused]] const Endpoint& endpoint)
|
||||
virtual bool PromoteToVariableAction([[maybe_unused]] const Endpoint& endpoint
|
||||
, [[maybe_unused]] bool isNewSlot)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
+5
-5
@@ -258,7 +258,7 @@ namespace GraphCanvas
|
||||
if (DataSlotUtils::IsValueDataSlotType(dataSlotType))
|
||||
{
|
||||
setText("Convert to Reference");
|
||||
DataSlotRequestBus::EventResult(canToggleState, targetId, &DataSlotRequests::CanConvertToReference);
|
||||
DataSlotRequestBus::EventResult(canToggleState, targetId, &DataSlotRequests::CanConvertToReference, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -291,7 +291,7 @@ namespace GraphCanvas
|
||||
|
||||
if (DataSlotUtils::IsValueDataSlotType(dataSlotType))
|
||||
{
|
||||
DataSlotRequestBus::EventResult(toggledState, targetId, &DataSlotRequests::ConvertToReference);
|
||||
DataSlotRequestBus::EventResult(toggledState, targetId, &DataSlotRequests::ConvertToReference, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -345,14 +345,14 @@ namespace GraphCanvas
|
||||
|
||||
if (DataSlotUtils::IsValueDataSlotType(dataSlotType))
|
||||
{
|
||||
DataSlotRequestBus::EventResult(enableAction, targetId, &DataSlotRequests::CanConvertToReference);
|
||||
DataSlotRequestBus::EventResult(enableAction, targetId, &DataSlotRequests::CanConvertToReference, false);
|
||||
|
||||
if (enableAction)
|
||||
{
|
||||
Endpoint endpoint;
|
||||
SlotRequestBus::EventResult(endpoint, targetId, &SlotRequests::GetEndpoint);
|
||||
|
||||
GraphModelRequestBus::EventResult(enableAction, graphId, &GraphModelRequests::CanPromoteToVariable, endpoint);
|
||||
GraphModelRequestBus::EventResult(enableAction, graphId, &GraphModelRequests::CanPromoteToVariable, endpoint, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -371,7 +371,7 @@ namespace GraphCanvas
|
||||
SlotRequestBus::EventResult(endpoint, targetId, &SlotRequests::GetEndpoint);
|
||||
|
||||
bool promotedElement = false;
|
||||
GraphModelRequestBus::EventResult(promotedElement, graphId, &GraphModelRequests::PromoteToVariableAction, endpoint);
|
||||
GraphModelRequestBus::EventResult(promotedElement, graphId, &GraphModelRequests::PromoteToVariableAction, endpoint, false);
|
||||
|
||||
if (promotedElement)
|
||||
{
|
||||
|
||||
@@ -94,12 +94,12 @@ namespace MockGraphCanvasServices
|
||||
GraphCanvas::DataSlotRequestBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
bool MockDataSlotComponent::ConvertToReference()
|
||||
bool MockDataSlotComponent::ConvertToReference([[maybe_unused]] bool isNewSlot = false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MockDataSlotComponent::CanConvertToReference() const
|
||||
bool MockDataSlotComponent::CanConvertToReference([[maybe_unused]] bool isNewSlot = false) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -72,8 +72,8 @@ namespace MockGraphCanvasServices
|
||||
void Deactivate() override;
|
||||
|
||||
// GraphCanvas::DataSlotRequestBus overrides ...
|
||||
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;
|
||||
bool IsUserSlot() const override;
|
||||
|
||||
@@ -667,7 +667,8 @@ namespace ScriptCanvasEditor
|
||||
}
|
||||
|
||||
// Now that the slot has a valid type/name, we can actually promote it to a variable
|
||||
if (PromoteToVariableAction(endpoint) /*&& slot->IsVariableReference()*/)
|
||||
// #sc_user_slot_variable_ux add a value indicating that the slot is new
|
||||
if (PromoteToVariableAction(endpoint, true))
|
||||
{
|
||||
ScriptCanvas::GraphVariable* variable = slot->GetVariable();
|
||||
|
||||
@@ -2081,20 +2082,20 @@ namespace ScriptCanvasEditor
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Graph::ConvertSlotToReference(const GraphCanvas::Endpoint& endpoint)
|
||||
bool Graph::ConvertSlotToReference(const GraphCanvas::Endpoint& endpoint, bool isNewSlot)
|
||||
{
|
||||
ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint);
|
||||
ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId());
|
||||
|
||||
if (canvasNode)
|
||||
{
|
||||
return canvasNode->ConvertSlotToReference(scEndpoint.GetSlotId());
|
||||
return canvasNode->ConvertSlotToReference(scEndpoint.GetSlotId(), isNewSlot);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Graph::CanConvertSlotToReference(const GraphCanvas::Endpoint& endpoint)
|
||||
bool Graph::CanConvertSlotToReference(const GraphCanvas::Endpoint& endpoint, bool isNewSlot)
|
||||
{
|
||||
ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint);
|
||||
ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId());
|
||||
@@ -2104,7 +2105,7 @@ namespace ScriptCanvasEditor
|
||||
ScriptCanvas::Slot* slot = canvasNode->GetSlot(scEndpoint.GetSlotId());
|
||||
if (slot)
|
||||
{
|
||||
return slot->CanConvertToReference();
|
||||
return slot->CanConvertToReference(isNewSlot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2170,7 +2171,7 @@ namespace ScriptCanvasEditor
|
||||
return handledEvent;
|
||||
}
|
||||
|
||||
bool Graph::CanPromoteToVariable(const GraphCanvas::Endpoint& endpoint) const
|
||||
bool Graph::CanPromoteToVariable(const GraphCanvas::Endpoint& endpoint, [[maybe_unused]] bool isNewSlot) const
|
||||
{
|
||||
ScriptCanvas::Endpoint scriptCanvasEndpoint = ConvertToScriptCanvasEndpoint(endpoint);
|
||||
auto activeSlot = FindSlot(scriptCanvasEndpoint);
|
||||
@@ -2189,8 +2190,9 @@ namespace ScriptCanvasEditor
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Graph::PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint)
|
||||
bool Graph::PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint, bool isNewSlot)
|
||||
{
|
||||
// #sc_user_slot_variable_ux make the fix here...rework is user added or something
|
||||
ScriptCanvas::Endpoint scriptCanvasEndpoint = ConvertToScriptCanvasEndpoint(endpoint);
|
||||
|
||||
auto activeNode = FindNode(scriptCanvasEndpoint.GetNodeId());
|
||||
@@ -2282,12 +2284,12 @@ namespace ScriptCanvasEditor
|
||||
|
||||
AZ::Outcome<ScriptCanvas::VariableId, AZStd::string> addOutcome;
|
||||
|
||||
// #functions2 slot<->variable re-use the activeDatum, send the pointer (actually, all of the source slot information, and make a special conversion)
|
||||
// #sc_user_slot_variable_ux re-use the activeDatum, send the pointer (actually, all of the source slot information, and make a special conversion)
|
||||
ScriptCanvas::GraphVariableManagerRequestBus::EventResult(addOutcome, GetScriptCanvasId(), &ScriptCanvas::GraphVariableManagerRequests::AddVariable, variableName, variableDatum, true);
|
||||
|
||||
if (addOutcome.IsSuccess())
|
||||
{
|
||||
GraphCanvas::DataSlotRequestBus::Event(endpoint.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference);
|
||||
GraphCanvas::DataSlotRequestBus::Event(endpoint.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference, isNewSlot);
|
||||
|
||||
activeSlot->SetVariableReference(addOutcome.GetValue());
|
||||
|
||||
@@ -2319,7 +2321,7 @@ namespace ScriptCanvasEditor
|
||||
{
|
||||
if (!targetSlot->IsVariableReference())
|
||||
{
|
||||
GraphCanvas::DataSlotRequestBus::Event(referenceTarget.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference);
|
||||
GraphCanvas::DataSlotRequestBus::Event(referenceTarget.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference, false);
|
||||
}
|
||||
|
||||
if (targetSlot->IsVariableReference())
|
||||
@@ -2884,7 +2886,7 @@ namespace ScriptCanvasEditor
|
||||
|
||||
for (auto graphCanvasEndpoint : referencableEndpoints)
|
||||
{
|
||||
GraphCanvas::DataSlotRequestBus::Event(graphCanvasEndpoint.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference);
|
||||
GraphCanvas::DataSlotRequestBus::Event(graphCanvasEndpoint.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference, false);
|
||||
|
||||
ScriptCanvas::Endpoint scriptCanvasEndpoint = ConvertToScriptCanvasEndpoint(graphCanvasEndpoint);
|
||||
|
||||
|
||||
@@ -175,12 +175,12 @@ namespace ScriptCanvasEditor
|
||||
void RemoveSlot(const GraphCanvas::Endpoint& endpoint) override;
|
||||
bool IsSlotRemovable(const GraphCanvas::Endpoint& endpoint) const override;
|
||||
|
||||
bool ConvertSlotToReference(const GraphCanvas::Endpoint& endpoint) override;
|
||||
bool CanConvertSlotToReference(const GraphCanvas::Endpoint& endpoint) override;
|
||||
bool ConvertSlotToReference(const GraphCanvas::Endpoint& endpoint, bool isNewSlot = false) override;
|
||||
bool CanConvertSlotToReference(const GraphCanvas::Endpoint& endpoint, bool isNewSlot = false) override;
|
||||
GraphCanvas::CanHandleMimeEventOutcome CanHandleReferenceMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) override;
|
||||
bool HandleReferenceMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) override;
|
||||
bool CanPromoteToVariable(const GraphCanvas::Endpoint& endpoint) const override;
|
||||
bool PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint) override;
|
||||
bool CanPromoteToVariable(const GraphCanvas::Endpoint& endpoint, bool isNewSlot = false) const override;
|
||||
bool PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint, bool isNewSlot = false) override;
|
||||
bool SynchronizeReferences(const GraphCanvas::Endpoint& sourceEndpoint, const GraphCanvas::Endpoint& targetEndpoint) override;
|
||||
|
||||
bool ConvertSlotToValue(const GraphCanvas::Endpoint& endpoint) override;
|
||||
|
||||
@@ -516,7 +516,7 @@ namespace ScriptCanvasEditor
|
||||
GraphCanvas::SlotRequestBus::EventResult(endpoint, slotId2, &GraphCanvas::SlotRequests::GetEndpoint);
|
||||
|
||||
bool promotedElement = false;
|
||||
GraphCanvas::GraphModelRequestBus::EventResult(promotedElement, graphId2, &GraphCanvas::GraphModelRequests::PromoteToVariableAction, endpoint);
|
||||
GraphCanvas::GraphModelRequestBus::EventResult(promotedElement, graphId2, &GraphCanvas::GraphModelRequests::PromoteToVariableAction, endpoint, false);
|
||||
|
||||
if (promotedElement)
|
||||
{
|
||||
|
||||
@@ -100,12 +100,18 @@ namespace ScriptCanvas
|
||||
{
|
||||
RuntimeAsset* runtimeAsset = asset.GetAs<RuntimeAsset>();
|
||||
AZ_Assert(runtimeAsset, "This should be a Script Canvas runtime asset, as this is the only type we process!");
|
||||
|
||||
if (runtimeAsset && m_serializeContext)
|
||||
{
|
||||
stream->Seek(0U, AZ::IO::GenericStream::ST_SEEK_BEGIN);
|
||||
bool loadSuccess = AZ::Utils::LoadObjectFromStreamInPlace(*stream, runtimeAsset->m_runtimeData, m_serializeContext, AZ::ObjectStream::FilterDescriptor(assetLoadFilterCB));
|
||||
const bool loadSuccess = AZ::Utils::LoadObjectFromStreamInPlace(*stream, runtimeAsset->m_runtimeData
|
||||
, m_serializeContext, AZ::ObjectStream::FilterDescriptor(assetLoadFilterCB));
|
||||
AZ_Error("ScriptCanvas", loadSuccess, "ScriptCanvas failed to load runtime asset: %s - %s"
|
||||
, asset.GetHint().c_str(), asset.GetId().ToString<AZStd::string>().c_str());
|
||||
|
||||
return loadSuccess ? AZ::Data::AssetHandler::LoadResult::LoadComplete : AZ::Data::AssetHandler::LoadResult::Error;
|
||||
}
|
||||
|
||||
return AZ::Data::AssetHandler::LoadResult::Error;
|
||||
}
|
||||
|
||||
|
||||
@@ -2577,11 +2577,11 @@ namespace ScriptCanvas
|
||||
}
|
||||
}
|
||||
|
||||
bool Node::ConvertSlotToReference(const SlotId& slotId)
|
||||
bool Node::ConvertSlotToReference(const SlotId& slotId, bool isNewSlot)
|
||||
{
|
||||
Slot* slot = GetSlot(slotId);
|
||||
|
||||
if (slot && slot->ConvertToReference())
|
||||
if (slot && slot->ConvertToReference(isNewSlot))
|
||||
{
|
||||
InitializeVariableReference((*slot), {});
|
||||
return true;
|
||||
|
||||
@@ -498,7 +498,7 @@ namespace ScriptCanvas
|
||||
void SanityCheckDynamicDisplay();
|
||||
void SanityCheckDynamicDisplay(ExploredDynamicGroupCache& exploredGroupCache);
|
||||
|
||||
bool ConvertSlotToReference(const SlotId& slotId);
|
||||
bool ConvertSlotToReference(const SlotId& slotId, bool isNewSlot = false);
|
||||
bool ConvertSlotToValue(const SlotId& slotId);
|
||||
|
||||
NamedEndpoint CreateNamedEndpoint(SlotId slotId) const;
|
||||
|
||||
@@ -460,14 +460,15 @@ namespace ScriptCanvas
|
||||
&& GetDataType() != Data::Type::BehaviorContextObject(GraphScopedVariableId::TYPEINFO_Uuid());
|
||||
}
|
||||
|
||||
bool Slot::CanConvertToReference() const
|
||||
{
|
||||
return !m_isUserAdded && CanConvertTypes() && !m_isVariableReference && !m_node->HasConnectedNodes((*this));
|
||||
bool Slot::CanConvertToReference(bool isNewSlot) const
|
||||
{
|
||||
// #sc_user_slot_variable_ux make sure this can be converted to reference, or created as one
|
||||
return (!m_isUserAdded || isNewSlot) && CanConvertTypes() && !m_isVariableReference && !m_node->HasConnectedNodes((*this));
|
||||
}
|
||||
|
||||
bool Slot::ConvertToReference()
|
||||
bool Slot::ConvertToReference(bool isNewSlot)
|
||||
{
|
||||
if (CanConvertToReference())
|
||||
if (CanConvertToReference(isNewSlot))
|
||||
{
|
||||
m_isVariableReference = true;
|
||||
|
||||
|
||||
@@ -147,8 +147,8 @@ namespace ScriptCanvas
|
||||
bool CanConvertToValue() const;
|
||||
bool ConvertToValue();
|
||||
|
||||
bool CanConvertToReference() const;
|
||||
bool ConvertToReference();
|
||||
bool CanConvertToReference(bool isNewSlot = false) const;
|
||||
bool ConvertToReference(bool isNewSlot = false);
|
||||
void SetVariableReference(const VariableId& variableId);
|
||||
const VariableId& GetVariableReference() const;
|
||||
GraphVariable* GetVariable() const;
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace ScriptCanvas
|
||||
|
||||
if (auto datum = variablePair.second.GetDatum())
|
||||
{
|
||||
// #functions2 slot<->variable consider getting all variables from the UX variable manager, or from the ACM and looking them up in the variable manager for ordering
|
||||
// #sc_user_slot_variable_ux consider getting all variables from the UX variable manager, or from the ACM and looking them up in the variable manager for ordering
|
||||
m_sourceVariableByDatum.insert(AZStd::make_pair(datum, &variablePair.second));
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ namespace ScriptCanvas
|
||||
auto datum = sourceVariable->GetDatum();
|
||||
AZ_Assert(datum != nullptr, "the datum must be valid");
|
||||
|
||||
// #functions2 slot<->variable check to verify if it is a member variable
|
||||
// #sc_user_slot_variable_ux check to verify if it is a member variable
|
||||
auto variable = sourceVariable->GetScope() == VariableFlags::Scope::Graph
|
||||
? AddMemberVariable(*datum, sourceVariable->GetVariableName(), sourceVariable->GetVariableId())
|
||||
: AddVariable(*datum, sourceVariable->GetVariableName(), sourceVariable->GetVariableId());
|
||||
@@ -1671,7 +1671,7 @@ namespace ScriptCanvas
|
||||
|
||||
if (returnValue.second->m_source->m_sourceSlotId == slot->GetId())
|
||||
{
|
||||
// #functions2 slot<->variable determine if the root or the function call should be passed in here...the slot/node lead to the user call on the thread, but it may not even be created yet
|
||||
// #sc_user_slot_variable_ux determine if the root or the function call should be passed in here...the slot/node lead to the user call on the thread, but it may not even be created yet
|
||||
return AZStd::make_pair(root, returnValue.second->m_source);
|
||||
}
|
||||
}
|
||||
@@ -4644,7 +4644,7 @@ namespace ScriptCanvas
|
||||
|
||||
void AbstractCodeModel::ParseNodelingVariables(const Node& node, NodelingType nodelingType)
|
||||
{
|
||||
// #functions2 slot<->variable adjust once datums are more coordinated
|
||||
// #sc_user_slot_variable_ux adjust once datums are more coordinated
|
||||
auto createVariablesSlots = [&](AZStd::unordered_map<const Slot*, VariablePtr>& variablesBySlots, const AZStd::vector<const Slot*>& slots, bool slotHasDatum)
|
||||
{
|
||||
for (const auto& slot : slots)
|
||||
@@ -4660,7 +4660,7 @@ namespace ScriptCanvas
|
||||
return;
|
||||
}
|
||||
|
||||
// #functions2 slot<->variable consider getting all variables from the UX variable manager, or from the ACM and looking them up in the variable manager for ordering
|
||||
// #sc_user_slot_variable_ux consider getting all variables from the UX variable manager, or from the ACM and looking them up in the variable manager for ordering
|
||||
// auto iter = m_sourceVariableByDatum.find(variableDatum);
|
||||
// if (iter == m_sourceVariableByDatum.end())
|
||||
// {
|
||||
|
||||
+1
-1
@@ -220,7 +220,7 @@ namespace ScriptCanvas
|
||||
return AZ::Success(newId);
|
||||
}
|
||||
|
||||
// #functions2 slot<->variable add this to the graph, using the old datum
|
||||
// #sc_user_slot_variable_ux add this to the graph, using the old datum
|
||||
AZ::Outcome<VariableId, AZStd::string> GraphVariableManagerComponent::AddVariable(AZStd::string_view name, const Datum& value, bool functionScope)
|
||||
{
|
||||
if (FindVariable(name))
|
||||
|
||||
Reference in New Issue
Block a user