diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Handlers/BlastFamilyComponentNotificationBus.names b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Handlers/BlastFamilyComponentNotificationBus.names new file mode 100644 index 0000000000..b73860d14c --- /dev/null +++ b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Handlers/BlastFamilyComponentNotificationBus.names @@ -0,0 +1,45 @@ +{ + "entries": [ + { + "key": "BlastFamilyComponentNotificationBus", + "context": "EBusHandler", + "variant": "", + "details": { + "name": "BlastFamilyComponentNotificationBus", + "category": "EBus Handlers" + }, + "methods": [ + { + "key": "OnActorCreated", + "details": { + "name": "On Actor Created" + }, + "params": [ + { + "typeid": "{A23453D5-79A8-49C8-B9F0-9CC35D711DD4}", + "details": { + "name": "Blast Actor Data", + "tooltip": "Represents Blast Actor in a Script Canvas friendly format." + } + } + ] + }, + { + "key": "OnActorDestroyed", + "details": { + "name": "On Actor Destroyed" + }, + "params": [ + { + "typeid": "{A23453D5-79A8-49C8-B9F0-9CC35D711DD4}", + "details": { + "name": "Blast Actor Data", + "tooltip": "Represents Blast Actor in a Script Canvas friendly format." + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/BlastFamilyComponentRequestBus.names b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/BlastFamilyComponentRequestBus.names new file mode 100644 index 0000000000..3b5aecdb16 --- /dev/null +++ b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/BlastFamilyComponentRequestBus.names @@ -0,0 +1,36 @@ +{ + "entries": [ + { + "key": "BlastFamilyComponentRequestBus", + "context": "EBusSender", + "variant": "", + "details": { + "name": "Blast Family" + }, + "methods": [ + { + "key": "GetActorsData", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Get Actors Data" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Get Actors Data is invoked" + }, + "details": { + "name": "Get Actors Data" + }, + "results": [ + { + "typeid": "{9B2C5410-EFDC-5A61-8B89-0F515B41AB24}", + "details": { + "name": "Actors Data" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/BlastFamilyDamageRequestBus.names b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/BlastFamilyDamageRequestBus.names new file mode 100644 index 0000000000..9ef94a60bd --- /dev/null +++ b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/BlastFamilyDamageRequestBus.names @@ -0,0 +1,315 @@ +{ + "entries": [ + { + "key": "BlastFamilyDamageRequestBus", + "context": "EBusSender", + "variant": "", + "details": { + "name": "Blast Family Damage" + }, + "methods": [ + { + "key": "Get Family Id", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Get Family Id" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Get Family Id is invoked" + }, + "details": { + "name": "Get Family Id" + }, + "results": [ + { + "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", + "details": { + "name": "Entity Id", + "tooltip": "Entity Unique Id" + } + } + ] + }, + { + "key": "Destroy actor", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Destroy actor" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Destroy actor is invoked" + }, + "details": { + "name": "Destroy Actor" + } + }, + { + "key": "Triangle Damage", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Triangle Damage" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Triangle Damage is invoked" + }, + "details": { + "name": "Triangle Damage" + }, + "params": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "Position 0", + "tooltip": "Vertex of the triangle." + } + }, + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "Position 1", + "tooltip": "Vertex of the triangle." + } + }, + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "Position 2", + "tooltip": "Vertex of the triangle." + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Damage", + "tooltip": "How much damage to deal." + } + } + ] + }, + { + "key": "Impact Spread Damage", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Impact Spread Damage" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Impact Spread Damage is invoked" + }, + "details": { + "name": "Impact Spread Damage" + }, + "params": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "Position", + "tooltip": "The global position of the damage's hit." + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Min Radius", + "tooltip": "Damages all chunks/bonds that are in the range [0, minRadius] with full damage" + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Max Radius", + "tooltip": "Damages all chunks/bonds that are in the range [minRadius, maxRadius] with linearly decreasing damage." + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Damage", + "tooltip": "How much damage to deal." + } + } + ] + }, + { + "key": "Stress Damage", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Stress Damage" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Stress Damage is invoked" + }, + "details": { + "name": "Stress Damage" + }, + "params": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "Position", + "tooltip": "The global position of the damage's hit." + } + }, + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "Force", + "tooltip": "The force applied at the position." + } + } + ] + }, + { + "key": "Shear Damage", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Shear Damage" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Shear Damage is invoked" + }, + "details": { + "name": "Shear Damage" + }, + "params": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "Position", + "tooltip": "The global position of the damage's hit." + } + }, + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "Normal", + "tooltip": "The normal of the damage's hit." + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Min Radius", + "tooltip": "Damages all chunks/bonds that are in the range [0, minRadius] with full damage." + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Max Radius", + "tooltip": "Damages all chunks/bonds that are in the range [minRadius, maxRadius] with linearly decreasing damage." + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Damage", + "tooltip": "How much damage to deal." + } + } + ] + }, + { + "key": "Capsule Damage", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Capsule Damage" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Capsule Damage is invoked" + }, + "details": { + "name": "Capsule Damage" + }, + "params": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "Position 0", + "tooltip": "The global position of one of the capsule's ends." + } + }, + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "Position 1", + "tooltip": "The global position of another of the capsule's ends." + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Min Radius", + "tooltip": "Damages all chunks/bonds that are in the range [0, minRadius] with full damage." + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Max Radius", + "tooltip": "Damages all chunks/bonds that are in the range [minRadius, maxRadius] with linearly decreasing damage." + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Damage", + "tooltip": "How much damage to deal." + } + } + ] + }, + { + "key": "Radial Damage", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Radial Damage" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Radial Damage is invoked" + }, + "details": { + "name": "Radial Damage" + }, + "params": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "Position", + "tooltip": "The global position of the damage's hit." + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Min Radius", + "tooltip": "Damages all chunks/bonds that are in the range [0, minRadius] with full damage." + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Max Radius", + "tooltip": "Damages all chunks/bonds that are in the range [minRadius, maxRadius] with linearly decreasing damage." + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Damage", + "tooltip": "How much damage to deal." + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp index 2c8f512e3b..c8122711eb 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp @@ -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; diff --git a/Gems/ScriptCanvas/Code/Tools/TranslationGeneration.cpp b/Gems/ScriptCanvas/Code/Tools/TranslationGeneration.cpp index 56aaf8fbe8..7c70f879aa 100644 --- a/Gems/ScriptCanvas/Code/Tools/TranslationGeneration.cpp +++ b/Gems/ScriptCanvas/Code/Tools/TranslationGeneration.cpp @@ -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(); 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(); 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;