editor sc component switched over to source handle, not yet connected to file notifications
Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <AzCore/Component/ComponentApplicationBus.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
#include <AzCore/RTTI/AttributeReader.h>
|
||||
@@ -14,9 +15,8 @@
|
||||
#include <AzCore/StringFunc/StringFunc.h>
|
||||
#include <Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h>
|
||||
|
||||
#include "Core.h"
|
||||
#include "Attributes.h"
|
||||
|
||||
#include "Core.h"
|
||||
#include <Core/Graph.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
@@ -238,6 +238,11 @@ namespace ScriptCanvasEditor
|
||||
return m_data != nullptr;
|
||||
}
|
||||
|
||||
bool SourceHandle::IsValidDescription() const
|
||||
{
|
||||
return !m_id.IsNull() && !m_path.empty();
|
||||
}
|
||||
|
||||
GraphPtr SourceHandle::Mod() const
|
||||
{
|
||||
return m_data ? m_data->ModEditorGraph() : nullptr;
|
||||
@@ -265,6 +270,30 @@ namespace ScriptCanvasEditor
|
||||
return m_path == other.m_path;
|
||||
}
|
||||
|
||||
void SourceHandle::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
|
||||
{
|
||||
serializeContext->Class<SourceHandle>()
|
||||
->Version(0)
|
||||
->Field("id", &SourceHandle::m_id)
|
||||
->Field("path", &SourceHandle::m_path)
|
||||
;
|
||||
|
||||
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
|
||||
{
|
||||
editContext->Class<SourceHandle>("Script Canvas Source Handle", "References a source editor file")
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->Attribute(AZ::Edit::Attributes::Category, "Scripting")
|
||||
->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/ScriptCanvas.svg")
|
||||
->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/ScriptCanvas/Viewport/ScriptCanvas.svg")
|
||||
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &SourceHandle::m_path);
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AZStd::string SourceHandle::ToString() const
|
||||
{
|
||||
return AZStd::string::format
|
||||
|
||||
@@ -325,6 +325,8 @@ namespace ScriptCanvasEditor
|
||||
AZ_TYPE_INFO(SourceHandle, "{65855A98-AE2F-427F-BFC8-69D45265E312}");
|
||||
AZ_CLASS_ALLOCATOR(SourceHandle, AZ::SystemAllocator, 0);
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
SourceHandle() = default;
|
||||
|
||||
SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path);
|
||||
@@ -344,6 +346,8 @@ namespace ScriptCanvasEditor
|
||||
|
||||
bool IsValid() const;
|
||||
|
||||
bool IsValidDescription() const;
|
||||
|
||||
GraphPtr Mod() const;
|
||||
|
||||
bool operator==(const SourceHandle& other) const;
|
||||
@@ -372,8 +376,8 @@ namespace ScriptCanvas
|
||||
|
||||
AZ_RTTI(ScriptCanvasData, "{1072E894-0C67-4091-8B64-F7DB324AD13C}");
|
||||
AZ_CLASS_ALLOCATOR(ScriptCanvasData, AZ::SystemAllocator, 0);
|
||||
ScriptCanvasData() {}
|
||||
virtual ~ScriptCanvasData() {}
|
||||
ScriptCanvasData() = default;
|
||||
virtual ~ScriptCanvasData() = default;
|
||||
ScriptCanvasData(ScriptCanvasData&& other);
|
||||
ScriptCanvasData& operator=(ScriptCanvasData&& other);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user