This commit is contained in:
Asval
2024-05-08 13:56:02 +02:00
parent 967ffefbe0
commit 0b1c4bd4c9
4 changed files with 8 additions and 27 deletions

View File

@@ -156,7 +156,6 @@ public class ApplicationViewModel : ViewModel
await ApplicationService.ThreadWorkerView.Begin(cancellationToken =>
{
CUE4Parse.LoadVfs(cancellationToken, AesManager.AesKeys);
CUE4Parse.Provider.LoadIniConfigs();
AesManager.SetAesKeys();
});
RaisePropertyChanged(nameof(GameDisplayName));

View File

@@ -312,6 +312,7 @@ public class CUE4ParseViewModel : ViewModel
if (k.Length != 66) k = Constants.ZERO_64_CHAR;
Provider.SubmitKey(key.Guid, new FAesKey(k));
}
Provider.PostMount();
// files in MountedVfs will be enabled
foreach (var file in GameDirectory.DirectoryFiles)
@@ -437,34 +438,15 @@ public class CUE4ParseViewModel : ViewModel
});
}
private bool _cvaVerifDone { get; set; }
public Task VerifyConsoleVariables()
{
if (_cvaVerifDone)
return Task.CompletedTask;
return Task.Run(() =>
if (Provider.Versions["StripAdditiveRefPose"])
{
foreach (var token in Provider.DefaultEngine.Sections.FirstOrDefault(s => s.Name == "ConsoleVariables")?.Tokens ?? new List<IniToken>())
{
if (token is not InstructionToken it) continue;
var boolValue = it.Value.Equals("1");
FLogger.Append(ELog.Warning, () =>
FLogger.Text("Additive animations have their reference pose stripped, which will lead to inaccurate preview and export", Constants.WHITE, true));
}
switch (it.Key)
{
case "a.StripAdditiveRefPose" when boolValue:
FLogger.Append(ELog.Warning, () =>
FLogger.Text("Additive animations have their reference pose stripped, which will lead to inaccurate preview and export", Constants.WHITE, true));
continue;
case "r.StaticMesh.KeepMobileMinLODSettingOnDesktop":
case "r.SkeletalMesh.KeepMobileMinLODSettingOnDesktop":
Provider.Versions[it.Key[2..]] = boolValue;
continue;
}
}
_cvaVerifDone = true;
});
return Task.CompletedTask;
}
public Task VerifyOnDemandArchives()

View File

@@ -38,7 +38,7 @@ public class LoadCommand : ViewModelCommand<LoadingModesViewModel>
public override async void Execute(LoadingModesViewModel contextViewModel, object parameter)
{
if (_applicationView.CUE4Parse.GameDirectory.HasNoFile) return;
if (_applicationView.CUE4Parse.Provider.Files.Count <= 0)
if (_applicationView.CUE4Parse.Provider.Keys.Count == 0 && _applicationView.CUE4Parse.Provider.RequiredKeys.Count > 0)
{
FLogger.Append(ELog.Error, () =>
FLogger.Text("An encrypted archive has been found. In order to decrypt it, please specify a working AES encryption key", Constants.WHITE, true));