Minor tweaks

This commit is contained in:
Wojtek Figat
2023-08-01 14:14:27 +02:00
parent 869649e5ed
commit 8dc98174cf
9 changed files with 2 additions and 25 deletions

View File

@@ -368,7 +368,6 @@ namespace FlaxEditor.Content.Thumbnails
// Create atlas
if (PreviewsCache.Create(path))
{
// Error
Editor.LogError("Failed to create thumbnails atlas.");
return null;
}
@@ -377,7 +376,6 @@ namespace FlaxEditor.Content.Thumbnails
var atlas = FlaxEngine.Content.LoadAsync<PreviewsCache>(path);
if (atlas == null)
{
// Error
Editor.LogError("Failed to load thumbnails atlas.");
return null;
}

View File

@@ -795,7 +795,6 @@ namespace FlaxEditor
{
if (projectFilePath == null || !File.Exists(projectFilePath))
{
// Error
MessageBox.Show("Missing project");
return;
}

View File

@@ -373,7 +373,6 @@ namespace FlaxEditor.Modules
// Note: we use content backend because file may be in use or sth, it's safe
if (FlaxEngine.Content.RenameAsset(oldPath, newPath))
{
// Error
Editor.LogError(string.Format("Cannot rename asset \'{0}\' to \'{1}\'", oldPath, newPath));
return true;
}
@@ -387,7 +386,6 @@ namespace FlaxEditor.Modules
}
catch (Exception ex)
{
// Error
Editor.LogWarning(ex);
Editor.LogError(string.Format("Cannot rename asset \'{0}\' to \'{1}\'", oldPath, newPath));
return true;
@@ -418,7 +416,6 @@ namespace FlaxEditor.Modules
}
catch (Exception ex)
{
// Error
Editor.LogWarning(ex);
Editor.LogError(string.Format("Cannot move folder \'{0}\' to \'{1}\'", oldPath, newPath));
return;
@@ -479,7 +476,6 @@ namespace FlaxEditor.Modules
if (item.IsFolder && Directory.Exists(newPath))
{
// Error
MessageBox.Show("Cannot move folder. Target location already exists.");
return;
}
@@ -489,7 +485,6 @@ namespace FlaxEditor.Modules
var newParent = Find(newDirPath) as ContentFolder;
if (newParent == null)
{
// Error
MessageBox.Show("Cannot move item. Missing target location.");
return;
}
@@ -511,7 +506,6 @@ namespace FlaxEditor.Modules
}
catch (Exception ex)
{
// Error
Editor.LogWarning(ex);
Editor.LogError(string.Format("Cannot move folder \'{0}\' to \'{1}\'", oldPath, newPath));
return;
@@ -531,7 +525,6 @@ namespace FlaxEditor.Modules
}
catch (Exception ex)
{
// Error
Editor.LogWarning(ex);
Editor.LogWarning(string.Format("Cannot remove folder \'{0}\'", oldPath));
return;
@@ -566,7 +559,6 @@ namespace FlaxEditor.Modules
{
if (item == null || !item.Exists)
{
// Error
MessageBox.Show("Cannot move item. It's missing.");
return;
}
@@ -590,7 +582,6 @@ namespace FlaxEditor.Modules
}
catch (Exception ex)
{
// Error
Editor.LogWarning(ex);
Editor.LogError(string.Format("Cannot copy folder \'{0}\' to \'{1}\'", sourcePath, targetPath));
return;
@@ -615,7 +606,6 @@ namespace FlaxEditor.Modules
// Note: we use content backend because file may be in use or sth, it's safe
if (Editor.ContentEditing.CloneAssetFile(sourcePath, targetPath, Guid.NewGuid()))
{
// Error
Editor.LogError(string.Format("Cannot copy asset \'{0}\' to \'{1}\'", sourcePath, targetPath));
return;
}
@@ -629,7 +619,6 @@ namespace FlaxEditor.Modules
}
catch (Exception ex)
{
// Error
Editor.LogWarning(ex);
Editor.LogError(string.Format("Cannot copy asset \'{0}\' to \'{1}\'", sourcePath, targetPath));
return;
@@ -680,7 +669,6 @@ namespace FlaxEditor.Modules
}
catch (Exception ex)
{
// Error
Editor.LogWarning(ex);
Editor.LogWarning(string.Format("Cannot remove folder \'{0}\'", path));
return;

View File

@@ -344,7 +344,6 @@ namespace FlaxEditor.Windows.Assets
// Load surface graph
if (_surface.Load())
{
// Error
Editor.LogError("Failed to load animation graph surface.");
return true;
}

View File

@@ -284,7 +284,6 @@ namespace FlaxEditor.Windows.Assets
var mainNode = _surface.FindNode(1, 1) as Surface.Archetypes.Material.SurfaceNodeMaterial;
if (mainNode == null)
{
// Error
Editor.LogError("Failed to find main material node.");
}
return mainNode;

View File

@@ -238,7 +238,6 @@ namespace FlaxEditor.Windows.Assets
// Load surface graph
if (_surface.Load())
{
// Error
Editor.LogError("Failed to load Particle Emitter surface.");
return true;
}

View File

@@ -1131,7 +1131,6 @@ namespace FlaxEditor.Windows.Assets
// Save data to the asset
if (_asset.SaveSurface(value, ref meta))
{
// Error
_surface.MarkAsEdited();
Editor.LogError("Failed to save surface data");
}
@@ -1192,7 +1191,6 @@ namespace FlaxEditor.Windows.Assets
// Load surface graph
if (_surface.Load())
{
// Error
Editor.LogError("Failed to load Visual Script surface.");
return true;
}

View File

@@ -426,7 +426,6 @@ namespace FlaxEditor.Windows
// Ensure has parent
if (item.ParentFolder == null)
{
// Error
Editor.LogWarning("Cannot rename root items. " + item.Path);
return;
}

View File

@@ -2163,18 +2163,16 @@ bool VisualScript::SaveSurface(const BytesContainer& data, const Metadata& meta)
ReleaseChunk(i);
// Set Visject Surface data
auto visjectSurfaceChunk = GetOrCreateChunk(0);
visjectSurfaceChunk->Data.Copy(data);
GetOrCreateChunk(0)->Data.Copy(data);
// Set metadata
auto metadataChunk = GetOrCreateChunk(1);
MemoryWriteStream metaStream(512);
{
metaStream.WriteInt32(1);
metaStream.WriteString(meta.BaseTypename, 31);
metaStream.WriteInt32((int32)meta.Flags);
}
metadataChunk->Data.Copy(metaStream.GetHandle(), metaStream.GetPosition());
GetOrCreateChunk(1)->Data.Copy(metaStream.GetHandle(), metaStream.GetPosition());
// Save
AssetInitData assetData;