mirror of
https://github.com/4sval/FModel.git
synced 2026-04-26 00:04:53 -05:00
pak double click + fixed export
This commit is contained in:
parent
df27d650a8
commit
dd1457b580
|
|
@ -27,7 +27,7 @@ namespace FModel.Framework
|
||||||
|
|
||||||
protected ViewModelCommand(TContextViewModel contextViewModel)
|
protected ViewModelCommand(TContextViewModel contextViewModel)
|
||||||
{
|
{
|
||||||
ContextViewModel = contextViewModel /*?? throw new ArgumentNullException(nameof(contextViewModel))*/;
|
ContextViewModel = contextViewModel ?? throw new ArgumentNullException(nameof(contextViewModel));
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed override void Execute(object parameter)
|
public sealed override void Execute(object parameter)
|
||||||
|
|
|
||||||
|
|
@ -278,7 +278,7 @@
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Separator Grid.Row="0" Style="{StaticResource CustomSeparator}" Tag="GAME DIRECTORY" />
|
<Separator Grid.Row="0" Style="{StaticResource CustomSeparator}" Tag="GAME DIRECTORY" />
|
||||||
<ListBox Grid.Row="1" x:Name="DirectoryFilesListBox" Style="{StaticResource DirectoryFilesListBox}" />
|
<ListBox Grid.Row="1" x:Name="DirectoryFilesListBox" Style="{StaticResource DirectoryFilesListBox}" MouseDoubleClick="OnMouseDoubleClick" />
|
||||||
<Separator Grid.Row="2" Style="{StaticResource CustomSeparator}" Tag="INFORMATION" />
|
<Separator Grid.Row="2" Style="{StaticResource CustomSeparator}" Tag="INFORMATION" />
|
||||||
<StackPanel Grid.Row="3" Orientation="Vertical" Margin="0 0 0 5">
|
<StackPanel Grid.Row="3" Orientation="Vertical" Margin="0 0 0 5">
|
||||||
<Grid HorizontalAlignment="Stretch">
|
<Grid HorizontalAlignment="Stretch">
|
||||||
|
|
|
||||||
|
|
@ -233,5 +233,12 @@ namespace FModel
|
||||||
return o is AssetItem assetItem && filters.All(x => assetItem.FullPath.SubstringAfterLast('/').Contains(x, StringComparison.OrdinalIgnoreCase));
|
return o is AssetItem assetItem && filters.All(x => assetItem.FullPath.SubstringAfterLast('/').Contains(x, StringComparison.OrdinalIgnoreCase));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is not ListBox listBox) return;
|
||||||
|
UserSettings.Default.LoadingMode = ELoadingMode.Multiple;
|
||||||
|
_applicationView.LoadingModes.LoadCommand.Execute(listBox.SelectedItems);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -617,17 +617,14 @@ namespace FModel.ViewModels
|
||||||
|
|
||||||
if (Provider.TrySavePackage(fullPath, out var assets))
|
if (Provider.TrySavePackage(fullPath, out var assets))
|
||||||
{
|
{
|
||||||
foreach (var (key, value) in assets)
|
foreach (var kvp in assets)
|
||||||
{
|
{
|
||||||
directory = Path.Combine(directory, UserSettings.Default.KeepDirectoryStructure == EEnabledDisabled.Enabled
|
var path = Path.Combine(directory, UserSettings.Default.KeepDirectoryStructure == EEnabledDisabled.Enabled
|
||||||
? key : key.SubstringAfterLast('/')).Replace('\\', '/');
|
? kvp.Key : kvp.Key.SubstringAfterLast('/')).Replace('\\', '/');
|
||||||
Directory.CreateDirectory(directory.SubstringBeforeLast('/'));
|
Directory.CreateDirectory(path.SubstringBeforeLast('/'));
|
||||||
File.WriteAllBytes(directory, value);
|
File.WriteAllBytes(path, kvp.Value);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (File.Exists(directory))
|
|
||||||
{
|
|
||||||
Log.Information("{FileName} successfully exported", fileName);
|
Log.Information("{FileName} successfully exported", fileName);
|
||||||
FLogger.AppendInformation();
|
FLogger.AppendInformation();
|
||||||
FLogger.AppendText($"Successfully exported '{fileName}'", Constants.WHITE, true);
|
FLogger.AppendText($"Successfully exported '{fileName}'", Constants.WHITE, true);
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace FModel.Views
|
||||||
|
|
||||||
WindowState = WindowState.Minimized;
|
WindowState = WindowState.Minimized;
|
||||||
MainWindow.YesWeCats.AssetsListName.ItemsSource = null;
|
MainWindow.YesWeCats.AssetsListName.ItemsSource = null;
|
||||||
var folder = new GoToCommand(null).JumpTo(assetItem.FullPath.SubstringBeforeLast('/'));
|
var folder = _applicationView.CustomDirectories.GoToCommand.JumpTo(assetItem.FullPath.SubstringBeforeLast('/'));
|
||||||
if (folder == null) return;
|
if (folder == null) return;
|
||||||
|
|
||||||
do { await Task.Delay(100); } while (MainWindow.YesWeCats.AssetsListName.Items.Count < folder.AssetsList.Assets.Count);
|
do { await Task.Delay(100); } while (MainWindow.YesWeCats.AssetsListName.Items.Count < folder.AssetsList.Assets.Count);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user