Disambiguate setters and getters with the same name + updates to fix duplicates

Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com>
This commit is contained in:
lsemp3d
2021-11-30 17:37:56 -08:00
parent 3ee528042f
commit 8ebfe4004e
7 changed files with 625 additions and 721 deletions
@@ -328,6 +328,7 @@ namespace ScriptCanvasEditor::Nodes
// Set the class' name as the subtitle fallback
details.m_subtitle = details.m_name;
AZStd::string methodContext;
// Get the method's text data
GraphCanvas::TranslationRequests::Details methodDetails;
methodDetails.m_name = details.m_name; // fallback
@@ -338,14 +339,16 @@ namespace ScriptCanvasEditor::Nodes
if (methodNode->GetMethodType() == ScriptCanvas::MethodType::Getter || methodNode->GetMethodType() == ScriptCanvas::MethodType::Free)
{
updatedMethodName = "Get";
methodContext = "Getter";
}
else
{
updatedMethodName = "Set";
methodContext = "Setter";
}
updatedMethodName.append(methodName);
}
key << updatedMethodName;
key << methodContext << updatedMethodName;
GraphCanvas::TranslationRequestBus::BroadcastResult(methodDetails, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", methodDetails);
@@ -1023,13 +1023,15 @@ namespace ScriptCanvasEditor
GraphCanvas::TranslationKey key;
AZStd::string context;
AZStd::string updatedMethodName;
if (propertyStatus != ScriptCanvas::PropertyStatus::None)
{
updatedMethodName = (propertyStatus == ScriptCanvas::PropertyStatus::Getter) ? "Get" : "Set";
context = (propertyStatus == ScriptCanvas::PropertyStatus::Getter) ? "Getter" : "Setter";
}
updatedMethodName += methodName;
key << "BehaviorClass" << methodClass.c_str() << "methods" << updatedMethodName << "details";
key << "BehaviorClass" << context << methodClass << "methods" << updatedMethodName << "details";
GraphCanvas::TranslationRequests::Details details;
GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key, details);