Merge remote-tracking branch 'origin/master' into 1.7
This commit is contained in:
@@ -632,7 +632,8 @@ namespace FlaxEditor.Modules
|
||||
/// Deletes the specified item.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
public void Delete(ContentItem item)
|
||||
/// <param name="deletedByUser">If the file was deleted by the user and not outside the editor.</param>
|
||||
public void Delete(ContentItem item, bool deletedByUser = false)
|
||||
{
|
||||
if (item == null)
|
||||
throw new ArgumentNullException();
|
||||
@@ -656,12 +657,12 @@ namespace FlaxEditor.Modules
|
||||
var children = folder.Children.ToArray();
|
||||
for (int i = 0; i < children.Length; i++)
|
||||
{
|
||||
Delete(children[i]);
|
||||
Delete(children[i], deletedByUser);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove directory
|
||||
if (Directory.Exists(path))
|
||||
if (deletedByUser && Directory.Exists(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -689,7 +690,7 @@ namespace FlaxEditor.Modules
|
||||
// Delete asset by using content pool
|
||||
FlaxEngine.Content.DeleteAsset(path);
|
||||
}
|
||||
else
|
||||
else if (deletedByUser)
|
||||
{
|
||||
// Delete file
|
||||
if (File.Exists(path))
|
||||
@@ -835,7 +836,7 @@ namespace FlaxEditor.Modules
|
||||
Editor.Log(string.Format($"Content item \'{child.Path}\' has been removed"));
|
||||
|
||||
// Destroy it
|
||||
Delete(child);
|
||||
Delete(child, false);
|
||||
|
||||
i--;
|
||||
}
|
||||
|
||||
@@ -104,6 +104,12 @@ namespace FlaxEditor.Modules
|
||||
hint = "Too long name.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item.IsFolder && shortName.EndsWith("."))
|
||||
{
|
||||
hint = "Name cannot end with '.'";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Find invalid characters
|
||||
if (Utilities.Utils.HasInvalidPathChar(shortName))
|
||||
@@ -134,7 +140,7 @@ namespace FlaxEditor.Modules
|
||||
// Cache data
|
||||
string sourcePath = item.Path;
|
||||
string sourceFolder = System.IO.Path.GetDirectoryName(sourcePath);
|
||||
string extension = System.IO.Path.GetExtension(sourcePath);
|
||||
string extension = item.IsFolder ? "" : System.IO.Path.GetExtension(sourcePath);
|
||||
string destinationPath = StringUtils.CombinePaths(sourceFolder, shortName + extension);
|
||||
|
||||
if (item.IsFolder)
|
||||
|
||||
@@ -24,7 +24,8 @@ namespace
|
||||
String version;
|
||||
|
||||
RiderInstallation(const String& path_, const String& version_)
|
||||
: path(path_), version(version_)
|
||||
: path(path_)
|
||||
, version(version_)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -145,14 +146,14 @@ bool sortInstallations(RiderInstallation* const& i1, RiderInstallation* const& i
|
||||
int32 version2[3] = { 0 };
|
||||
StringUtils::Parse(values1[0].Get(), &version1[0]);
|
||||
StringUtils::Parse(values1[1].Get(), &version1[1]);
|
||||
|
||||
if(values1.Count() > 2)
|
||||
|
||||
if (values1.Count() > 2)
|
||||
StringUtils::Parse(values1[2].Get(), &version1[2]);
|
||||
|
||||
|
||||
StringUtils::Parse(values2[0].Get(), &version2[0]);
|
||||
StringUtils::Parse(values2[1].Get(), &version2[1]);
|
||||
|
||||
if(values2.Count() > 2)
|
||||
|
||||
if (values2.Count() > 2)
|
||||
StringUtils::Parse(values2[2].Get(), &version2[2]);
|
||||
|
||||
// Compare by MAJOR.MINOR.BUILD
|
||||
@@ -178,7 +179,7 @@ void RiderCodeEditor::FindEditors(Array<CodeEditor*>* output)
|
||||
|
||||
String localAppDataPath;
|
||||
FileSystem::GetSpecialFolderPath(SpecialFolder::LocalAppData, localAppDataPath);
|
||||
|
||||
|
||||
#if PLATFORM_WINDOWS
|
||||
// Lookup from all known registry locations
|
||||
SearchRegistry(&installations, HKEY_CURRENT_USER, TEXT("SOFTWARE\\WOW6432Node\\JetBrains\\Rider for Unreal Engine"));
|
||||
@@ -216,7 +217,24 @@ void RiderCodeEditor::FindEditors(Array<CodeEditor*>* output)
|
||||
TEXT("flatpak run com.jetbrains.Rider"));
|
||||
#endif
|
||||
|
||||
for (auto directory : subDirectories)
|
||||
#if PLATFORM_MAC
|
||||
String applicationSupportFolder;
|
||||
FileSystem::GetSpecialFolderPath(SpecialFolder::ProgramData, applicationSupportFolder);
|
||||
|
||||
Array<String> subMacDirectories;
|
||||
FileSystem::GetChildDirectories(subMacDirectories, applicationSupportFolder / TEXT("JetBrains/Toolbox/apps/Rider/ch-0/"));
|
||||
FileSystem::GetChildDirectories(subMacDirectories, applicationSupportFolder / TEXT("JetBrains/Toolbox/apps/Rider/ch-1/"));
|
||||
for (const String& directory : subMacDirectories)
|
||||
{
|
||||
String riderAppDirectory = directory / TEXT("Rider.app/Contents/Resources");
|
||||
SearchDirectory(&installations, riderAppDirectory);
|
||||
}
|
||||
|
||||
// Check the local installer version
|
||||
SearchDirectory(&installations, TEXT("/Applications/Rider.app/Contents/Resources"));
|
||||
#endif
|
||||
|
||||
for (const String& directory : subDirectories)
|
||||
SearchDirectory(&installations, directory);
|
||||
|
||||
// Sort found installations by version number
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
Title = "Clamp",
|
||||
Description = "Clamps value to the specified range",
|
||||
Flags = NodeFlags.AllGraphs,
|
||||
Size = new Float2(110, 60),
|
||||
Size = new Float2(140, 60),
|
||||
ConnectionsHints = ConnectionsHint.Numeric,
|
||||
IndependentBoxes = new[] { 0 },
|
||||
DependentBoxes = new[] { 1, 2, 3 },
|
||||
|
||||
@@ -519,7 +519,7 @@ namespace FlaxEditor.Windows
|
||||
}
|
||||
|
||||
// Cache data
|
||||
string extension = Path.GetExtension(item.Path);
|
||||
string extension = item.IsFolder ? "" : Path.GetExtension(item.Path);
|
||||
var newPath = StringUtils.CombinePaths(item.ParentFolder.Path, newShortName + extension);
|
||||
|
||||
// Check if was renaming mock element
|
||||
@@ -625,7 +625,7 @@ namespace FlaxEditor.Windows
|
||||
|
||||
// Delete items
|
||||
for (int i = 0; i < toDelete.Count; i++)
|
||||
Editor.ContentDatabase.Delete(toDelete[i]);
|
||||
Editor.ContentDatabase.Delete(toDelete[i], true);
|
||||
|
||||
RefreshView();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user