diff --git a/CUE4Parse b/CUE4Parse index 8713445a..0f442379 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 8713445a76718e26f58d1a85d9dab114979d1bfc +Subproject commit 0f442379903ce789dfef2ed2c784120525036b81 diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 3ef8fd61..fc12685d 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -137,7 +137,7 @@ public class CUE4ParseViewModel : ViewModel private Lazy _wwiseProviderLazy; public WwiseProvider WwiseProvider => _wwiseProviderLazy.Value; private Lazy _fmodProviderLazy; - public FModProvider FmodProvider => _fmodProviderLazy?.Value; + public FModProvider FmodProvider => _fmodProviderLazy?.Value; private Lazy _criWareProviderLazy; public CriWareProvider CriWareProvider => _criWareProviderLazy?.Value; public ConcurrentBag UnknownExtensions = []; @@ -293,7 +293,7 @@ public class CUE4ParseViewModel : ViewModel Provider.Initialize(); _wwiseProviderLazy = new Lazy(() => new WwiseProvider(Provider, UserSettings.Default.WwiseMaxBnkPrefetch)); - _fmodProviderLazy = new Lazy(() => new FModProvider(Provider, UserSettings.Default.GameDirectory)); + _fmodProviderLazy = new Lazy(() => new FModProvider(Provider, UserSettings.Default.GameDirectory)); _criWareProviderLazy = new Lazy(() => new CriWareProvider(Provider, UserSettings.Default.GameDirectory)); Log.Information($"{Provider.Versions.Game} ({Provider.Versions.Platform}) | Archives: x{Provider.UnloadedVfs.Count} | AES: x{Provider.RequiredKeys.Count} | Loose Files: x{Provider.Files.Count}"); }); @@ -648,6 +648,7 @@ public class CUE4ParseViewModel : ViewModel case "dnearchive": // Banishers: Ghosts of New Eden case "gitignore": case "LICENSE": + case "playstats": // Dispatch case "template": case "stUMeta": // LIS: Double Exposure case "vmodule": @@ -775,38 +776,38 @@ public class CUE4ParseViewModel : ViewModel } break; - } - case "awb": - { - var archive = entry.CreateReader(); - var awbReader = new AwbReader(archive); - - TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(awbReader, Formatting.Indented), saveProperties, updateUi); - - var directory = Path.GetDirectoryName(archive.Name) ?? "/Criware/"; - var extractedSounds = CriWareProvider.ExtractCriWareSounds(awbReader, archive.Name); - foreach (var sound in extractedSounds) - { - SaveAndPlaySound(Path.Combine(directory, sound.Name), sound.Extension, sound.Data, saveAudio); - } - - break; - } - case "acb": - { - var archive = entry.CreateReader(); - var acbReader = new AcbReader(archive); - - TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(acbReader, Formatting.Indented), saveProperties, updateUi); - - var directory = Path.GetDirectoryName(archive.Name) ?? "/Criware/"; - var extractedSounds = CriWareProvider.ExtractCriWareSounds(acbReader, archive.Name); - foreach (var sound in extractedSounds) - { - SaveAndPlaySound(Path.Combine(directory, sound.Name), sound.Extension, sound.Data, saveAudio); - } - - break; + } + case "awb": + { + var archive = entry.CreateReader(); + var awbReader = new AwbReader(archive); + + TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(awbReader, Formatting.Indented), saveProperties, updateUi); + + var directory = Path.GetDirectoryName(archive.Name) ?? "/Criware/"; + var extractedSounds = CriWareProvider.ExtractCriWareSounds(awbReader, archive.Name); + foreach (var sound in extractedSounds) + { + SaveAndPlaySound(Path.Combine(directory, sound.Name), sound.Extension, sound.Data, saveAudio); + } + + break; + } + case "acb": + { + var archive = entry.CreateReader(); + var acbReader = new AcbReader(archive); + + TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(acbReader, Formatting.Indented), saveProperties, updateUi); + + var directory = Path.GetDirectoryName(archive.Name) ?? "/Criware/"; + var extractedSounds = CriWareProvider.ExtractCriWareSounds(acbReader, archive.Name); + foreach (var sound in extractedSounds) + { + SaveAndPlaySound(Path.Combine(directory, sound.Name), sound.Extension, sound.Data, saveAudio); + } + + break; } case "xvag": case "flac": @@ -1032,27 +1033,27 @@ public class CUE4ParseViewModel : ViewModel SaveAndPlaySound(Path.Combine(directory, sound.Name), sound.Extension, sound.Data, saveAudio); } return false; - } - case USoundAtomCueSheet or UAtomCueSheet or USoundAtomCue or UAtomWaveBank when (isNone || saveAudio) && pointer.Object.Value is UObject atomObject: - { - var extractedSounds = atomObject switch - { - USoundAtomCueSheet cueSheet => CriWareProvider.ExtractCriWareSounds(cueSheet), - UAtomCueSheet cueSheet => CriWareProvider.ExtractCriWareSounds(cueSheet), - USoundAtomCue cue => CriWareProvider.ExtractCriWareSounds(cue), - UAtomWaveBank awb => CriWareProvider.ExtractCriWareSounds(awb), - _ => [] - }; - - var directory = Path.GetDirectoryName(atomObject.Owner?.Name) ?? "/Criware/"; - directory = Path.GetDirectoryName(atomObject.Owner.Provider.FixPath(directory)); - foreach (var sound in extractedSounds) - { - SaveAndPlaySound(Path.Combine(directory, sound.Name).Replace("\\", "/"), sound.Extension, sound.Data, saveAudio); - } - return false; - } - case UAkMediaAssetData when isNone || saveAudio: + } + case USoundAtomCueSheet or UAtomCueSheet or USoundAtomCue or UAtomWaveBank when (isNone || saveAudio) && pointer.Object.Value is UObject atomObject: + { + var extractedSounds = atomObject switch + { + USoundAtomCueSheet cueSheet => CriWareProvider.ExtractCriWareSounds(cueSheet), + UAtomCueSheet cueSheet => CriWareProvider.ExtractCriWareSounds(cueSheet), + USoundAtomCue cue => CriWareProvider.ExtractCriWareSounds(cue), + UAtomWaveBank awb => CriWareProvider.ExtractCriWareSounds(awb), + _ => [] + }; + + var directory = Path.GetDirectoryName(atomObject.Owner?.Name) ?? "/Criware/"; + directory = Path.GetDirectoryName(atomObject.Owner.Provider.FixPath(directory)); + foreach (var sound in extractedSounds) + { + SaveAndPlaySound(Path.Combine(directory, sound.Name).Replace("\\", "/"), sound.Extension, sound.Data, saveAudio); + } + return false; + } + case UAkMediaAssetData when isNone || saveAudio: case USoundWave when isNone || saveAudio: { var shouldDecompress = UserSettings.Default.CompressedAudioMode == ECompressedAudio.PlayDecompressed; @@ -1273,4 +1274,4 @@ public class CUE4ParseViewModel : ViewModel { return (a & b) == b; } -} +} diff --git a/FModel/Views/Snooper/Options.cs b/FModel/Views/Snooper/Options.cs index 7b4f434b..aa821f8f 100644 --- a/FModel/Views/Snooper/Options.cs +++ b/FModel/Views/Snooper/Options.cs @@ -240,6 +240,18 @@ public class Options Services.ApplicationService.ApplicationView.CUE4Parse.ModelIsWaitingAnimation = value; } + /// + /// Skip emmisive for specific games, cause of excessive use in their materials + /// + public bool SkipEmmisive() + { + return _game switch + { + "LIESOFP" => true, + _ => false, + }; + } + public void ResetModelsLightsAnimations() { foreach (var model in Models.Values) diff --git a/FModel/Views/Snooper/Shading/Material.cs b/FModel/Views/Snooper/Shading/Material.cs index a6114ab6..c36fcbfe 100644 --- a/FModel/Views/Snooper/Shading/Material.cs +++ b/FModel/Views/Snooper/Shading/Material.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Numerics; @@ -121,10 +121,15 @@ public class Material : IDisposable RoughnessMax = roughness + d; } - if (Parameters.TryGetScalar(out var emissiveMultScalar, "emissive mult", "Emissive_Mult", "EmissiveIntensity", "EmissionIntensity")) - EmissiveMult = emissiveMultScalar; - else if (Parameters.TryGetLinearColor(out var emissiveMultColor, "Emissive Multiplier", "EmissiveMultiplier")) - EmissiveMult = emissiveMultColor.R; + if (!options.SkipEmmisive()) + { + if (Parameters.TryGetScalar(out var emissiveMultScalar, "emissive mult", "Emissive_Mult", "EmissiveIntensity", "EmissionIntensity")) + EmissiveMult = emissiveMultScalar; + else if (Parameters.TryGetLinearColor(out var emissiveMultColor, "Emissive Multiplier", "EmissiveMultiplier")) + EmissiveMult = emissiveMultColor.R; + } + else + EmissiveMult = 0f; if (Parameters.TryGetLinearColor(out var EmissiveUVs, "EmissiveUVs_RG_UpperLeftCorner_BA_LowerRightCorner",