The Great ScriptCanvas Purge, Part IV
Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"CurrentProjectSetting": "No Configurations"
|
||||
}
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"ExpandedNodes": [
|
||||
""
|
||||
],
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
||||
Binary file not shown.
@@ -52,32 +52,6 @@ namespace ScriptCanvas
|
||||
}
|
||||
}
|
||||
|
||||
void Contains::OnInputSignal(const SlotId&)
|
||||
{
|
||||
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Contains::OnInputSignal");
|
||||
|
||||
AZStd::string sourceString = ContainsProperty::GetSource(this);
|
||||
AZStd::string patternString = ContainsProperty::GetPattern(this);
|
||||
|
||||
bool caseSensitive = ContainsProperty::GetCaseSensitive(this);
|
||||
bool searchFromEnd = ContainsProperty::GetSearchFromEnd(this);
|
||||
|
||||
auto index = AzFramework::StringFunc::Find(sourceString.c_str(), patternString.c_str(), 0, searchFromEnd, caseSensitive);
|
||||
if (index != AZStd::string::npos)
|
||||
{
|
||||
const SlotId outputIndexSlotId = ContainsProperty::GetIndexSlotId(this);
|
||||
if (auto* indexSlot = GetSlot(outputIndexSlotId))
|
||||
{
|
||||
Datum outputIndex(index);
|
||||
PushOutput(outputIndex, *indexSlot);
|
||||
}
|
||||
|
||||
SignalOutput(GetSlotId("True"));
|
||||
return;
|
||||
}
|
||||
|
||||
SignalOutput(GetSlotId("False"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,10 +29,6 @@ namespace ScriptCanvas
|
||||
void OnInit() override;
|
||||
void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const override;
|
||||
|
||||
protected:
|
||||
|
||||
void OnInputSignal(const SlotId& slotId) override;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,20 +13,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
namespace String
|
||||
{
|
||||
void Format::OnInputSignal(const SlotId&)
|
||||
{
|
||||
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Format::OnInputSignal");
|
||||
|
||||
Datum output = Datum(ProcessFormat());
|
||||
|
||||
const SlotId outputTextSlotId = FormatProperty::GetStringSlotId(this);
|
||||
if (auto* slot = GetSlot(outputTextSlotId))
|
||||
{
|
||||
PushOutput(output, *slot);
|
||||
}
|
||||
|
||||
SignalOutput(GetSlotId("Out"));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,12 +23,8 @@ namespace ScriptCanvas
|
||||
class Format
|
||||
: public Internal::StringFormatted
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
SCRIPTCANVAS_NODE(Format);
|
||||
|
||||
void OnInputSignal(const SlotId& slotId) override;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Print.h"
|
||||
|
||||
#include <ScriptCanvas/Execution/RuntimeBus.h>
|
||||
#include <ScriptCanvas/Execution/ExecutionBus.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
namespace Nodes
|
||||
{
|
||||
namespace String
|
||||
{
|
||||
void Print::OnInputSignal([[maybe_unused]] const SlotId& slotId)
|
||||
{
|
||||
#if !defined(PERFORMANCE_BUILD) && !defined(_RELEASE)
|
||||
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Print::OnInputSignal");
|
||||
|
||||
AZStd::string text = ProcessFormat();
|
||||
|
||||
AZ_TracePrintf("Script Canvas", "%s\n", text.c_str());
|
||||
LogNotificationBus::Event(GetOwningScriptCanvasId(), &LogNotifications::LogMessage, text);
|
||||
|
||||
AZ::EntityId assetNodeId{};
|
||||
ScriptCanvas::RuntimeRequestBus::EventResult(assetNodeId, GetOwningScriptCanvasId(), &ScriptCanvas::RuntimeRequests::FindAssetNodeIdByRuntimeNodeId, GetEntityId());
|
||||
|
||||
SC_EXECUTION_TRACE_ANNOTATE_NODE((*this), (AnnotateNodeSignal(CreateGraphInfo(GetOwningScriptCanvasId(), GetGraphIdentifier()), AnnotateNodeSignal::AnnotationLevel::Info, text, AZ::NamedEntityId(assetNodeId, GetNodeName()))));
|
||||
#endif
|
||||
SignalOutput(GetSlotId("Out"));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <ScriptCanvas/Core/Node.h>
|
||||
|
||||
#include <ScriptCanvas/Internal/Nodes/StringFormatted.h>
|
||||
|
||||
#include <Include/ScriptCanvas/Libraries/String/Print.generated.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
@@ -23,12 +21,8 @@ namespace ScriptCanvas
|
||||
class Print
|
||||
: public Internal::StringFormatted
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
SCRIPTCANVAS_NODE(Print);
|
||||
|
||||
void OnInputSignal(const SlotId&) override;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,28 +51,6 @@ namespace ScriptCanvas
|
||||
}
|
||||
}
|
||||
|
||||
void Replace::OnInputSignal(const SlotId&)
|
||||
{
|
||||
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Replace::OnInputSignal");
|
||||
|
||||
AZStd::string sourceString = ReplaceProperty::GetSource(this);
|
||||
AZStd::string replaceString = ReplaceProperty::GetReplace(this);
|
||||
AZStd::string withString = ReplaceProperty::GetWith(this);
|
||||
|
||||
bool caseSensitive = ReplaceProperty::GetCaseSensitive(this);
|
||||
|
||||
AzFramework::StringFunc::Replace(sourceString, replaceString.c_str(), withString.c_str(), caseSensitive);
|
||||
|
||||
const SlotId outputResultSlotId = ReplaceProperty::GetResultSlotId(this);
|
||||
|
||||
ScriptCanvas::Datum output(sourceString);
|
||||
if (auto* outputSlot = GetSlot(outputResultSlotId))
|
||||
{
|
||||
PushOutput(output, *outputSlot);
|
||||
}
|
||||
|
||||
SignalOutput(GetSlotId("Out"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,11 +28,6 @@ namespace ScriptCanvas
|
||||
|
||||
void OnInit() override;
|
||||
void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const override;
|
||||
|
||||
protected:
|
||||
|
||||
void OnInputSignal(const SlotId& slotId) override;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,108 +31,15 @@ namespace ScriptCanvas
|
||||
}
|
||||
}
|
||||
|
||||
void StartsWith::OnInputSignal(const SlotId&)
|
||||
{
|
||||
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::StartsWith::OnInputSignal");
|
||||
|
||||
AZStd::string sourceString = StartsWithProperty::GetSource(this);
|
||||
AZStd::string patternString = StartsWithProperty::GetPattern(this);
|
||||
|
||||
bool caseSensitive = StartsWithProperty::GetCaseSensitive(this);
|
||||
|
||||
if (AzFramework::StringFunc::StartsWith(sourceString.c_str(), patternString.c_str(), caseSensitive))
|
||||
{
|
||||
SignalOutput(GetSlotId("True"));
|
||||
}
|
||||
else
|
||||
{
|
||||
SignalOutput(GetSlotId("False"));
|
||||
}
|
||||
}
|
||||
|
||||
void EndsWith::OnInputSignal(const SlotId&)
|
||||
{
|
||||
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::EndssWith::OnInputSignal");
|
||||
|
||||
AZStd::string sourceString = EndsWithProperty::GetSource(this);
|
||||
AZStd::string patternString = EndsWithProperty::GetPattern(this);
|
||||
|
||||
bool caseSensitive = EndsWithProperty::GetCaseSensitive(this);
|
||||
|
||||
if (AzFramework::StringFunc::EndsWith(sourceString.c_str(), patternString.c_str(), caseSensitive))
|
||||
{
|
||||
SignalOutput(GetSlotId("True"));
|
||||
}
|
||||
else
|
||||
{
|
||||
SignalOutput(GetSlotId("False"));
|
||||
}
|
||||
}
|
||||
|
||||
void Split::CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const
|
||||
{
|
||||
ReplaceStringUtilityNodeOutputSlot(this, replacementNode, outSlotIdMap);
|
||||
}
|
||||
|
||||
void Split::OnInputSignal(const SlotId&)
|
||||
{
|
||||
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Split::OnInputSignal");
|
||||
|
||||
AZStd::string sourceString = SplitProperty::GetSource(this);
|
||||
AZStd::string delimiterString = SplitProperty::GetDelimiters(this);
|
||||
|
||||
AZStd::vector<AZStd::string> stringArray;
|
||||
|
||||
AzFramework::StringFunc::Tokenize(sourceString.c_str(), stringArray, delimiterString.c_str(), false, false);
|
||||
|
||||
const SlotId outputResultSlotId = SplitProperty::GetStringArraySlotId(this);
|
||||
if (auto* outputSlot = GetSlot(outputResultSlotId))
|
||||
{
|
||||
ScriptCanvas::Datum output(ScriptCanvas::Data::FromAZType(azrtti_typeid<AZStd::vector<AZStd::string>>()), ScriptCanvas::Datum::eOriginality::Original, &stringArray, azrtti_typeid<AZStd::vector<AZStd::string>>());
|
||||
PushOutput(output, *outputSlot);
|
||||
}
|
||||
|
||||
SignalOutput(GetSlotId("Out"));
|
||||
}
|
||||
|
||||
void Join::CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map<SlotId, AZStd::vector<SlotId>>& outSlotIdMap) const
|
||||
{
|
||||
ReplaceStringUtilityNodeOutputSlot(this, replacementNode, outSlotIdMap);
|
||||
}
|
||||
|
||||
void Join::OnInputSignal(const SlotId&)
|
||||
{
|
||||
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Join::OnInputSignal");
|
||||
|
||||
AZStd::vector<AZStd::string> sourceArray = JoinProperty::GetStringArray(this);
|
||||
AZStd::string separatorString = JoinProperty::GetSeparator(this);
|
||||
|
||||
AZStd::string result;
|
||||
size_t index = 0;
|
||||
const size_t length = sourceArray.size();
|
||||
for (auto string : sourceArray)
|
||||
{
|
||||
if (index < length - 1)
|
||||
{
|
||||
result.append(AZStd::string::format("%s%s", string.c_str(), separatorString.c_str()));
|
||||
}
|
||||
else
|
||||
{
|
||||
result.append(string);
|
||||
}
|
||||
++index;
|
||||
}
|
||||
|
||||
const SlotId outputResultSlotId = JoinProperty::GetStringSlotId(this);
|
||||
if (auto* outputSlot = GetSlot(outputResultSlotId))
|
||||
{
|
||||
ScriptCanvas::Datum output(result);
|
||||
PushOutput(output, *outputSlot);
|
||||
}
|
||||
|
||||
SignalOutput(GetSlotId("Out"));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,11 +24,7 @@ namespace ScriptCanvas
|
||||
{
|
||||
public:
|
||||
SCRIPTCANVAS_NODE(StartsWith);
|
||||
protected:
|
||||
|
||||
void OnInputSignal(const SlotId& slotId) override;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
//! Deprecated: see class String's reflection of method "Ends With"
|
||||
class EndsWith
|
||||
@@ -36,10 +32,6 @@ namespace ScriptCanvas
|
||||
{
|
||||
public:
|
||||
SCRIPTCANVAS_NODE(EndsWith);
|
||||
protected:
|
||||
|
||||
void OnInputSignal(const SlotId& slotId) override;
|
||||
|
||||
};
|
||||
|
||||
//! Deprecated: see class String's reflection of method "Ends With"
|
||||
@@ -55,9 +47,6 @@ namespace ScriptCanvas
|
||||
protected:
|
||||
|
||||
static const char* k_defaultDelimiter;
|
||||
|
||||
void OnInputSignal(const SlotId& slotId) override;
|
||||
|
||||
};
|
||||
|
||||
//! Deprecated: see class String's reflection of method "Join"
|
||||
@@ -73,9 +62,6 @@ namespace ScriptCanvas
|
||||
protected:
|
||||
|
||||
static const char* k_defaultSeparator;
|
||||
|
||||
void OnInputSignal(const SlotId& slotId) override;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user