don't let rename source/content folders
This commit is contained in:
@@ -113,7 +113,16 @@ namespace FlaxEditor.Content
|
||||
public override ContentItemSearchFilter SearchFilter => ContentItemSearchFilter.Other;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool CanRename => ParentFolder != null; // Deny rename action for root folders
|
||||
public override bool CanRename
|
||||
{
|
||||
get
|
||||
{
|
||||
var hasParentFolder = ParentFolder != null;
|
||||
var isContentFolder = IsFolder && Path == Editor.Instance.GameProject.ContentFolderPath;
|
||||
var isSourceFolder = IsFolder && Path == Editor.Instance.GameProject.SourceFolderPath;
|
||||
return hasParentFolder && !isContentFolder && !isSourceFolder;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool CanDrag => ParentFolder != null; // Deny rename action for root folders
|
||||
|
||||
@@ -55,6 +55,16 @@ namespace FlaxEditor
|
||||
[NonSerialized]
|
||||
public string ProjectFolderPath;
|
||||
|
||||
/// <summary>
|
||||
/// The content assets folder
|
||||
/// </summary>
|
||||
public string ContentFolderPath;
|
||||
|
||||
/// <summary>
|
||||
/// The source files folder path
|
||||
/// </summary>
|
||||
public string SourceFolderPath;
|
||||
|
||||
/// <summary>
|
||||
/// The project version.
|
||||
/// </summary>
|
||||
@@ -157,6 +167,8 @@ namespace FlaxEditor
|
||||
var project = JsonConvert.DeserializeObject<ProjectInfo>(contents);
|
||||
project.ProjectPath = path;
|
||||
project.ProjectFolderPath = StringUtils.NormalizePath(Path.GetDirectoryName(path));
|
||||
project.ContentFolderPath = StringUtils.NormalizePath(project.ProjectFolderPath + "/Content");
|
||||
project.SourceFolderPath = StringUtils.NormalizePath(project.ProjectFolderPath + "/Source");
|
||||
|
||||
// Process project data
|
||||
if (string.IsNullOrEmpty(project.Name))
|
||||
|
||||
Reference in New Issue
Block a user