fixed unit tests bugs, removed commented out code, removed loading spam
Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
@@ -82,31 +82,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
void ScriptCanvasAssetHolder::OpenEditor() const
|
||||
{
|
||||
// #sc_editor_asset
|
||||
// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas);
|
||||
//
|
||||
// AZ::Outcome<int, AZStd::string> openOutcome = AZ::Failure(AZStd::string());
|
||||
//
|
||||
// if (m_scriptCanvasAsset.IsReady())
|
||||
// {
|
||||
// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_scriptCanvasAsset.GetId(), -1);
|
||||
//
|
||||
// if (!openOutcome)
|
||||
// {
|
||||
// AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data());
|
||||
// }
|
||||
// }
|
||||
// else if (m_ownerId.first.IsValid())
|
||||
// {
|
||||
// AzToolsFramework::EntityIdList selectedEntityIds;
|
||||
// AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities);
|
||||
//
|
||||
// // Going to bypass the multiple selected entities flow for right now.
|
||||
// if (selectedEntityIds.size() == 1)
|
||||
// {
|
||||
// GeneralRequestBus::Broadcast(&GeneralRequests::CreateScriptCanvasAssetFor, m_ownerId);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
ScriptCanvas::ScriptCanvasId ScriptCanvasAssetHolder::GetScriptCanvasId() const
|
||||
|
||||
@@ -60,109 +60,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
void AssetTracker::SaveAs(AZ::Data::AssetId /*assetId*/, const AZStd::string& /*path*/, Callbacks::OnSave /*onSaveCallback*/)
|
||||
{
|
||||
// auto assetIter = m_assetsInUse.find(assetId);
|
||||
//
|
||||
// if (assetIter != m_assetsInUse.end())
|
||||
// {
|
||||
// auto onSave = [this, assetId, onSaveCallback](bool saveSuccess, AZ::Data::AssetPtr asset, AZ::Data::AssetId previousFileAssetId)
|
||||
// {
|
||||
// AZ::Data::AssetId signalId = assetId;
|
||||
// AZ::Data::AssetId fileAssetId = asset->GetId();
|
||||
//
|
||||
// // If there is a previous file Id is valid, it means this is a save-as operation and we need to remap the tracking.
|
||||
// if (previousFileAssetId.IsValid())
|
||||
// {
|
||||
// if (saveSuccess)
|
||||
// {
|
||||
// fileAssetId = m_assetsInUse[assetId]->GetFileAssetId();
|
||||
// m_remappedAsset[asset->GetId()] = fileAssetId;
|
||||
//
|
||||
// // Erase the asset first so the smart pointer can deal with it's things.
|
||||
// m_assetsInUse.erase(fileAssetId);
|
||||
//
|
||||
// // Then perform the insert once we know nothing will attempt to delete this while we are operating on it.
|
||||
// m_assetsInUse[fileAssetId] = m_assetsInUse[assetId];
|
||||
// m_assetsInUse.erase(assetId);
|
||||
// }
|
||||
//
|
||||
// m_savingAssets.erase(assetId);
|
||||
// m_savingAssets.insert(fileAssetId);
|
||||
//
|
||||
// signalId = fileAssetId;
|
||||
//
|
||||
// if (m_queuedCloses.erase(assetId))
|
||||
// {
|
||||
// m_queuedCloses.insert(fileAssetId);
|
||||
// }
|
||||
//
|
||||
// auto assetIter = m_assetsInUse.find(fileAssetId);
|
||||
//
|
||||
// if (assetIter != m_assetsInUse.end())
|
||||
// {
|
||||
// AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[fileAssetId]->GetAsset().Get(), previousFileAssetId);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// AZ_Error("ScriptCanvas", !saveSuccess, "Unable to find Memory Asset for Asset(%s)", fileAssetId.ToString<AZStd::string>().c_str());
|
||||
// AZStd::invoke(onSaveCallback, saveSuccess, asset, previousFileAssetId);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (saveSuccess)
|
||||
// {
|
||||
// // This should be the case when we get a save as from a newly created file.
|
||||
// //
|
||||
// // If we find the 'memory' asset id in the assets in use. This means this was a new file that was saved.
|
||||
// // To maintain all of the look-up stuff, we need to treat this like a remapping stage.
|
||||
// auto assetInUseIter = m_assetsInUse.find(assetId);
|
||||
// if (assetInUseIter != m_assetsInUse.end())
|
||||
// {
|
||||
// fileAssetId = assetInUseIter->second->GetFileAssetId();
|
||||
//
|
||||
// if (assetId != fileAssetId)
|
||||
// {
|
||||
// m_remappedAsset[assetId] = fileAssetId;
|
||||
//
|
||||
// m_assetsInUse.erase(fileAssetId);
|
||||
// m_assetsInUse[fileAssetId] = AZStd::move(assetInUseIter->second);
|
||||
// m_assetsInUse.erase(assetId);
|
||||
//
|
||||
// m_savingAssets.erase(assetId);
|
||||
// m_savingAssets.insert(fileAssetId);
|
||||
//
|
||||
// if (m_queuedCloses.erase(assetId))
|
||||
// {
|
||||
// m_queuedCloses.insert(fileAssetId);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// fileAssetId = CheckAssetId(fileAssetId);
|
||||
// }
|
||||
//
|
||||
// signalId = fileAssetId;
|
||||
// }
|
||||
//
|
||||
// if (onSaveCallback)
|
||||
// {
|
||||
// AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[signalId]->GetAsset().Get(), previousFileAssetId);
|
||||
// }
|
||||
//
|
||||
// AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetSaved, m_assetsInUse[signalId], saveSuccess);
|
||||
// }
|
||||
//
|
||||
// SignalSaveComplete(signalId);
|
||||
// };
|
||||
//
|
||||
// m_savingAssets.insert(assetId);
|
||||
// assetIter->second->SaveAs(path, onSave);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// AZ_Assert(false, "Cannot SaveAs into an existing AssetId");
|
||||
// }
|
||||
}
|
||||
|
||||
bool AssetTracker::Load(AZ::Data::AssetId fileAssetId, AZ::Data::AssetType assetType, Callbacks::OnAssetReadyCallback onAssetReadyCallback)
|
||||
|
||||
@@ -23,9 +23,6 @@ namespace ScriptCanvasEditor
|
||||
{
|
||||
class ScriptCanvasMemoryAsset;
|
||||
|
||||
|
||||
// MOVE THIS MOSTLY TO TAB BAR, MAIN WINDOW AND THE CANVAS WIDGET
|
||||
|
||||
// This class tracks all things related to the assets that the Script Canvas editor
|
||||
// has in play. It also provides helper functionality to quickly getting asset information
|
||||
// from GraphCanvas
|
||||
|
||||
@@ -155,17 +155,5 @@ namespace ScriptCanvasEditor
|
||||
using MemoryAssetSystemNotificationBus = AZ::EBus<MemoryAssetSystemNotifications>;
|
||||
}
|
||||
|
||||
class MemoryAssetNotifications
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
|
||||
using BusIdType = AZ::Data::AssetId;
|
||||
|
||||
virtual void OnFileStateChanged(Tracker::ScriptCanvasFileState) {}
|
||||
};
|
||||
|
||||
using MemoryAssetNotificationBus = AZ::EBus<MemoryAssetNotifications>;
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
@@ -285,8 +285,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
ScriptCanvasEditor::Widget::CanvasWidget* ScriptCanvasMemoryAsset::CreateView(QWidget* /*parent*/)
|
||||
{
|
||||
//m_canvasWidget = new Widget::CanvasWidget(m_fileAssetId, parent);
|
||||
//return m_canvasWidget;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -433,66 +431,11 @@ namespace ScriptCanvasEditor
|
||||
|
||||
void ScriptCanvasMemoryAsset::SourceFileFailed(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid)
|
||||
{
|
||||
// AZStd::string fullPath;
|
||||
// AzFramework::StringFunc::Path::Join(scanFolder.data(), relativePath.data(), fullPath);
|
||||
// AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, fullPath);
|
||||
//
|
||||
// auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), fullPath);
|
||||
//
|
||||
// if (assetPathIdIt != m_pendingSave.end())
|
||||
// {
|
||||
// if (m_onSaveCallback)
|
||||
// {
|
||||
// m_onSaveCallback(false, m_inMemoryAsset.Get(), AZ::Data::AssetId());
|
||||
// m_onSaveCallback = nullptr;
|
||||
// }
|
||||
//
|
||||
// m_pendingSave.erase(assetPathIdIt);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
void ScriptCanvasMemoryAsset::SavingComplete(const AZStd::string& /*streamName*/, AZ::Uuid /*sourceAssetId*/)
|
||||
{
|
||||
// AZStd::string normPath = streamName;
|
||||
// AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, normPath);
|
||||
//
|
||||
// auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), normPath);
|
||||
// if (assetPathIdIt != m_pendingSave.end())
|
||||
// {
|
||||
// AZ::Data::AssetId previousFileAssetId;
|
||||
//
|
||||
// if (sourceAssetId != m_fileAssetId.m_guid)
|
||||
// {
|
||||
// previousFileAssetId = m_fileAssetId;
|
||||
//
|
||||
// // The source file has changed, store the AssetId to the canonical asset on file
|
||||
// SetFileAssetId(sourceAssetId);
|
||||
//
|
||||
// }
|
||||
// else if (!m_fileAssetId.IsValid())
|
||||
// {
|
||||
// SetFileAssetId(sourceAssetId);
|
||||
// }
|
||||
//
|
||||
// m_formerGraphIdPair = AZStd::make_pair(m_scriptCanvasId, m_graphId);
|
||||
//
|
||||
// m_fileState = Tracker::ScriptCanvasFileState::UNMODIFIED;
|
||||
//
|
||||
// m_pendingSave.erase(assetPathIdIt);
|
||||
//
|
||||
// m_absolutePath = m_saveAsPath;
|
||||
// m_saveAsPath.clear();
|
||||
//
|
||||
// // Connect to the source asset's bus to monitor for situations we may need to handle
|
||||
// AZ::Data::AssetBus::MultiHandler::BusConnect(m_inMemoryAsset.GetId());
|
||||
// AZ::Data::AssetBus::MultiHandler::BusConnect(m_fileAssetId);
|
||||
//
|
||||
// if (m_onSaveCallback)
|
||||
// {
|
||||
// m_onSaveCallback(true, m_inMemoryAsset.Get(), previousFileAssetId);
|
||||
// m_onSaveCallback = nullptr;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
void ScriptCanvasMemoryAsset::FinalizeAssetSave(bool, const AzToolsFramework::SourceControlFileInfo& fileInfo, const AZ::Data::AssetStreamInfo& saveInfo, Callbacks::OnSave onSaveCallback)
|
||||
@@ -528,17 +471,11 @@ namespace ScriptCanvasEditor
|
||||
|
||||
void ScriptCanvasMemoryAsset::SetFileAssetId(const AZ::Data::AssetId& /*fileAssetId*/)
|
||||
{
|
||||
// m_fileAssetId = fileAssetId;
|
||||
//
|
||||
// if (m_canvasWidget)
|
||||
// {
|
||||
// m_canvasWidget->SetAssetId(fileAssetId);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
void ScriptCanvasMemoryAsset::SignalFileStateChanged()
|
||||
{
|
||||
MemoryAssetNotificationBus::Event(m_fileAssetId, &MemoryAssetNotifications::OnFileStateChanged, GetFileState());
|
||||
}
|
||||
|
||||
AZStd::string ScriptCanvasMemoryAsset::MakeTemporaryFilePathForSave(AZStd::string_view targetFilename)
|
||||
@@ -607,25 +544,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
bool AssetSaveFinalizer::ValidateStatus(const AzToolsFramework::SourceControlFileInfo& /*fileInfo*/)
|
||||
{
|
||||
// auto fileIO = AZ::IO::FileIOBase::GetInstance();
|
||||
// if (fileInfo.IsLockedByOther())
|
||||
// {
|
||||
// AZ_Error("Script Canvas", !fileInfo.IsLockedByOther(), "The file is already exclusively opened by another user: %s", fileInfo.m_filePath.data());
|
||||
// AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId);
|
||||
// return false;
|
||||
// }
|
||||
// else if (fileInfo.IsReadOnly() && fileIO->Exists(fileInfo.m_filePath.c_str()))
|
||||
// {
|
||||
// AZ_Error("Script Canvas", !fileInfo.IsReadOnly(), "File %s is read-only. It cannot be saved."
|
||||
// " If this file is in Perforce it may not have been checked out by the Source Control API.", fileInfo.m_filePath.data());
|
||||
// AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId);
|
||||
// return false;
|
||||
// }
|
||||
// else if (m_saving)
|
||||
// {
|
||||
// AZ_Warning("Script Canvas", false, "Trying to save the same file twice. Will result in one save callback being ignored.");
|
||||
// return false;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,8 +51,6 @@ namespace ScriptCanvasEditor
|
||||
{
|
||||
static bool EditorScriptCanvasComponentVersionConverter(AZ::SerializeContext& serializeContext, AZ::SerializeContext::DataElementNode& rootElement)
|
||||
{
|
||||
AZ_TracePrintf("ScriptCanvas", "EditorScriptCanvasComponentVersionConverter called!");
|
||||
|
||||
if (rootElement.GetVersion() <= 4)
|
||||
{
|
||||
int assetElementIndex = rootElement.FindElement(AZ::Crc32("m_asset"));
|
||||
|
||||
@@ -54,11 +54,7 @@ namespace ScriptCanvasEditor
|
||||
|
||||
if (assetSystem->GetSourceInfoBySourcePath(fullPathHandle.Path().c_str(), assetInfo, watchFolder) && assetInfo.m_assetId.IsValid())
|
||||
{
|
||||
if (assetInfo.m_assetId.m_guid != source.Id())
|
||||
{
|
||||
AZ_TracePrintf("ScriptCanvas", "This is what I don't get");
|
||||
}
|
||||
|
||||
AZ_Warning("ScriptCanvas", assetInfo.m_assetId.m_guid == source.Id(), "SourceHandle completion produced conflicting AssetId.");
|
||||
auto path = fullPathHandle.Path();
|
||||
return SourceHandle(source, assetInfo.m_assetId.m_guid, path.MakePreferred());
|
||||
}
|
||||
|
||||
@@ -163,13 +163,13 @@ namespace ScriptCanvasEditor
|
||||
{
|
||||
ScopedOutputSuppression([[maybe_unused]] bool suppressState = true)
|
||||
{
|
||||
// AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", "");
|
||||
// TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState);
|
||||
AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", "");
|
||||
TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState);
|
||||
}
|
||||
|
||||
~ScopedOutputSuppression()
|
||||
{
|
||||
// TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression);
|
||||
TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression);
|
||||
}
|
||||
private:
|
||||
bool m_oldSuppression = false;
|
||||
|
||||
@@ -54,7 +54,6 @@ namespace ScriptCanvasEditor
|
||||
NEW,
|
||||
MODIFIED,
|
||||
UNMODIFIED,
|
||||
// #sc_editor_asset restore this
|
||||
SOURCE_REMOVED,
|
||||
INVALID = -1
|
||||
};
|
||||
|
||||
@@ -140,10 +140,6 @@ namespace ScriptCanvasEditor
|
||||
void ReleaseVariableCounter(AZ::u32 variableCounter) override;
|
||||
////
|
||||
|
||||
// RuntimeBus
|
||||
//AZ::Data::AssetId GetAssetId() const override { return m_assetId; }
|
||||
////
|
||||
|
||||
// GraphCanvas::GraphModelRequestBus
|
||||
void RequestUndoPoint() override;
|
||||
|
||||
@@ -223,9 +219,6 @@ namespace ScriptCanvasEditor
|
||||
void OnGraphCanvasNodeCreated(const AZ::EntityId& nodeId) override;
|
||||
///////////////////////////
|
||||
|
||||
// EditorGraphRequestBus
|
||||
// void SetAssetId(const AZ::Data::AssetId& assetId) override { m_assetId = assetId; }
|
||||
|
||||
void CreateGraphCanvasScene() override;
|
||||
void ClearGraphCanvasScene() override;
|
||||
void DisplayGraphCanvasScene() override;
|
||||
|
||||
@@ -251,16 +251,6 @@ namespace ScriptCanvasEditor
|
||||
{
|
||||
if (index >= 0 && index < count())
|
||||
{
|
||||
QVariant tabdata = tabData(index);
|
||||
if (tabdata.isValid())
|
||||
{
|
||||
// #sc_editor_asset fix tabData
|
||||
auto tabAssetId = tabdata.value<GraphTabMetadata>();
|
||||
|
||||
//MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId);
|
||||
//AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::ClearView, tabAssetId);
|
||||
}
|
||||
|
||||
qobject_cast<AzQtComponents::TabWidget*>(parent())->removeTab(index);
|
||||
}
|
||||
}
|
||||
@@ -271,8 +261,6 @@ namespace ScriptCanvasEditor
|
||||
{
|
||||
Q_EMIT TabCloseNoButton(i);
|
||||
}
|
||||
|
||||
MemoryAssetNotificationBus::MultiHandler::BusDisconnect();
|
||||
}
|
||||
|
||||
void GraphTabBar::OnContextMenu(const QPoint& point)
|
||||
@@ -289,8 +277,6 @@ namespace ScriptCanvasEditor
|
||||
auto tabAssetId = tabdata.value<GraphTabMetadata>();
|
||||
|
||||
Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID;
|
||||
//AssetTrackerRequestBus::BroadcastResult(fileState , &AssetTrackerRequests::GetFileState, tabAssetId);
|
||||
|
||||
isModified = fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::MODIFIED;
|
||||
}
|
||||
|
||||
@@ -362,22 +348,6 @@ namespace ScriptCanvasEditor
|
||||
AzQtComponents::TabBar::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
void GraphTabBar::OnFileStateChanged(Tracker::ScriptCanvasFileState )
|
||||
{
|
||||
// #sc_editor_asset
|
||||
// const AZ::Data::AssetId* fileAssetId = MemoryAssetNotificationBus::GetCurrentBusId();
|
||||
|
||||
// if (fileAssetId)
|
||||
// {
|
||||
// SetFileState((*fileAssetId), fileState);
|
||||
//
|
||||
// if (FindTab((*fileAssetId)) == currentIndex())
|
||||
// {
|
||||
// Q_EMIT OnActiveFileStateChanged();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
void GraphTabBar::SetTabText(int tabIndex, const QString& path, Tracker::ScriptCanvasFileState fileState)
|
||||
{
|
||||
if (tabIndex >= 0 && tabIndex < count())
|
||||
|
||||
@@ -42,7 +42,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
class GraphTabBar
|
||||
: public AzQtComponents::TabBar
|
||||
, public MemoryAssetNotificationBus::MultiHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -63,8 +62,6 @@ namespace ScriptCanvasEditor
|
||||
int InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId, Tracker::ScriptCanvasFileState fileState);
|
||||
bool SelectTab(ScriptCanvasEditor::SourceHandle assetId);
|
||||
|
||||
// void ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName);
|
||||
|
||||
int FindTab(ScriptCanvasEditor::SourceHandle assetId) const;
|
||||
ScriptCanvasEditor::SourceHandle FindTabByPath(AZStd::string_view path) const;
|
||||
ScriptCanvasEditor::SourceHandle FindAssetId(int tabIndex);
|
||||
@@ -78,10 +75,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
|
||||
// MemoryAssetNotifications
|
||||
void OnFileStateChanged(Tracker::ScriptCanvasFileState fileState) override;
|
||||
////
|
||||
|
||||
// Updates the tab at the supplied index with the GraphTabMetadata
|
||||
// The host widget field of the tabMetadata is not used and will not overwrite the tab data
|
||||
void SetTabText(int tabIndex, const QString& path, Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID);
|
||||
|
||||
@@ -137,17 +137,6 @@ namespace ScriptCanvasEditor
|
||||
m_additionTimer.start();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_updatePolicy == UpdatePolicy::SingleTime)
|
||||
{
|
||||
// #sc_editor_asset
|
||||
// treeItem = CreateChildNodeWithoutAddSignal<ExecutionLogTreeItem>(loggingDataId, nodeType, graphInfo, nodeId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// #sc_editor_asset
|
||||
// treeItem = CreateChildNode<ExecutionLogTreeItem>(loggingDataId, nodeType, graphInfo, nodeId);
|
||||
}
|
||||
|
||||
return treeItem;
|
||||
}
|
||||
@@ -207,9 +196,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
AZ::NamedEntityId entityName;
|
||||
|
||||
// #sc_editor_asset restore this
|
||||
//LoggingDataRequestBus::EventResult(entityName, m_loggingDataId, &LoggingDataRequests::FindNamedEntityId, m_graphInfo.m_runtimeEntity);
|
||||
|
||||
m_sourceEntityName = entityName.ToString().c_str();
|
||||
m_displayName = nodeId.m_name.c_str();
|
||||
|
||||
@@ -514,7 +500,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
const ScriptCanvas::GraphIdentifier& ExecutionLogTreeItem::GetGraphIdentifier() const
|
||||
{
|
||||
// #sc_editor_asset
|
||||
return m_graphIdentifier;
|
||||
}
|
||||
|
||||
|
||||
@@ -1665,42 +1665,6 @@ namespace ScriptCanvasEditor
|
||||
return SaveAssetImpl(m_activeGraph, Save::As);
|
||||
}
|
||||
|
||||
/*
|
||||
bool MainWindow::SaveAssetImpl_OLD(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB)
|
||||
{
|
||||
if (!assetId.IsValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Set graph read-only to prevent edits during save
|
||||
|
||||
bool saveSuccessful = false;
|
||||
|
||||
Tracker::ScriptCanvasFileState fileState = GetAssetFileState(assetId);
|
||||
|
||||
if (fileState == Tracker::ScriptCanvasFileState::NEW)
|
||||
{
|
||||
saveSuccessful = SaveAssetImpl(assetId, saveCB);
|
||||
}
|
||||
else if (fileState == Tracker::ScriptCanvasFileState::MODIFIED
|
||||
|| fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED)
|
||||
{
|
||||
SaveAs(assetId.Path(), assetId, saveCB);
|
||||
saveSuccessful = true;
|
||||
}
|
||||
|
||||
return saveSuccessful;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// 1. SaveAssetImpl
|
||||
// 2. SaveAs
|
||||
// // 3. OnSaveCallback
|
||||
// SaveAsEnd
|
||||
// SaveAssetImpl end
|
||||
|
||||
bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, Save save)
|
||||
{
|
||||
if (!inMemoryAssetId.IsGraphValid())
|
||||
@@ -1768,11 +1732,6 @@ namespace ScriptCanvasEditor
|
||||
AZ::IO::FileIOBase::GetInstance()->ResolvePath("@engroot@", assetRootChar.data(), assetRootChar.size());
|
||||
assetRoot = assetRootChar.data();
|
||||
|
||||
// if (!AZ::StringFunc::StartsWith(filePath, assetRoot))
|
||||
// {
|
||||
// QMessageBox::information(this, "Unable to Save", AZStd::string::format("You must select a path within the current project\n\n%s", assetRoot.c_str()).c_str());
|
||||
// }
|
||||
// else
|
||||
if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName))
|
||||
{
|
||||
isValidFileName = !(fileName.empty());
|
||||
@@ -1924,14 +1883,6 @@ namespace ScriptCanvasEditor
|
||||
{
|
||||
m_tabBar->setCurrentIndex(saveTabIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
// // Something weird happens with our saving. Where we are relying on these scene changes being called.
|
||||
// ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph;
|
||||
//
|
||||
// OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle());
|
||||
// OnChangeActiveGraphTab(previousAssetId);
|
||||
}
|
||||
|
||||
UpdateAssignToSelectionState();
|
||||
|
||||
@@ -2365,6 +2316,7 @@ namespace ScriptCanvasEditor
|
||||
GraphCanvas::ViewRequestBus::Event(viewId, &GraphCanvas::ViewRequests::CenterOnEndOfChain);
|
||||
}
|
||||
|
||||
// #sc_editor_asset
|
||||
void MainWindow::UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& /*memoryAsset*/)
|
||||
{
|
||||
// only occurs on file open, do it there, if necessary
|
||||
@@ -2656,16 +2608,6 @@ namespace ScriptCanvasEditor
|
||||
void MainWindow::Clear()
|
||||
{
|
||||
m_tabBar->CloseAllTabs();
|
||||
// #sc_editor_asset
|
||||
//
|
||||
// AssetTrackerRequests::AssetList assets;
|
||||
// AssetTrackerRequestBus::BroadcastResult(assets, &AssetTrackerRequests::GetAssets);
|
||||
//
|
||||
// for (auto asset : assets)
|
||||
// {
|
||||
// RemoveScriptCanvasAsset(asset->GetAsset().GetId());
|
||||
// }
|
||||
|
||||
SetActiveAsset({});
|
||||
}
|
||||
|
||||
@@ -4093,32 +4035,6 @@ namespace ScriptCanvasEditor
|
||||
|
||||
void MainWindow::PrepareAssetForSave(const ScriptCanvasEditor::SourceHandle& /*assetId*/)
|
||||
{
|
||||
/*
|
||||
ScriptCanvasMemoryAsset::pointer memoryAsset;
|
||||
AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId);
|
||||
|
||||
if (memoryAsset)
|
||||
{
|
||||
AZ::EntityId graphId = memoryAsset->GetGraphId();
|
||||
AZ::EntityId scriptCanvasId = memoryAsset->GetScriptCanvasId();
|
||||
|
||||
AZ::Entity* entity = nullptr;
|
||||
GraphRequestBus::EventResult(entity, scriptCanvasId, &GraphRequests::GetGraphEntity);
|
||||
|
||||
if (entity)
|
||||
{
|
||||
GraphCanvas::GraphModelRequestBus::Event(graphId, &GraphCanvas::GraphModelRequests::OnSaveDataDirtied, entity->GetId());
|
||||
}
|
||||
|
||||
GraphCanvas::GraphModelRequestBus::Event(graphId, &GraphCanvas::GraphModelRequests::OnSaveDataDirtied, graphId);
|
||||
|
||||
ScriptCanvasEditor::Graph* graph = AZ::EntityUtils::FindFirstDerivedComponent<ScriptCanvasEditor::Graph>(entity);
|
||||
if (graph)
|
||||
{
|
||||
graph->MarkVersion();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void MainWindow::RestartAutoTimerSave(bool forceTimer)
|
||||
|
||||
@@ -323,13 +323,7 @@ namespace ScriptCanvasEditor
|
||||
|
||||
m_view->tableWidget->setCellWidget(rowIndex, static_cast<int>(ColumnAction), upgradeButton);
|
||||
}
|
||||
|
||||
char resolvedBuffer[AZ_MAX_PATH_LEN] = { 0 };
|
||||
AZStd::string path = AZStd::string::format("@devroot@/%s", assetInfo.Path().c_str());
|
||||
AZ::IO::FileIOBase::GetInstance()->ResolvePath(path.c_str(), resolvedBuffer, AZ_MAX_PATH_LEN);
|
||||
AZ::StringFunc::Path::GetFullPath(resolvedBuffer, path);
|
||||
AZ::StringFunc::Path::Normalize(path);
|
||||
|
||||
|
||||
bool result = false;
|
||||
AZ::Data::AssetInfo info;
|
||||
AZStd::string watchFolder;
|
||||
|
||||
Reference in New Issue
Block a user