Fixed EBus generation to pull the BC metadata, and a few text updates
Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com>
This commit is contained in:
@@ -329,18 +329,24 @@ namespace ScriptCanvasEditor::Nodes
|
||||
details.m_subtitle = details.m_name;
|
||||
|
||||
// Get the method's text data
|
||||
GraphCanvas::TranslationRequests::Details methodDetails;
|
||||
key << "methods" << methodName;
|
||||
GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", details);
|
||||
GraphCanvas::TranslationRequestBus::BroadcastResult(methodDetails, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", methodDetails);
|
||||
|
||||
if (methodDetails.m_subtitle.empty())
|
||||
{
|
||||
methodDetails.m_subtitle = details.m_name;
|
||||
}
|
||||
|
||||
// Add to the tooltip the C++ class for reference
|
||||
if (!details.m_tooltip.empty())
|
||||
if (!methodDetails.m_tooltip.empty())
|
||||
{
|
||||
details.m_tooltip.append("\n");
|
||||
methodDetails.m_tooltip.append("\n");
|
||||
}
|
||||
details.m_tooltip.append(AZStd::string::format("[C++] %s", className.c_str()));
|
||||
methodDetails.m_tooltip.append(AZStd::string::format("[C++] %s", className.c_str()));
|
||||
|
||||
GraphCanvas::NodeTitleRequestBus::Event(graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::SetDetails, details.m_name, details.m_subtitle);
|
||||
GraphCanvas::NodeRequestBus::Event(graphCanvasNodeId, &GraphCanvas::NodeRequests::SetTooltip, details.m_tooltip);
|
||||
GraphCanvas::NodeTitleRequestBus::Event(graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::SetDetails, methodDetails.m_name, methodDetails.m_subtitle);
|
||||
GraphCanvas::NodeRequestBus::Event(graphCanvasNodeId, &GraphCanvas::NodeRequests::SetTooltip, methodDetails.m_tooltip);
|
||||
|
||||
int paramIndex = 0;
|
||||
int outputIndex = 0;
|
||||
|
||||
@@ -106,8 +106,7 @@ namespace ScriptCanvasEditorTools
|
||||
Method eventEntry;
|
||||
const char* eventName = event.first.c_str();
|
||||
|
||||
AZStd::string cleanName = GraphCanvas::TranslationKey::Sanitize(eventName);
|
||||
eventEntry.m_key = cleanName;
|
||||
eventEntry.m_key = eventName;
|
||||
|
||||
prettyName = Helpers::GetStringAttribute(behaviorEBus, AZ::ScriptCanvasAttributes::PrettyName);
|
||||
eventEntry.m_details.m_name = prettyName.empty() ? eventName : prettyName;
|
||||
@@ -124,8 +123,22 @@ namespace ScriptCanvasEditorTools
|
||||
Argument argument;
|
||||
auto argumentType = method->GetArgument(i)->m_typeId;
|
||||
|
||||
// Check the BC for metadata
|
||||
|
||||
Helpers::GetTypeNameAndDescription(argumentType, argument.m_details.m_name, argument.m_details.m_tooltip);
|
||||
|
||||
auto name = method->GetArgumentName(i);
|
||||
if (!name->empty())
|
||||
{
|
||||
argument.m_details.m_name = *name;
|
||||
}
|
||||
|
||||
auto tooltip = method->GetArgumentToolTip(i);
|
||||
if (!tooltip->empty())
|
||||
{
|
||||
argument.m_details.m_tooltip = *tooltip;
|
||||
}
|
||||
|
||||
argument.m_typeId = argumentType.ToString<AZStd::string>();
|
||||
|
||||
eventEntry.m_arguments.push_back(argument);
|
||||
@@ -136,8 +149,15 @@ namespace ScriptCanvasEditorTools
|
||||
Argument result;
|
||||
|
||||
auto resultType = method->GetResult()->m_typeId;
|
||||
|
||||
Helpers::GetTypeNameAndDescription(resultType, result.m_details.m_name, result.m_details.m_tooltip);
|
||||
|
||||
auto tooltip = method->GetArgumentToolTip(0);
|
||||
if (!tooltip->empty())
|
||||
{
|
||||
result.m_details.m_tooltip = *tooltip;
|
||||
}
|
||||
|
||||
result.m_typeId = resultType.ToString<AZStd::string>();
|
||||
|
||||
eventEntry.m_results.push_back(result);
|
||||
@@ -924,6 +944,22 @@ namespace ScriptCanvasEditorTools
|
||||
Helpers::GetTypeNameAndDescription(parameter.m_typeId, argumentName, argumentDescription);
|
||||
}
|
||||
|
||||
if (!event.m_metadataParameters.empty() && event.m_metadataParameters.size() > argIndex)
|
||||
{
|
||||
auto name = event.m_metadataParameters[argIndex].m_name;
|
||||
auto tooltip = event.m_metadataParameters[argIndex].m_toolTip;
|
||||
|
||||
if (!name.empty())
|
||||
{
|
||||
argumentName = name;
|
||||
}
|
||||
|
||||
if (!tooltip.empty())
|
||||
{
|
||||
argumentDescription = tooltip;
|
||||
}
|
||||
}
|
||||
|
||||
argument.m_typeId = argumentKey;
|
||||
argument.m_details.m_name = argumentName;
|
||||
argument.m_details.m_tooltip = argumentDescription;
|
||||
|
||||
Reference in New Issue
Block a user