mirror of
https://github.com/4sval/FModel.git
synced 2026-03-22 01:34:37 -05:00
Too long audio path fix
This commit is contained in:
parent
0d9a2a34e9
commit
7581310ef3
|
|
@ -921,8 +921,17 @@ public class CUE4ParseViewModel : ViewModel
|
|||
var wemId = soundSfx.SourceId;
|
||||
if (wwiseReader.WwiseEncodedMedias.TryGetValue(wemId.ToString(), out var wemData))
|
||||
{
|
||||
var debugName = kvp.Value.Value.DebugName.ToString();
|
||||
var outputPath = Path.Combine(audioEventPath.Replace($".{debugName}", ""), $"{debugName.Replace('\\', '/')} ({wemId})");
|
||||
var debugName = kvp.Value.Value.DebugName.ToString();
|
||||
var fileName = $"{debugName.Replace('\\', '/')} ({wemId})";
|
||||
var outputPath = Path.Combine(audioEventPath.Replace($".{debugName}", ""), fileName);
|
||||
|
||||
// If file path is too long, audio player will fail
|
||||
if (outputPath.StartsWith('/')) outputPath = outputPath[1..];
|
||||
if (Path.Combine(UserSettings.Default.AudioDirectory, outputPath).Length >= 250)
|
||||
{
|
||||
outputPath = Path.Combine(projectName, fileName);
|
||||
}
|
||||
|
||||
SaveAndPlaySound(outputPath, "WEM", wemData);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user