diff --git a/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.cpp b/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.cpp index 7eb9187123..c053c37fbc 100644 --- a/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.cpp +++ b/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.cpp @@ -328,7 +328,6 @@ namespace GraphCanvas 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()) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 92045b505f..510962cf4b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -667,7 +667,6 @@ namespace ScriptCanvasEditor } // Now that the slot has a valid type/name, we can actually promote it to a variable - // #sc_user_slot_variable_ux add a value indicating that the slot is new if (PromoteToVariableAction(endpoint, true)) { ScriptCanvas::GraphVariable* variable = slot->GetVariable(); @@ -2191,7 +2190,6 @@ namespace ScriptCanvasEditor 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()); @@ -2283,7 +2281,6 @@ namespace ScriptCanvasEditor AZ::Outcome addOutcome; - // #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()) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 573a3f6e57..b5b4fc7787 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -3874,8 +3874,12 @@ namespace ScriptCanvasEditor contextMenu.AddMenuAction(aznew ExposeSlotMenuAction(&contextMenu)); contextMenu.AddMenuAction(aznew CreateAzEventHandlerSlotMenuAction(&contextMenu)); - // disabling until references can be changed - // contextMenu.AddMenuAction(aznew SetDataSlotTypeMenuAction(&contextMenu)); + auto setSlotTypeAction = aznew SetDataSlotTypeMenuAction(&contextMenu); + // Changing slot type is disabled temporarily because now that that user data slots are correctly coordinated with their reference + // variables, their type cannot be changed. The next change will allow all variables to change their type post creation, and then + // that will allow this action to be enabled. + setSlotTypeAction->setEnabled(false); + contextMenu.AddMenuAction(setSlotTypeAction); return HandleContextMenu(contextMenu, slotId, screenPoint, scenePoint); } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp index 6aef61b12f..4bdd0daae6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp @@ -462,7 +462,6 @@ namespace ScriptCanvas 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)); } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index b2194e1bd0..345dc1ebda 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -237,7 +237,7 @@ namespace ScriptCanvas if (auto datum = variablePair.second.GetDatum()) { - // #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 + // #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 m_sourceVariableByDatum.insert(AZStd::make_pair(datum, &variablePair.second)); } } @@ -247,7 +247,7 @@ namespace ScriptCanvas auto datum = sourceVariable->GetDatum(); AZ_Assert(datum != nullptr, "the datum must be valid"); - // #sc_user_slot_variable_ux check to verify if it is a member variable + // #functions2 slot<->variable 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()); @@ -1670,7 +1670,7 @@ namespace ScriptCanvas if (returnValue.second->m_source->m_sourceSlotId == slot->GetId()) { - // #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 + // #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 return AZStd::make_pair(root, returnValue.second->m_source); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp index 81383bf747..0bd1b2c5a4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp @@ -220,7 +220,6 @@ namespace ScriptCanvas return AZ::Success(newId); } - // #sc_user_slot_variable_ux add this to the graph, using the old datum AZ::Outcome GraphVariableManagerComponent::AddVariable(AZStd::string_view name, const Datum& value, bool functionScope) { if (FindVariable(name))