source file save-as

Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
chcurran
2021-11-08 14:39:20 -08:00
parent a334ce09b4
commit 98ecef2fd2
@@ -1764,7 +1764,7 @@ namespace ScriptCanvasEditor
AZStd::string suggestedFilename;
AZStd::string suggestedFileFilter;
bool isValidFileName = false;
if (save == Save::InPlace)
{
isValidFileName = true;
@@ -1773,7 +1773,17 @@ namespace ScriptCanvasEditor
}
else
{
GetSuggestedFullFilenameToSaveAs(inMemoryAssetId, suggestedFilename, suggestedFileFilter);
// replaces GetSuggestedFullFilenameToSaveAs
suggestedFileFilter = ScriptCanvasAssetDescription().GetExtensionImpl();
if (inMemoryAssetId.Path().empty())
{
suggestedFilename = ScriptCanvasAssetDescription().GetSuggestedSavePathImpl();
}
else
{
suggestedFilename = inMemoryAssetId.Path();
}
}
EnsureSaveDestinationDirectory(suggestedFilename);
@@ -1788,7 +1798,14 @@ namespace ScriptCanvasEditor
// So we want to break out.
if (!selectedFile.isEmpty())
{
ScriptCanvasAssetDescription assetDescription;
AZStd::string filePath = selectedFile.toUtf8().data();
if (!AZ::StringFunc::EndsWith(filePath, assetDescription.GetExtensionImpl(), false))
{
filePath += assetDescription.GetExtensionImpl();
}
AZStd::string fileName;
// Verify that the path is within the project