Merge remote-tracking branch 'origin/master' into 1.7

# Conflicts:
#	Flax.flaxproj
This commit is contained in:
Wojtek Figat
2023-10-09 12:40:47 +02:00
86 changed files with 1406 additions and 686 deletions

View File

@@ -116,7 +116,7 @@ namespace FlaxEditor.Windows.Assets
_window = window;
// Try to restore target asset AudioClip import options (useful for fast reimport)
AudioImportSettings.TryRestore(ref ImportSettings, window.Item.Path);
Editor.TryRestoreImportOptions(ref ImportSettings.Settings, window.Item.Path);
// Prepare restore data
PeekState();
@@ -134,6 +134,11 @@ namespace FlaxEditor.Windows.Assets
/// </summary>
public void Reimport()
{
if (_window?._previewSource != null)
{
_window._previewSource.Stop();
_window.UpdateToolstrip();
}
Editor.Instance.ContentImporting.Reimport((BinaryAssetItem)_window.Item, ImportSettings, true);
}

View File

@@ -80,11 +80,8 @@ namespace FlaxEditor.Windows.Assets
{
if (!IsEdited)
return;
if (_asset.WaitForLoaded())
{
return;
}
if (Editor.SaveJsonAsset(_item.Path, _object))
{
@@ -137,7 +134,7 @@ namespace FlaxEditor.Windows.Assets
}
}
_presenter.Select(_object);
if (_typeText != null)
_typeText.Dispose();
var typeText = new ClickableLabel
@@ -152,7 +149,7 @@ namespace FlaxEditor.Windows.Assets
typeText.LocalY += (_toolstrip.Height - typeText.Height) * 0.5f;
typeText.RightClick = () => Clipboard.Text = Asset.DataTypeName;
_typeText = typeText;
_undo.Clear();
ClearEditedFlag();

View File

@@ -233,7 +233,7 @@ namespace FlaxEditor.Windows.Assets
contextMenu.AddSeparator();
b = contextMenu.AddButton("Create Prefab", () => Editor.Prefabs.CreatePrefab(Selection));
b = contextMenu.AddButton("Create Prefab", () => Editor.Prefabs.CreatePrefab(Selection, this));
b.Enabled = isSingleActorSelected &&
(Selection[0] as ActorNode).CanCreatePrefab &&
Editor.Windows.ContentWin.CurrentViewFolder.CanHaveAssets;
@@ -313,7 +313,7 @@ namespace FlaxEditor.Windows.Assets
}
if (showCustomNodeOptions)
{
Selection[0].OnContextMenu(contextMenu);
Selection[0].OnContextMenu(contextMenu, this);
}
ContextMenuShow?.Invoke(contextMenu);

View File

@@ -53,6 +53,11 @@ namespace FlaxEditor.Windows.Assets
/// </summary>
public PrefabWindowViewport Viewport => _viewport;
/// <summary>
/// Gets the prefab objects properties editor.
/// </summary>
public CustomEditorPresenter Presenter => _propertiesEditor;
/// <summary>
/// Gets the undo system used by this window for changes tracking.
/// </summary>
@@ -146,7 +151,7 @@ namespace FlaxEditor.Windows.Assets
Graph = new LocalSceneGraph(new CustomRootNode(this));
_tree = new PrefabTree
{
Margin = new Margin(0.0f, 0.0f, -16.0f, 0.0f), // Hide root node
Margin = new Margin(0.0f, 0.0f, -16.0f, _treePanel.ScrollBarsSize), // Hide root node
IsScrollable = true,
};
_tree.AddChild(Graph.Root.TreeNode);