[Editor] Update entity hierarchy editor bindings

This commit is contained in:
Nicolas Musset 2024-02-02 18:47:15 +01:00
Родитель bbb9331932
Коммит 2f5059432f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5D113F041FA3C820
2 изменённых файлов: 11 добавлений и 15 удалений

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

@ -6,7 +6,6 @@
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:p="clr-namespace:Stride.Assets.Presentation"
xmlns:strings="clr-namespace:Stride.Assets.Presentation.Resources.Strings"
xmlns:viewModel="clr-namespace:Stride.Assets.Presentation.ViewModel"
xmlns:pvc="clr-namespace:Stride.Assets.Presentation.ValueConverters"
xmlns:assetEditors="clr-namespace:Stride.Assets.Presentation.AssetEditors"
xmlns:gameEditor="clr-namespace:Stride.Assets.Presentation.AssetEditors.GameEditor"
@ -19,7 +18,7 @@
xmlns:core="clr-namespace:Stride.Core.Presentation.Core;assembly=Stride.Core.Presentation"
xmlns:sd="http://schemas.stride3d.net/xaml/presentation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance viewModel:EntityHierarchyViewModel}">
d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance ehvm:EntityHierarchyEditorViewModel}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@ -155,22 +154,22 @@
</ResourceDictionary>
</UserControl.Resources>
<UserControl.InputBindings>
<KeyBinding Command="{Binding Editor.Grid.ToggleCommand}" Gesture="{sd:KeyGesture {x:Static strings:KeyGestures.GestureToggleGrid}}"/>
<KeyBinding Command="{Binding Editor.DuplicateSelectionCommand}" Gesture="{sd:KeyGesture {}Ctrl+D}"/>
<KeyBinding Command="{Binding Grid.ToggleCommand}" Gesture="{sd:KeyGesture {x:Static strings:KeyGestures.GestureToggleGrid}}"/>
<KeyBinding Command="{Binding DuplicateSelectionCommand}" Gesture="{sd:KeyGesture {}Ctrl+D}"/>
</UserControl.InputBindings>
<i:Interaction.Behaviors>
<!-- These commands are available globally in the editor -->
<sd:CommandBindingBehavior RoutedCommand="ApplicationCommands.Delete" Command="{Binding Editor.DeleteCommand, FallbackValue={x:Static cmd:DisabledCommand.Instance}, Mode=OneWay}"/>
<sd:CommandBindingBehavior RoutedCommand="ApplicationCommands.Paste" Command="{Binding Editor.PasteCommand, FallbackValue={x:Static cmd:DisabledCommand.Instance}, Mode=OneWay}"/>
<sd:CommandBindingBehavior RoutedCommand="{x:Static ehv:EntityHierarchyEditorView.FocusOnSelection}" Command="{Binding Editor.EntityWithGizmo.FocusOnEntityCommand, FallbackValue={x:Static cmd:DisabledCommand.Instance}, Mode=OneWay}"/>
<sd:CommandBindingBehavior RoutedCommand="ApplicationCommands.Delete" Command="{Binding DeleteCommand, FallbackValue={x:Static cmd:DisabledCommand.Instance}, Mode=OneWay}"/>
<sd:CommandBindingBehavior RoutedCommand="ApplicationCommands.Paste" Command="{Binding PasteCommand, FallbackValue={x:Static cmd:DisabledCommand.Instance}, Mode=OneWay}"/>
<sd:CommandBindingBehavior RoutedCommand="{x:Static ehv:EntityHierarchyEditorView.FocusOnSelection}" Command="{Binding EntityWithGizmo.FocusOnEntityCommand, FallbackValue={x:Static cmd:DisabledCommand.Instance}, Mode=OneWay}"/>
</i:Interaction.Behaviors>
<Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding Editor, Converter={sd:Chained {sd:ObjectToBool}, {sd:VisibleOrCollapsed}, Parameter2={sd:False}}}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding Converter={sd:Chained {sd:ObjectToBool}, {sd:VisibleOrCollapsed}, Parameter2={sd:False}}}">
<TextBlock Text="{sd:Localize Loading scene...}" Margin="20" HorizontalAlignment="Center"/>
<TextBlock Text="{sd:Localize This might take a few minutes the first time.}" Margin="20" HorizontalAlignment="Center"/>
<ProgressBar IsIndeterminate="True" Width="200" Height="20" Margin="20" BorderThickness="1"/>
</StackPanel>
<Grid DataContext="{Binding Editor, Mode=OneWay}" Visibility="{Binding Converter={sd:Chained {sd:ObjectToBool}, {sd:VisibleOrCollapsed}}}" d:DataContext="{d:DesignInstance ehvm:EntityHierarchyEditorViewModel}">
<Grid Visibility="{Binding Converter={sd:Chained {sd:ObjectToBool}, {sd:VisibleOrCollapsed}}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
@ -180,7 +179,8 @@
<DockPanel Grid.Row="0" Grid.Column="0">
<ToolBarTray DockPanel.Dock="Top">
<ToolBar>
<Menu Background="Transparent" DataContext="{sd:PriorityBinding {Binding ActiveRoot, Converter={sd:NullToUnset}, Mode=OneWay}, {Binding HierarchyRoot, Mode=OneWay}}"
<Menu Background="Transparent"
DataContext="{sd:PriorityBinding {Binding ActiveRoot, Converter={sd:NullToUnset}, Mode=OneWay}, {Binding HierarchyRoot, Mode=OneWay}}"
ToolTip="{sd:Localize Create a new entity, Context=ToolTip}" sd:ToolTipHelper.Status="{Binding Editor.Session.Editor.Status}" ToolTipService.ShowOnDisabled="True">
<MenuItem Style="{StaticResource ToolBarIconMenuItemStyle}">
<MenuItem.Icon>

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

@ -1,14 +1,12 @@
// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
using System;
using System.Collections.Generic;
using Stride.Core.Assets.Editor.ViewModel;
using Stride.Core.Annotations;
using Stride.Core.Reflection;
using Stride.Assets.Entities;
using Stride.Core.Quantum;
using Stride.Animations;
using Stride.Assets.Presentation.AssetEditors.EntityHierarchyEditor.ViewModels;
using Stride.Engine;
namespace Stride.Assets.Presentation.ViewModel
@ -20,8 +18,6 @@ namespace Stride.Assets.Presentation.ViewModel
{
}
internal new EntityHierarchyEditorViewModel Editor => (EntityHierarchyEditorViewModel)base.Editor;
/// <inheritdoc />
protected override bool ShouldConstructPropertyMember(IMemberNode member)
{