|
|
|
|
@ -249,20 +249,46 @@ namespace ScriptCanvas
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (className.empty())
|
|
|
|
|
if (!InitializeOverloaded(namespaces, className, methodName))
|
|
|
|
|
{
|
|
|
|
|
InitializeFree(namespaces, methodName);
|
|
|
|
|
if (className.empty())
|
|
|
|
|
{
|
|
|
|
|
InitializeFree(namespaces, methodName);
|
|
|
|
|
}
|
|
|
|
|
else if (auto ebusIterator = behaviorContext->m_ebuses.find(className); ebusIterator == behaviorContext->m_ebuses.end())
|
|
|
|
|
{
|
|
|
|
|
InitializeClass(namespaces, className, methodName);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
InitializeEvent(namespaces, className, methodName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (auto ebusIterator = behaviorContext->m_ebuses.find(className); ebusIterator == behaviorContext->m_ebuses.end())
|
|
|
|
|
|
|
|
|
|
PopulateNodeType();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Method::InitializeOverloaded([[maybe_unused]] const NamespacePath& namespaces, AZStd::string_view className, AZStd::string_view methodName)
|
|
|
|
|
{
|
|
|
|
|
const AZ::BehaviorMethod* method{};
|
|
|
|
|
const AZ::BehaviorClass* bcClass{};
|
|
|
|
|
AZStd::string prettyClassName;
|
|
|
|
|
|
|
|
|
|
if (IsMethodOverloaded() && BehaviorContextUtils::FindExplicitOverload(method, bcClass, className, methodName, &prettyClassName))
|
|
|
|
|
{
|
|
|
|
|
InitializeClass(namespaces, className, methodName);
|
|
|
|
|
MethodConfiguration config(*method, method->IsMember() ? MethodType::Member : MethodType::Free);
|
|
|
|
|
config.m_class = bcClass;
|
|
|
|
|
config.m_namespaces = &m_namespaces;
|
|
|
|
|
config.m_className = &className;
|
|
|
|
|
config.m_lookupName = &methodName;
|
|
|
|
|
config.m_prettyClassName = prettyClassName;
|
|
|
|
|
InitializeMethod(config);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
InitializeEvent(namespaces, className, methodName);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PopulateNodeType();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Method::InitializeClass(const NamespacePath&, AZStd::string_view className, AZStd::string_view methodName)
|
|
|
|
|
@ -273,8 +299,7 @@ namespace ScriptCanvas
|
|
|
|
|
const AZ::BehaviorClass* bcClass{};
|
|
|
|
|
AZStd::string prettyClassName;
|
|
|
|
|
|
|
|
|
|
if ((IsMethodOverloaded() && BehaviorContextUtils::FindExplicitOverload(method, bcClass, className, methodName, &prettyClassName))
|
|
|
|
|
|| BehaviorContextUtils::FindClass(method, bcClass, className, methodName, &prettyClassName))
|
|
|
|
|
if (BehaviorContextUtils::FindClass(method, bcClass, className, methodName, &prettyClassName))
|
|
|
|
|
{
|
|
|
|
|
MethodConfiguration config(*method, MethodType::Member);
|
|
|
|
|
config.m_class = bcClass;
|
|
|
|
|
@ -308,6 +333,7 @@ namespace ScriptCanvas
|
|
|
|
|
AZStd::lock_guard<AZStd::recursive_mutex> lock(m_mutex);
|
|
|
|
|
|
|
|
|
|
const AZ::BehaviorMethod* method{};
|
|
|
|
|
|
|
|
|
|
if (BehaviorContextUtils::FindFree(method, methodName))
|
|
|
|
|
{
|
|
|
|
|
MethodConfiguration config(*method, MethodType::Free);
|
|
|
|
|
@ -525,6 +551,17 @@ namespace ScriptCanvas
|
|
|
|
|
|
|
|
|
|
m_method = &method;
|
|
|
|
|
m_class = bcClass;
|
|
|
|
|
AZ::BehaviorContext* behaviorContext = nullptr;
|
|
|
|
|
AZ::ComponentApplicationBus::BroadcastResult(behaviorContext, &AZ::ComponentApplicationRequests::GetBehaviorContext);
|
|
|
|
|
|
|
|
|
|
if (bcClass && behaviorContext)
|
|
|
|
|
{
|
|
|
|
|
if (auto prettyNameAttribute = AZ::FindAttribute(AZ::ScriptCanvasAttributes::PrettyName, bcClass->m_attributes))
|
|
|
|
|
{
|
|
|
|
|
AZ::AttributeReader operatorAttrReader(nullptr, prettyNameAttribute);
|
|
|
|
|
operatorAttrReader.Read<AZStd::string>(m_classNamePretty, *behaviorContext);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_classNamePretty.empty())
|
|
|
|
|
{
|
|
|
|
|
|