Merge branch 'FlaxEngine:master' into visject_grid_snap

This commit is contained in:
Menotdan
2023-10-03 23:30:18 -04:00
committed by GitHub
42 changed files with 560 additions and 93 deletions
@@ -139,7 +139,7 @@ namespace FlaxEditor.Content.Import
var menu = new ContextMenu();
menu.AddButton("Rename", OnRenameClicked);
menu.AddButton("Don't import", OnDontImportClicked);
menu.AddButton("Show in Explorer", OnShowInExplorerClicked);
menu.AddButton(Utilities.Constants.ShowInExplorer, OnShowInExplorerClicked);
menu.Tag = node;
menu.Show(node, location);
}
@@ -29,7 +29,7 @@ namespace FlaxEditor.Content
//_watcher.Changed += OnEvent;
_watcher.Created += OnEvent;
_watcher.Deleted += OnEvent;
//_watcher.Renamed += OnEvent;
_watcher.Renamed += OnEvent;
}
private void OnEvent(object sender, FileSystemEventArgs e)
@@ -0,0 +1,26 @@
using FlaxEditor.CustomEditors.Editors;
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.CustomEditors.Dedicated;
/// <summary>
/// The missing script editor.
/// </summary>
[CustomEditor(typeof(MissingScript)), DefaultEditor]
public class MissingScriptEditor : GenericEditor
{
/// <inheritdoc />
public override void Initialize(LayoutElementsContainer layout)
{
if (layout.ContainerControl is not DropPanel dropPanel)
{
base.Initialize(layout);
return;
}
dropPanel.HeaderTextColor = Color.OrangeRed;
base.Initialize(layout);
}
}
@@ -931,6 +931,11 @@ namespace FlaxEditor.Modules
// Check if node already has that element (skip during init when we want to walk project dir very fast)
if (_isDuringFastSetup || !parent.Folder.ContainsChild(path))
{
#if PLATFORM_MAC
if (path.EndsWith(".DS_Store", StringComparison.Ordinal))
continue;
#endif
// Create file item
ContentItem item;
if (path.EndsWith(".cs"))
@@ -972,6 +977,11 @@ namespace FlaxEditor.Modules
// Check if node already has that element (skip during init when we want to walk project dir very fast)
if (_isDuringFastSetup || !parent.Folder.ContainsChild(path))
{
#if PLATFORM_MAC
if (path.EndsWith(".DS_Store", StringComparison.Ordinal))
continue;
#endif
// Create file item
ContentItem item = null;
if (FlaxEngine.Content.GetAssetInfo(path, out var assetInfo))
@@ -1197,6 +1207,7 @@ namespace FlaxEditor.Modules
{
case WatcherChangeTypes.Created:
case WatcherChangeTypes.Deleted:
case WatcherChangeTypes.Renamed:
{
lock (_dirtyNodes)
{
+6
View File
@@ -14,5 +14,11 @@ namespace FlaxEditor.Utilities
public const string FacebookUrl = "https://facebook.com/FlaxEngine";
public const string YoutubeUrl = "https://youtube.com/c/FlaxEngine";
public const string TwitterUrl = "https://twitter.com/FlaxEngine";
#if PLATFORM_MAC
public const string ShowInExplorer = "Show in Finder";
#else
public const string ShowInExplorer = "Show in explorer";
#endif
}
}
@@ -58,7 +58,7 @@ namespace FlaxEditor.Windows
if (item is ContentFolder contentFolder && contentFolder.Node is ProjectTreeNode)
{
cm.AddButton("Show in explorer", () => FileSystem.ShowFileExplorer(CurrentViewFolder.Path));
cm.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(CurrentViewFolder.Path));
}
else if (isValidElement)
{
@@ -72,7 +72,7 @@ namespace FlaxEditor.Windows
Open(e);
});
cm.AddButton("Show in explorer", () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(item.Path)));
cm.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(item.Path)));
if (item.HasDefaultThumbnail == false)
{
@@ -135,7 +135,7 @@ namespace FlaxEditor.Windows
}
else
{
cm.AddButton("Show in explorer", () => FileSystem.ShowFileExplorer(CurrentViewFolder.Path));
cm.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(CurrentViewFolder.Path));
b = cm.AddButton("Paste", _view.Paste);
b.Enabled = _view.CanPaste();
+1 -1
View File
@@ -195,7 +195,7 @@ namespace FlaxEditor.Windows
_contextMenu.AddButton("Clear log", Clear);
_contextMenu.AddButton("Copy selection", _output.Copy);
_contextMenu.AddButton("Select All", _output.SelectAll);
_contextMenu.AddButton("Show in explorer", () => FileSystem.ShowFileExplorer(Path.Combine(Globals.ProjectFolder, "Logs")));
_contextMenu.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(Path.Combine(Globals.ProjectFolder, "Logs")));
_contextMenu.AddButton("Scroll to bottom", () => { _vScroll.TargetValue = _vScroll.Maximum; }).Icon = Editor.Icons.ArrowDown12;
// Setup editor options
+1 -1
View File
@@ -274,7 +274,7 @@ namespace FlaxEditor.Windows.Profiler
ContextMenuButton b;
b = cm.AddButton("Open", () => Editor.Instance.ContentEditing.Open(assetItem));
cm.AddButton("Show in content window", () => Editor.Instance.Windows.ContentWin.Select(assetItem));
cm.AddButton("Show in explorer", () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(assetItem.Path)));
cm.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(assetItem.Path)));
cm.AddButton("Select actors using this asset", () => Editor.Instance.SceneEditing.SelectActorsUsingAsset(assetItem.ID));
cm.AddButton("Show asset references graph", () => Editor.Instance.Windows.Open(new AssetReferencesGraphWindow(Editor.Instance, assetItem)));
cm.AddButton("Copy name", () => Clipboard.Text = assetItem.NamePath);
+1 -1
View File
@@ -157,7 +157,7 @@ namespace FlaxEditor.Windows.Search
var cm = new FlaxEditor.GUI.ContextMenu.ContextMenu { Tag = assetItem };
b = cm.AddButton("Open", () => Editor.Instance.ContentFinding.Open(Item));
cm.AddSeparator();
cm.AddButton("Show in explorer", () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(assetItem.Path)));
cm.AddButton(Utilities.Constants.ShowInExplorer, () => FileSystem.ShowFileExplorer(System.IO.Path.GetDirectoryName(assetItem.Path)));
cm.AddButton("Show in Content window", () => Editor.Instance.Windows.ContentWin.Select(assetItem, true));
b.Enabled = proxy != null && proxy.CanReimport(assetItem);
if (assetItem is BinaryAssetItem binaryAsset)