update ui
Some checks failed
FModel QA Builder / build (push) Has been cancelled

This commit is contained in:
Asval
2024-07-29 12:48:35 +02:00
parent 19c2eb9e78
commit fabc064a46
3 changed files with 16 additions and 23 deletions

View File

@@ -152,7 +152,7 @@
<PackageReference Include="AvalonEdit" Version="6.3.0.90" />
<PackageReference Include="CSCore" Version="1.2.1.2" />
<PackageReference Include="DiscordRichPresence" Version="1.2.1.24" />
<PackageReference Include="EpicManifestParser" Version="2.3.0" />
<PackageReference Include="EpicManifestParser" Version="2.3.1" />
<PackageReference Include="ImGui.NET" Version="1.90.8.1" />
<PackageReference Include="K4os.Compression.LZ4.Streams" Version="1.3.8" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

View File

@@ -847,7 +847,7 @@ public class CUE4ParseViewModel : ViewModel
case UAnimMontage when HasFlag(bulk, EBulkType.Animations):
case UAnimComposite when HasFlag(bulk, EBulkType.Animations):
{
SaveExport(export, HasFlag(bulk, EBulkType.Auto));
SaveExport(export, updateUi);
return true;
}
default:
@@ -893,29 +893,21 @@ public class CUE4ParseViewModel : ViewModel
});
}
private void SaveExport(UObject export, bool auto)
private void SaveExport(UObject export, bool updateUi = true)
{
var toSave = new Exporter(export, UserSettings.Default.ExportOptions);
string dir;
if (!auto)
{
var folderBrowser = new VistaFolderBrowserDialog();
if (folderBrowser.ShowDialog() == true)
dir = folderBrowser.SelectedPath;
else return;
}
else dir = UserSettings.Default.ModelDirectory;
var toSaveDirectory = new DirectoryInfo(dir);
var toSaveDirectory = new DirectoryInfo(UserSettings.Default.ModelDirectory);
if (toSave.TryWriteToDir(toSaveDirectory, out var label, out var savedFilePath))
{
Log.Information("Successfully saved {FilePath}", savedFilePath);
FLogger.Append(ELog.Information, () =>
if (updateUi)
{
FLogger.Text("Successfully saved ", Constants.WHITE);
FLogger.Link(label, savedFilePath, true);
});
FLogger.Append(ELog.Information, () =>
{
FLogger.Text("Successfully saved ", Constants.WHITE);
FLogger.Link(label, savedFilePath, true);
});
}
}
else
{

View File

@@ -22,6 +22,7 @@ public class RightClickMenuCommand : ViewModelCommand<ApplicationViewModel>
var assetItems = ((IList) parameters[1]).Cast<AssetItem>().ToArray();
if (!assetItems.Any()) return;
var updateUi = assetItems.Length > 1 ? EBulkType.Auto : EBulkType.None;
await _threadWorkerView.Begin(cancellationToken =>
{
switch (trigger)
@@ -47,7 +48,7 @@ public class RightClickMenuCommand : ViewModelCommand<ApplicationViewModel>
{
Thread.Yield();
cancellationToken.ThrowIfCancellationRequested();
contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, false, EBulkType.Properties);
contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, false, EBulkType.Properties | updateUi);
}
break;
case "Assets_Save_Textures":
@@ -55,7 +56,7 @@ public class RightClickMenuCommand : ViewModelCommand<ApplicationViewModel>
{
Thread.Yield();
cancellationToken.ThrowIfCancellationRequested();
contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, false, EBulkType.Textures);
contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, false, EBulkType.Textures | updateUi);
}
break;
case "Assets_Save_Models":
@@ -63,7 +64,7 @@ public class RightClickMenuCommand : ViewModelCommand<ApplicationViewModel>
{
Thread.Yield();
cancellationToken.ThrowIfCancellationRequested();
contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, false, EBulkType.Meshes | EBulkType.Auto);
contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, false, EBulkType.Meshes | updateUi);
}
break;
case "Assets_Save_Animations":
@@ -71,7 +72,7 @@ public class RightClickMenuCommand : ViewModelCommand<ApplicationViewModel>
{
Thread.Yield();
cancellationToken.ThrowIfCancellationRequested();
contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, false, EBulkType.Animations | EBulkType.Auto);
contextViewModel.CUE4Parse.Extract(cancellationToken, asset.FullPath, false, EBulkType.Animations | updateUi);
}
break;
}