Fixed the application of translation overrides to free standing BehaviorProperty constants
Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com>
This commit is contained in:
@@ -266,6 +266,7 @@ namespace ScriptCanvasEditor::Nodes
|
||||
graphCanvasEntity->CreateComponent<SlotMappingComponent>(methodNode->GetEntityId());
|
||||
graphCanvasEntity->CreateComponent<SceneMemberMappingComponent>(methodNode->GetEntityId());
|
||||
|
||||
bool isAccessor = false;
|
||||
switch (methodNode->GetMethodType())
|
||||
{
|
||||
case ScriptCanvas::MethodType::Event:
|
||||
@@ -273,8 +274,9 @@ namespace ScriptCanvasEditor::Nodes
|
||||
break;
|
||||
case ScriptCanvas::MethodType::Getter:
|
||||
case ScriptCanvas::MethodType::Setter:
|
||||
case ScriptCanvas::MethodType::Member:
|
||||
case ScriptCanvas::MethodType::Free:
|
||||
isAccessor = true;
|
||||
case ScriptCanvas::MethodType::Member:
|
||||
graphCanvasEntity->CreateComponent<ClassMethodNodeDescriptorComponent>();
|
||||
break;
|
||||
break;
|
||||
@@ -297,14 +299,29 @@ namespace ScriptCanvasEditor::Nodes
|
||||
|
||||
const bool isEBusSender = (methodNode->GetMethodType() == ScriptCanvas::MethodType::Event);
|
||||
const AZStd::string& className = methodNode->GetMethodClassName();
|
||||
const AZStd::string& methodName = methodNode->GetName();
|
||||
AZStd::string methodName = methodNode->GetName();
|
||||
|
||||
GraphCanvas::TranslationKey key;
|
||||
|
||||
if (isAccessor)
|
||||
{
|
||||
AZ::StringFunc::Replace(methodName, "::Getter", "");
|
||||
AZ::StringFunc::Replace(methodName, "::Setter", "");
|
||||
}
|
||||
|
||||
GraphCanvas::TranslationRequests::Details details;
|
||||
details.m_name = methodName;
|
||||
|
||||
GraphCanvas::TranslationKey key;
|
||||
key = isEBusSender ? "EBusSender" : "BehaviorClass";
|
||||
key << className;
|
||||
AZStd::string context;
|
||||
if (methodNode->GetMethodType() == ScriptCanvas::MethodType::Free)
|
||||
{
|
||||
context = "Constant";
|
||||
}
|
||||
else
|
||||
{
|
||||
context = isEBusSender ? "EBusSender" : "BehaviorClass";
|
||||
}
|
||||
key << context << className;
|
||||
|
||||
GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", details);
|
||||
|
||||
@@ -351,8 +368,8 @@ namespace ScriptCanvasEditor::Nodes
|
||||
|
||||
if (slot.IsData())
|
||||
{
|
||||
key = isEBusSender ? "EBusSender" : "BehaviorClass";
|
||||
key << className << "methods" << methodName;
|
||||
key.clear();
|
||||
key << context << className << "methods" << methodName;
|
||||
if (slot.IsData() && slot.IsInput())
|
||||
{
|
||||
key << "params";
|
||||
|
||||
+1
-3
@@ -151,13 +151,11 @@ namespace ScriptCanvasEditor
|
||||
: DraggableNodePaletteTreeItem(nodeModelInformation.m_methodName, ScriptCanvasEditor::AssetEditorId)
|
||||
, m_methodName{ nodeModelInformation.m_methodName }
|
||||
{
|
||||
SetToolTip(QString::fromUtf8(nodeModelInformation.m_displayName.data(),
|
||||
aznumeric_cast<int>(nodeModelInformation.m_displayName.size())));
|
||||
|
||||
SetToolTip(QString::fromUtf8(nodeModelInformation.m_toolTip.data(),
|
||||
aznumeric_cast<int>(nodeModelInformation.m_toolTip.size())));
|
||||
|
||||
SetTitlePalette("MethodNodeTitlePalette");
|
||||
SetName(nodeModelInformation.m_displayName.c_str());
|
||||
}
|
||||
|
||||
GraphCanvas::GraphCanvasMimeEvent* GlobalMethodEventPaletteTreeItem::CreateMimeEvent() const
|
||||
|
||||
@@ -1049,17 +1049,22 @@ namespace ScriptCanvasEditor
|
||||
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_methodName = behaviorMethod.m_name;
|
||||
|
||||
methodModelInformation->m_titlePaletteOverride = "MethodNodeTitlePalette";
|
||||
|
||||
AZStd::string name = behaviorProperty->m_name;
|
||||
AZ::StringFunc::Replace(name, "::Getter", "");
|
||||
AZ::StringFunc::Replace(name, "::Setter", "");
|
||||
|
||||
GraphCanvas::TranslationKey key;
|
||||
key << "Constant" << behaviorProperty->m_name.c_str() << "details";
|
||||
key << "Constant" << name << "details";
|
||||
|
||||
GraphCanvas::TranslationRequests::Details details;
|
||||
GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key, details);
|
||||
|
||||
|
||||
methodModelInformation->m_displayName = details.m_name;
|
||||
methodModelInformation->m_toolTip = details.m_tooltip;
|
||||
methodModelInformation->m_categoryPath = details.m_category;
|
||||
|
||||
Reference in New Issue
Block a user