Integrating github/staging through commit ab87ed9
This commit is contained in:
@@ -371,7 +371,7 @@ namespace ScriptCanvasEditor
|
||||
|
||||
while (m_ui->typeSelectionFrame->layout()->count() > 0)
|
||||
{
|
||||
QLayoutItem* layoutItem = m_ui->typeSelectionFrame->layout()->takeAt(0);
|
||||
m_ui->typeSelectionFrame->layout()->takeAt(0);
|
||||
}
|
||||
|
||||
for (ContainerTypeLineEdit* lineEdit : m_containerTypeLineEdit)
|
||||
@@ -621,4 +621,4 @@ namespace ScriptCanvasEditor
|
||||
}
|
||||
}
|
||||
|
||||
#include <Editor/View/Dialogs/ContainerWizard/moc_ContainerWizard.cpp>
|
||||
#include <Editor/View/Dialogs/ContainerWizard/moc_ContainerWizard.cpp>
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace
|
||||
|
||||
AZ::Uuid type = dataModel->data(index, CommandListDataModel::CustomRole::Types).value<AZ::Uuid>();
|
||||
|
||||
const AZ::SerializeContext::ClassData* classData = serializeContext->FindClassData(type);
|
||||
[[maybe_unused]] const AZ::SerializeContext::ClassData* classData = serializeContext->FindClassData(type);
|
||||
AZ_Assert(classData, "Failed to find ClassData for ID: %s", type.ToString<AZStd::string>().data());
|
||||
|
||||
ScriptCanvasEditor::Nodes::StyleConfiguration styleConfiguration;
|
||||
|
||||
@@ -131,7 +131,6 @@ namespace ScriptCanvasEditor
|
||||
{
|
||||
ExecutionLogTreeItem* treeItem = nullptr;
|
||||
|
||||
bool signalChanged = false;
|
||||
if (m_updatePolicy == UpdatePolicy::Batched)
|
||||
{
|
||||
if (!m_additionTimer.isActive())
|
||||
|
||||
@@ -254,8 +254,6 @@ namespace ScriptCanvasEditor
|
||||
QAbstractItemModel* model = sourceModel();
|
||||
QModelIndex index = model->index(sourceRow, PivotTreeItem::Column::Name, sourceParent);
|
||||
|
||||
PivotTreeItem* basePivotTreeItem = static_cast<PivotTreeItem*>(index.internalPointer());
|
||||
|
||||
QString test = model->data(index, Qt::DisplayRole).toString();
|
||||
|
||||
bool showRow = test.lastIndexOf(m_filterRegex) >= 0;
|
||||
|
||||
@@ -70,17 +70,6 @@ namespace
|
||||
return false;
|
||||
}
|
||||
|
||||
// Used for changing the node's style to identify as a preview node.
|
||||
bool IsPreviewNode(const AZ::Edit::AttributeData<AZ::Script::Attributes::ExcludeFlags>* excludeAttributeData)
|
||||
{
|
||||
if (excludeAttributeData)
|
||||
{
|
||||
return (static_cast<AZ::u64>(excludeAttributeData->Get(nullptr)) & AZ::Script::Attributes::ExcludeFlags::Preview) != 0; // warning C4800: 'AZ::u64': forcing value to bool 'true' or 'false' (performance warning)
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool HasExcludeFromNodeListAttribute(const AZ::SerializeContext* serializeContext, const AZ::Uuid& typeId)
|
||||
{
|
||||
const AZ::SerializeContext::ClassData* classData = serializeContext->FindClassData(typeId);
|
||||
@@ -200,6 +189,11 @@ namespace
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AZ::Internal::IsInScope(behaviorMethod.m_attributes, AZ::Script::Attributes::ScopeFlags::Common))
|
||||
{
|
||||
return; // skip this method
|
||||
}
|
||||
|
||||
// If the reflected method returns an AZ::Event, reflect it to the SerializeContext
|
||||
if (AZ::MethodReturnsAzEventByReferenceOrPointer(behaviorMethod))
|
||||
{
|
||||
@@ -306,7 +300,6 @@ namespace
|
||||
{
|
||||
ScriptCanvasEditor::CategoryInformation categoryInfo;
|
||||
|
||||
bool isDeprecated = false;
|
||||
AZStd::string categoryPath = classData->m_editData ? classData->m_editData->m_name : classData->m_name;
|
||||
|
||||
if (classData->m_editData)
|
||||
@@ -345,8 +338,6 @@ namespace
|
||||
// Children
|
||||
for (auto& node : ScriptCanvas::Library::LibraryDefinition::GetNodes(classData->m_typeId))
|
||||
{
|
||||
GraphCanvas::NodePaletteTreeItem* nodeParent = nullptr;
|
||||
|
||||
if (HasExcludeFromNodeListAttribute(&serializeContext, node.first))
|
||||
{
|
||||
continue;
|
||||
@@ -391,7 +382,6 @@ namespace
|
||||
void PopulateVariablePalette()
|
||||
{
|
||||
auto dataRegistry = ScriptCanvas::GetDataRegistry();
|
||||
const auto& typeIdTraitMap = dataRegistry->m_typeIdTraitMap;
|
||||
|
||||
for (auto& type : dataRegistry->m_creatableTypes)
|
||||
{
|
||||
@@ -454,14 +444,23 @@ namespace
|
||||
continue;
|
||||
}
|
||||
|
||||
if (behaviorProperty->m_getter)
|
||||
if (behaviorProperty->m_getter && !behaviorProperty->m_setter)
|
||||
{
|
||||
RegisterGlobalMethod(nodePaletteModel, behaviorContext, *behaviorProperty->m_getter);
|
||||
nodePaletteModel.RegisterGlobalConstant(behaviorContext, *behaviorProperty->m_getter);
|
||||
}
|
||||
if (behaviorProperty->m_setter)
|
||||
else
|
||||
{
|
||||
RegisterGlobalMethod(nodePaletteModel, behaviorContext, *behaviorProperty->m_setter);
|
||||
if (behaviorProperty->m_getter)
|
||||
{
|
||||
RegisterGlobalMethod(nodePaletteModel, behaviorContext, *behaviorProperty->m_getter);
|
||||
}
|
||||
|
||||
if (behaviorProperty->m_setter)
|
||||
{
|
||||
RegisterGlobalMethod(nodePaletteModel, behaviorContext, *behaviorProperty->m_setter);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -956,10 +955,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
customNodeInformation->m_displayName = name;
|
||||
|
||||
bool isToolTipSet(false);
|
||||
|
||||
bool isMissingEntry(false);
|
||||
bool isMissingTooltip(false);
|
||||
bool isDeprecated(false);
|
||||
|
||||
if (classData && classData->m_editData && classData->m_editData->m_name)
|
||||
@@ -1105,6 +1100,48 @@ namespace ScriptCanvasEditor
|
||||
}
|
||||
}
|
||||
|
||||
void NodePaletteModel::RegisterGlobalConstant(const AZ::BehaviorContext& behaviorContext, const AZ::BehaviorMethod& behaviorMethod)
|
||||
{
|
||||
// Construct Node Identifier using the BehaviorMethod name and the ScriptCanvas Method typeid
|
||||
ScriptCanvas::NodeTypeIdentifier nodeIdentifier =
|
||||
ScriptCanvas::NodeUtils::ConstructGlobalMethodNodeIdentifier(behaviorMethod.m_name);
|
||||
|
||||
// Register the methodModelInformation if not already registered
|
||||
if (auto registerIter = m_registeredNodes.find(nodeIdentifier); registerIter == m_registeredNodes.end())
|
||||
{
|
||||
auto methodModelInformation = AZStd::make_unique<GlobalMethodNodeModelInformation>();
|
||||
methodModelInformation->m_methodName = behaviorMethod.m_name;
|
||||
methodModelInformation->m_nodeIdentifier = nodeIdentifier;
|
||||
|
||||
methodModelInformation->m_titlePaletteOverride = "MethodNodeTitlePalette";
|
||||
|
||||
methodModelInformation->m_displayName = TranslationHelper::GetGlobalMethodKeyTranslation(methodModelInformation->m_methodName,
|
||||
TranslationItemType::Node, TranslationKeyId::Name);
|
||||
methodModelInformation->m_toolTip = TranslationHelper::GetGlobalMethodKeyTranslation(methodModelInformation->m_methodName,
|
||||
TranslationItemType::Node, TranslationKeyId::Tooltip);
|
||||
methodModelInformation->m_categoryPath = TranslationHelper::GetGlobalMethodKeyTranslation(methodModelInformation->m_methodName,
|
||||
TranslationItemType::Node, TranslationKeyId::Category);
|
||||
|
||||
if (methodModelInformation->m_displayName.empty())
|
||||
{
|
||||
methodModelInformation->m_displayName = methodModelInformation->m_methodName;
|
||||
}
|
||||
|
||||
if (methodModelInformation->m_categoryPath.empty())
|
||||
{
|
||||
methodModelInformation->m_categoryPath = GetCategoryPath(behaviorMethod.m_attributes, behaviorContext);
|
||||
// Default to making the Category for Global Methods to be informative that the method
|
||||
// is registered with the Behavior Context
|
||||
if (methodModelInformation->m_categoryPath.empty())
|
||||
{
|
||||
methodModelInformation->m_categoryPath = "Constants";
|
||||
}
|
||||
}
|
||||
|
||||
m_registeredNodes.emplace(nodeIdentifier, methodModelInformation.release());
|
||||
}
|
||||
}
|
||||
|
||||
void NodePaletteModel::RegisterMethodNode(const AZ::BehaviorContext& behaviorContext, const AZ::BehaviorMethod& behaviorMethod)
|
||||
{
|
||||
// Construct Node Identifier using the BehaviorMethod name and the ScriptCanvas Method typeid
|
||||
|
||||
@@ -85,6 +85,7 @@ namespace ScriptCanvasEditor
|
||||
void RegisterCustomNode(AZStd::string_view categoryPath, const AZ::Uuid& uuid, AZStd::string_view name, const AZ::SerializeContext::ClassData* classData);
|
||||
void RegisterClassNode(const AZStd::string& categoryPath, const AZStd::string& methodClass, const AZStd::string& methodName, const AZ::BehaviorMethod* behaviorMethod, const AZ::BehaviorContext* behaviorContext, bool isOverload);
|
||||
void RegisterMethodNode(const AZ::BehaviorContext& behaviorContext, const AZ::BehaviorMethod& behaviorMethod);
|
||||
void RegisterGlobalConstant(const AZ::BehaviorContext& behaviorContext, const AZ::BehaviorMethod& behaviorMethod);
|
||||
|
||||
void RegisterEBusHandlerNodeModelInformation(AZStd::string_view categoryPath, AZStd::string_view busName, AZStd::string_view eventName, const ScriptCanvas::EBusBusId& busId, const AZ::BehaviorEBusHandler::BusForwarderEvent& forwardEvent);
|
||||
void RegisterEBusSenderNodeModelInformation(AZStd::string_view categoryPath, AZStd::string_view busName, AZStd::string_view eventName, const ScriptCanvas::EBusBusId& busId, const ScriptCanvas::EBusEventId& eventId, const AZ::BehaviorEBusEventSender& eventSender, bool isOverload);
|
||||
|
||||
+3
-1
@@ -158,8 +158,10 @@ namespace ScriptCanvasEditor
|
||||
}
|
||||
|
||||
const ScriptEvents::ScriptEvent& definition = data->m_definition;
|
||||
|
||||
|
||||
#if defined(AZ_ENABLE_TRACING)
|
||||
bool recategorize = previousDefinition ? definition.GetCategory().compare(previousDefinition->GetCategory()) != 0 : false;
|
||||
#endif
|
||||
AZ_Warning("ScriptCanvas", !recategorize, "Unable to recategorize ScriptEvents events while open. Please close and re-open the Script Canvas Editor to see the new categorization");
|
||||
|
||||
if (definition.GetName().empty())
|
||||
|
||||
@@ -746,7 +746,9 @@ namespace ScriptCanvasEditor
|
||||
{
|
||||
break;
|
||||
}
|
||||
} while (componentNode = componentNode->GetParent());
|
||||
componentNode = componentNode->GetParent();
|
||||
}
|
||||
while (componentNode);
|
||||
|
||||
if (!componentNode)
|
||||
{
|
||||
|
||||
@@ -83,8 +83,6 @@ namespace ScriptCanvasEditor
|
||||
ScriptCanvasRootPaletteTreeItem* root = aznew ScriptCanvasRootPaletteTreeItem(nodePaletteModel, assetModel);
|
||||
|
||||
{
|
||||
GraphCanvas::NodePaletteTreeItem* utilitiesRoot = root->GetCategoryNode("Utilities");
|
||||
|
||||
GraphCanvas::NodePaletteTreeItem* variablesRoot = root->CreateChildNode<LocalVariablesListNodePaletteTreeItem>("Variables");
|
||||
root->RegisterCategoryNode(variablesRoot, "Variables");
|
||||
|
||||
@@ -605,7 +603,6 @@ namespace ScriptCanvasEditor
|
||||
AZStd::vector<const ScriptCanvas::Grammar::In*> onNodeIns;
|
||||
AZStd::vector<const ScriptCanvas::Grammar::In*> pureIns;
|
||||
|
||||
auto onNodeParent = parent;
|
||||
auto pureParent = functionCategory;
|
||||
|
||||
for (auto& in : ins)
|
||||
@@ -769,8 +766,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
AZStd::unordered_set< ScriptCanvas::VariableId > variableSet;
|
||||
|
||||
GraphCanvas::NodePaletteWidget* paletteWidget = GetNodePaletteWidget();
|
||||
|
||||
QModelIndexList indexList = GetTreeView()->selectionModel()->selectedRows();
|
||||
|
||||
if (indexList.size() == 1)
|
||||
|
||||
@@ -626,7 +626,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
QMimeData* GraphVariablesModel::mimeData(const QModelIndexList &indexes) const
|
||||
{
|
||||
QMimeData* mimeData = nullptr;
|
||||
GraphCanvas::GraphCanvasMimeContainer container;
|
||||
|
||||
bool isSet = ((QApplication::keyboardModifiers() & Qt::Modifier::ALT) != 0);
|
||||
|
||||
@@ -197,6 +197,7 @@ namespace ScriptCanvasEditor
|
||||
const AZStd::unordered_map<ScriptCanvas::VariableId, ScriptCanvas::GraphVariable>* properties = nullptr;
|
||||
ScriptCanvas::GraphVariableManagerRequestBus::EventResult(properties, m_scriptCanvasId, &ScriptCanvas::GraphVariableManagerRequests::GetVariables);
|
||||
|
||||
int numInUse = 0;
|
||||
if (properties)
|
||||
{
|
||||
for (const auto& variablePair : (*properties))
|
||||
@@ -205,7 +206,7 @@ namespace ScriptCanvasEditor
|
||||
if (testName.compare(variablePair.second.GetVariableName()) == 0)
|
||||
{
|
||||
nameInUse = true;
|
||||
break;
|
||||
++numInUse;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -214,7 +215,7 @@ namespace ScriptCanvasEditor
|
||||
|
||||
if (nameInUse)
|
||||
{
|
||||
m_slotName.append(" (duplicate)");
|
||||
m_slotName.append(AZStd::string::format(" (%d)", numInUse));
|
||||
ui->slotName->setText(m_slotName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1174,6 +1174,8 @@ namespace ScriptCanvasEditor
|
||||
}
|
||||
else
|
||||
{
|
||||
delete m_slotTypeSelector;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3973,7 +3975,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
if (mimeEvent)
|
||||
{
|
||||
bool isValid = false;
|
||||
NodeIdPair finalNode = ProcessCreateNodeMimeEvent(mimeEvent, graphCanvasGraphId, AZ::Vector2(aznumeric_cast<float>(scenePoint.x()), aznumeric_cast<float>(scenePoint.y())));
|
||||
|
||||
if (finalNode.m_graphCanvasId.IsValid())
|
||||
@@ -4225,7 +4226,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
if (mimeEvent)
|
||||
{
|
||||
bool isValid = false;
|
||||
NodeIdPair finalNode = ProcessCreateNodeMimeEvent(mimeEvent, graphCanvasGraphId, AZ::Vector2(aznumeric_cast<float>(scenePoint.x()), aznumeric_cast<float>(scenePoint.y())));
|
||||
|
||||
GraphCanvas::Endpoint sourceEndpoint;
|
||||
|
||||
@@ -278,7 +278,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
if (GraphCanvas::GraphUtils::IsSlot(m_targetId))
|
||||
{
|
||||
bool isDataSlot = false;
|
||||
GraphCanvas::SlotType slotType = GraphCanvas::SlotTypes::Invalid;
|
||||
GraphCanvas::SlotRequestBus::EventResult(slotType, m_targetId, &GraphCanvas::SlotRequests::GetSlotType);
|
||||
|
||||
@@ -786,7 +785,6 @@ namespace ScriptCanvasEditor
|
||||
if (GraphCanvas::GraphUtils::IsSlot(targetId))
|
||||
{
|
||||
// Extract the GraphCanvas Slot Type and complete endpoint from using the targetId
|
||||
bool isDataSlot{};
|
||||
GraphCanvas::SlotType slotType = GraphCanvas::SlotTypes::Invalid;
|
||||
GraphCanvas::Endpoint endpoint;
|
||||
auto GetGraphCanvasEndpoint = [&slotType, &endpoint](GraphCanvas::SlotRequests* slotRequests)
|
||||
|
||||
@@ -668,8 +668,6 @@ namespace ScriptCanvasEditor
|
||||
AZ_Assert(graphComponent, "The Script Canvas entity must have a Graph component");
|
||||
|
||||
|
||||
bool isLatest = graphComponent->GetVersion().IsLatest();
|
||||
|
||||
bool onlyShowOutdatedGraphs = m_ui->onlyShowOutdated->isChecked();
|
||||
|
||||
if (onlyShowOutdatedGraphs && graphComponent->GetVersion().IsLatest())
|
||||
@@ -837,7 +835,6 @@ namespace ScriptCanvasEditor
|
||||
const QTextCursor oldCursor = m_ui->textEdit->textCursor();
|
||||
QScrollBar* scrollBar = m_ui->textEdit->verticalScrollBar();
|
||||
const int oldScrollValue = scrollBar->value();
|
||||
bool scrolledOffBottom = oldScrollValue != scrollBar->maximum();
|
||||
|
||||
m_ui->textEdit->moveCursor(QTextCursor::End);
|
||||
QTextCursor textCursor = m_ui->textEdit->textCursor();
|
||||
|
||||
Reference in New Issue
Block a user