This commit is contained in:
Eideren 2022-10-06 16:53:41 +02:00
Родитель 1e1a1c148e
Коммит 7743d6a19c
8 изменённых файлов: 26 добавлений и 20 удалений

Просмотреть файл

@ -104,7 +104,7 @@ namespace Stride.Assets.Presentation.AssetEditors.EntityHierarchyEditor.Game
// Setup material filter
materialFilterRenderFeature.MaterialFilter =
(materialFilterRenderFeature != null && renderMode.Mode == GameEditor.RenderMode.SingleStream)
renderMode.Mode == GameEditor.RenderMode.SingleStream
? renderMode.StreamDescriptor.Filter
: null;

Просмотреть файл

@ -54,7 +54,7 @@ namespace Stride.Assets.Presentation.CurveEditor.ViewModels
break;
case VectorComponent.W:
value.Z = realPoint.Y;
value.W = realPoint.Y;
break;
default:

Просмотреть файл

@ -28,6 +28,7 @@ namespace Stride.GameStudio
{
internal sealed class AssetEditorsManager : IAssetEditorsManager, IDestroyable
{
private readonly ConditionalWeakTable<IMultipleAssetEditorViewModel, NotifyCollectionChangedEventHandler> registeredHandlers = new();
private readonly Dictionary<IAssetEditorViewModel, LayoutAnchorable> assetEditors = new Dictionary<IAssetEditorViewModel, LayoutAnchorable>();
private readonly HashSet<AssetViewModel> openedAssets = new HashSet<AssetViewModel>();
// TODO have a base interface for all editors and factorize to make curve editor not be a special case anymore
@ -333,8 +334,7 @@ namespace Stride.GameStudio
{
assetEditors[viewModel] = editorPane;
openedAssets.Add(asset);
var multiEditor = viewModel as IMultipleAssetEditorViewModel;
if (multiEditor != null)
if (viewModel is IMultipleAssetEditorViewModel multiEditor)
{
foreach (var item in multiEditor.OpenedAssets)
{
@ -345,7 +345,9 @@ namespace Stride.GameStudio
}
item.Editor = viewModel;
}
multiEditor.OpenedAssets.CollectionChanged += (_, e) => MultiEditorOpenAssetsChanged(multiEditor, e);
NotifyCollectionChangedEventHandler handler = (_, e) => MultiEditorOpenAssetsChanged(multiEditor, e);
registeredHandlers.Add(multiEditor, handler);
multiEditor.OpenedAssets.CollectionChanged += handler;
}
else
{
@ -438,10 +440,18 @@ namespace Stride.GameStudio
LayoutAnchorable editorPane;
assetEditors.TryGetValue(editor, out editorPane);
var multiEditor = editor as IMultipleAssetEditorViewModel;
if (multiEditor != null)
if (editor is IMultipleAssetEditorViewModel multiEditor)
{
multiEditor.OpenedAssets.CollectionChanged -= (_, e) => MultiEditorOpenAssetsChanged(multiEditor, e);
if (registeredHandlers.TryGetValue(multiEditor, out var handler))
{
multiEditor.OpenedAssets.CollectionChanged -= handler;
registeredHandlers.Remove(multiEditor);
}
else
{
throw new InvalidOperationException($"Expected {multiEditor} to have a handler set up");
}
// Clean asset view models
foreach (var item in multiEditor.OpenedAssets)
{

Просмотреть файл

@ -41,7 +41,6 @@ namespace Stride.Core.Presentation.Quantum.ViewModels
GraphViewModelService = serviceProvider.TryGet<GraphViewModelService>();
if (GraphViewModelService == null) throw new InvalidOperationException($"{nameof(GraphViewModel)} requires a {nameof(GraphViewModelService)} in the service provider.");
Logger = GlobalLogger.GetLogger(DefaultLoggerName);
if (rootPresenters == null) throw new ArgumentNullException(nameof(rootNode));
var viewModelFactory = serviceProvider.Get<GraphViewModelService>().NodeViewModelFactory;
viewModelFactory.CreateGraph(this, type, rootPresenters);
}

Просмотреть файл

@ -424,10 +424,11 @@ namespace Stride.Core.Presentation.Controls
{
for (var i = 0; i < itemsControl.Items.Count; i++)
{
var child = itemsControl.ItemContainerGenerator.ContainerFromIndex(i) as UIElement;
child?.Arrange(new Rect(-HorizontalOffset, currentY - VerticalOffset, finalSize.Width, child.DesiredSize.Height));
currentY += child.DesiredSize.Height;
if (itemsControl.ItemContainerGenerator.ContainerFromIndex(i) is UIElement child)
{
child.Arrange(new Rect(-HorizontalOffset, currentY - VerticalOffset, finalSize.Width, child.DesiredSize.Height));
currentY += child.DesiredSize.Height;
}
}
}

Просмотреть файл

@ -134,9 +134,6 @@ namespace Stride.Core.Quantum.References
if (targetValue != null && !type.IsInstanceOfType(targetValue))
throw new InvalidOperationException(@"The type of the retrieved node content does not match the type of this reference");
if (targetValue != null && !type.IsInstanceOfType(targetValue))
throw new InvalidOperationException("TargetNode type does not match the reference type.");
TargetNode = targetNode;
TargetGuid = targetNode.Guid;
}

Просмотреть файл

@ -129,7 +129,7 @@ namespace FreeImageAPI.Metadata
}
set
{
SetTagValue("GlobalPalette", (value != null) ? null : value.Data);
SetTagValue("GlobalPalette", value?.Data);
}
}
@ -1220,7 +1220,7 @@ namespace FreeImageAPI.Metadata
/// <summary>
/// Gets or sets the exposure bias. The unit is the APEX value.
/// Ordinarily it is given in the range of 99.99 to 99.99.
/// Ordinarily it is given in the range of <EFBFBD>99.99 to 99.99.
/// </summary>
/// <remarks>
/// <b>Handling of null values</b><para/>
@ -6721,4 +6721,4 @@ namespace FreeImageAPI.Metadata
}
}
}
}
}

Просмотреть файл

@ -45,7 +45,6 @@ namespace Stride.TextureConverter
CurrentLibrary = atlas.CurrentLibrary;
LibraryData = atlas.LibraryData;
Layout = layout;
Name = "";
}
public override Object Clone(bool CopyMemory)