auto open mesh viewer

This commit is contained in:
MountainFlash 2021-11-18 19:12:22 +05:30
parent 81fbe018d4
commit 411c0a135c
No known key found for this signature in database
GPG Key ID: 6BDA200334E04E1A
3 changed files with 22 additions and 5 deletions

View File

@ -168,6 +168,9 @@
<MenuItem Header="Open Sounds" IsCheckable="True" StaysOpenOnClick="True"
InputGestureText="{Binding AutoOpenSounds, Source={x:Static local:Settings.UserSettings.Default}}"
IsChecked="{Binding IsAutoOpenSounds, Source={x:Static local:Settings.UserSettings.Default}}" />
<MenuItem Header="Open Model Viewer" IsCheckable="True" StaysOpenOnClick="True"
InputGestureText="{Binding AutoOpenMeshes, Source={x:Static local:Settings.UserSettings.Default}}"
IsChecked="{Binding AutoOpenMeshes, Source={x:Static local:Settings.UserSettings.Default}}" />
</MenuItem>
</MenuItem>
<MenuItem Header="Views">

View File

@ -114,6 +114,13 @@ namespace FModel.Settings
set => SetProperty(ref _isAutoOpenSounds, value);
}
private bool _isAutoOpenMeshes = true;
public bool IsAutoOpenMeshes
{
get => _isAutoOpenMeshes;
set => SetProperty(ref _isAutoOpenMeshes, value);
}
private bool _isLoggerExpanded = true;
public bool IsLoggerExpanded
{
@ -518,6 +525,13 @@ namespace FModel.Settings
set => SetProperty(ref _autoOpenSounds, value);
}
private Hotkey _autoOpenMeshes = new(Key.F8);
public Hotkey AutoOpenMeshes
{
get => _autoOpenMeshes;
set => SetProperty(ref _autoOpenMeshes, value);
}
private Hotkey _addAudio = new(Key.N, ModifierKeys.Control);
public Hotkey AddAudio
{

View File

@ -668,11 +668,7 @@ namespace FModel.ViewModels
case UStaticMesh:
case USkeletalMesh:
{
if (UserSettings.Default.IsAutoSaveMeshes)
{
SaveExport(export);
}
else
if (UserSettings.Default.IsAutoOpenMeshes)
{
Application.Current.Dispatcher.Invoke(() =>
{
@ -680,6 +676,10 @@ namespace FModel.ViewModels
modelViewer.Load(export);
});
}
if (UserSettings.Default.IsAutoSaveMeshes)
{
SaveExport(export);
}
return true;
}
case USkeleton when UserSettings.Default.IsAutoSaveMeshes && UserSettings.Default.SaveSkeletonAsMesh: