Initial commit

This commit is contained in:
alexpete
2021-03-05 11:26:34 -08:00
commit a10351f38d
27091 changed files with 5521199 additions and 0 deletions
@@ -0,0 +1,23 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
class QAction;
class QWidget;
namespace ScriptCanvasDeveloperEditor
{
namespace DynamicSlotFullCreation
{
QAction* CreateDynamicSlotFullCreationAction(QWidget* mainWindow);
};
}
@@ -0,0 +1,23 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
class QAction;
class QWidget;
namespace ScriptCanvasDeveloperEditor
{
namespace NodePaletteFullCreation
{
QAction* CreateNodePaletteFullCreationAction(QWidget* mainWindow);
};
}
@@ -0,0 +1,23 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
class QAction;
class QWidget;
namespace ScriptCanvasDeveloperEditor
{
namespace VariablePaletteFullCreation
{
QAction* CreateVariablePaletteFullCreationAction(QWidget* mainWindow);
};
}
@@ -0,0 +1,31 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <ScriptCanvas/Libraries/Libraries.h>
namespace ScriptCanvasDeveloper
{
namespace Libraries
{
struct Developer
: public ScriptCanvas::Library::LibraryDefinition
{
AZ_RTTI(Developer, "{2284A0BC-44A0-47A2-B67C-DF8862CF859B}", ScriptCanvas::Library::LibraryDefinition);
static void Reflect(AZ::ReflectContext*);
static void InitNodeRegistry(ScriptCanvas::NodeRegistry& nodeRegistry);
static AZStd::vector<AZ::ComponentDescriptor*> GetComponentDescriptors();
};
}
}
@@ -0,0 +1,54 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include "precompiled.h"
#include <GraphCanvas/Widgets/NodePalette/TreeItems/NodePaletteTreeItem.h>
#include <ScriptCanvas/Data/Data.h>
namespace ScriptCanvasDeveloperEditor
{
class AutomationInterface
{
public:
virtual void SetupInterface(const AZ::EntityId& activeGraphCanvasGraphId, const ScriptCanvas::ScriptCanvasId& activeScriptCanvasId) = 0;
};
class ProcessNodePaletteInterface
: public AutomationInterface
{
public:
virtual bool ShouldProcessItem(const GraphCanvas::NodePaletteTreeItem* nodePaletteTreeItem) const = 0;
virtual void ProcessItem(const GraphCanvas::NodePaletteTreeItem* nodePaletteTreeItem) = 0;
};
class ProcessVariablePaletteInterface
: public AutomationInterface
{
public:
virtual bool ShouldProcessVariableType(const ScriptCanvas::Data::Type& dataType) const = 0;
virtual void ProcessVariableType(const ScriptCanvas::Data::Type& dataType) = 0;
};
class DeveloperUtils
{
public:
static ScriptCanvasEditor::NodeIdPair HandleMimeEvent(GraphCanvas::GraphCanvasMimeEvent* mimeEvent, GraphCanvas::GraphId graphCanvasGraphId, const QRectF& viewportRectangle, int& widthOffset, int& heightOffset, int& maxRowHeight, AZ::Vector2 spacing);
static void UpdateViewportPositionOffsetForNode(GraphCanvas::NodeId nodeId, const QRectF& viewportRectangle, int& widthOffset, int& heightOffset, int& maxRowHeight, AZ::Vector2 spacing);
static void ProcessNodePalette(ProcessNodePaletteInterface& processNodePaletteInterface);
static void ProcessVariablePalette(ProcessVariablePaletteInterface& processVariablePaletteInterface);
};
}
@@ -0,0 +1,144 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <GraphCanvas/Components/Nodes/NodeBus.h>
#include <GraphCanvas/Components/SceneBus.h>
#include <ScriptCanvas/Core/Node.h>
#include <ScriptCanvas/Bus/EditorScriptCanvasBus.h>
#include <ScriptCanvasDeveloperEditor/MockBus.h>
namespace ScriptCanvasDeveloper
{
namespace Nodes
{
using namespace ScriptCanvas;
enum class SlotConfigState : AZ::u8
{
New,
Unmodified
};
class Mock;
struct SlotConfig
{
AZ_TYPE_INFO(SlotConfig, "{10B5DF2F-1105-4BDD-B8C0-24684AA4ECB3}");
AZ_CLASS_ALLOCATOR(SlotConfig, AZ::SystemAllocator, 0);
static void Reflect(AZ::ReflectContext* context);
AZ::Crc32 OnSlotNameChanged();
AZ::Crc32 OnSlotToolTipChanged();
void OnSlotDataTypeChanged(const Data::Type& dataType);
AZStd::vector<AZStd::pair<Data::Type, AZStd::string>> GetCreatableTypes();
SlotConfig();
~SlotConfig();
AZStd::string m_name;
AZStd::string m_toolTip;
Data::Type m_type;
SlotId m_slotId;
Mock* m_owner{};
SlotConfigState m_state = SlotConfigState::New;
};
struct MockNodeConfig
: public AZ::ComponentConfig
{
AZ_RTTI(MockNodeConfig, "{6FA19B08-186D-4308-BAE3-530367D902E0}");
AZ_CLASS_ALLOCATOR(MockNodeConfig, AZ::SystemAllocator, 0);
static AZ::TypeId GetComponentTypeId()
{
return AZ::TypeId("{91B3D89A-4A4B-49FF-AD91-CAAC49E141A8}");
}
AZ::EntityId m_uiEntityId;
};
class Mock
: public Node
, protected ScriptCanvasEditor::EditorNodeNotificationBus::Handler
, protected GraphCanvas::NodeNotificationBus::Handler
, protected GraphCanvas::SceneMemberNotificationBus::Handler
, protected MockDescriptorRequestBus::Handler
{
public:
AZ_COMPONENT(Mock, MockNodeConfig::GetComponentTypeId(), Node);
static void Reflect(AZ::ReflectContext* context);
Mock();
~Mock();
friend struct SlotConfig;
AZ::Crc32 OnNodeTitleChanged();
AZ::Crc32 OnNodeSubTitleChanged();
AZ::Crc32 OnNodeColorPaletteChanged();
AZ::Crc32 OnDataInSlotArrayChanged();
AZ::Crc32 OnDataOutSlotArrayChanged();
AZ::Crc32 OnExecutionInSlotArrayChanged();
AZ::Crc32 OnExecutionOutSlotArrayChanged();
//// GraphCanvas::NodeNotificationBus
void OnSlotAddedToNode(const AZ::EntityId& slotId) override;
void OnSlotRemovedFromNode(const AZ::EntityId& slotId) override;
void OnAddedToScene(const AZ::EntityId& sceneId) override;
////
// SceneMemberNotifications
void OnSceneMemberDeserialized(const GraphCanvas::GraphId& grpahId, const GraphCanvas::GraphSerialization& serialization) override;
////
// MockDescriptorRequestBus
AZ::EntityId GetGraphCanvasNodeId() const override { return m_graphCanvasNodeId; }
////
protected:
void OnInit() override;
void SetUiEntityId(AZ::EntityId uiEntityId);
void Clear();
AZStd::vector<AZStd::string> GetColorPaletteList() const;
virtual void OnClear();
virtual void OnNodeDisplayed(const GraphCanvas::NodeId& graphCanvasEntityId);
private:
//// ScriptCanvasEditor::EditorGraphNotificationBus
void OnGraphCanvasNodeDisplayed(AZ::EntityId graphCanvasEntityId);
////
AZStd::string m_nodeTitle;
AZStd::string m_nodeSubTitle;
AZStd::string m_nodeColorPaletteOverride;
AZStd::list<SlotConfig> m_dataInConfigArray;
AZStd::list<SlotConfig> m_dataOutConfigArray;
AZStd::list<SlotConfig> m_executionInConfigArray;
AZStd::list<SlotConfig> m_executionOutConfigArray;
AZ::EntityId m_graphCanvasNodeId;
AZStd::vector<AZ::EntityId> m_graphCanvasSlotIds;
///< Contains slotIds from deleted SlotConfigs that needs the slots removed from the Mock
AZStd::vector<SlotId> m_pendingConfigRemovals;
};
}
}
@@ -0,0 +1,42 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/EBus/EBus.h>
namespace ScriptCanvasDeveloper
{
namespace Nodes
{
class MockDescriptorRequests : public AZ::EBusTraits
{
public:
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
using BusIdType = AZ::EntityId;
virtual AZ::EntityId GetGraphCanvasNodeId() const = 0;
};
using MockDescriptorRequestBus = AZ::EBus<MockDescriptorRequests>;
class MockDescriptorNotifications : public AZ::EBusTraits
{
public:
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
using BusIdType = AZ::EntityId;
virtual void OnGraphCanvasNodeSetup(const AZ::EntityId& graphCanvasNodeId) = 0;
};
using MockDescriptorNotificationBus = AZ::EBus<MockDescriptorNotifications>;
}
}
@@ -0,0 +1,24 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
class QAction;
class QWidget;
namespace ScriptCanvasDeveloperEditor
{
namespace NodeListDumpAction
{
QAction* CreateNodeListDumpAction(QWidget* mainWindow);
};
}
@@ -0,0 +1,43 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <ScriptCanvas/Bus/ScriptCanvasBus.h>
namespace ScriptCanvasDeveloperEditor
{
class SystemComponent
: public AZ::Component
, private ScriptCanvasEditor::UINotificationBus::Handler
{
public:
AZ_COMPONENT(SystemComponent, "{5360A16B-1918-42B7-8769-D2EBD97CB1DB}");
SystemComponent() = default;
static void Reflect(AZ::ReflectContext* context);
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
// AZ::Component
void Init() override;
void Activate() override;
void Deactivate() override;
////
// ScriptCanvasEditor::UINotificationBus
void MainWindowCreationEvent(QWidget*) override;
};
}
@@ -0,0 +1,24 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
class QAction;
class QWidget;
namespace ScriptCanvasDeveloperEditor
{
namespace TSGenerateAction
{
QAction* SetupTSFileAction(QWidget* mainWindow);
};
}
@@ -0,0 +1,69 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <GraphCanvas/Components/SceneBus.h>
#include <ScriptCanvas/Bus/EditorScriptCanvasBus.h>
#include <Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h>
#include <Editor/Include/ScriptCanvas/GraphCanvas/NodeDescriptorBus.h>
#include <ScriptCanvasDeveloperEditor/Mock.h>
#include <ScriptCanvasDeveloperEditor/MockBus.h>
namespace ScriptCanvasDeveloper
{
namespace Nodes
{
using namespace ScriptCanvas;
class WrapperMock
: public Mock
, public ScriptCanvasEditor::ScriptCanvasWrapperNodeDescriptorRequestBus::Handler
, public MockDescriptorNotificationBus::MultiHandler
, public GraphCanvas::SceneNotificationBus::Handler
{
public:
AZ_COMPONENT(WrapperMock, "{14C6CE68-906A-4D2F-89BA-153774CE8015}", Mock);
static void Reflect(AZ::ReflectContext* context);
WrapperMock();
~WrapperMock() = default;
// ScriptCanvasWrapperNodeDescriptorRequestBus
void OnWrapperAction(const QRect& actionWidgetBoundingRect, const QPointF& scenePoint, const QPoint& screenPoint) override;
////
// MockDescriptorNotificationBus
void OnGraphCanvasNodeSetup(const GraphCanvas::NodeId& graphCanvasNodeId) override;
////
// GraphCanvas::NodeNotificationBus
void OnNodeRemoved(const GraphCanvas::NodeId& nodeId) override;
////
protected:
void OnActionNameChanged();
void OnClear();
void OnNodeDisplayed(const GraphCanvas::NodeId& graphCanvasNodeId) override;
private:
AZStd::string m_actionName;
AZStd::vector< AZ::EntityId > m_wrappedNodeIds;
AZStd::unordered_map< GraphCanvas::NodeId, AZ::EntityId > m_graphCanvasMapping;
};
}
}