Release 1.9.7.0 - Summer Update 2025

This commit is contained in:
Regalis11
2025-06-17 16:38:11 +03:00
parent 22227f13e5
commit ea5a2bc693
297 changed files with 7344 additions and 2421 deletions
@@ -29,6 +29,15 @@ namespace Barotrauma
Volume = element.GetAttributeFloat("volume", 1.0f);
IgnoreMuffling = element.GetAttributeBool("dontmuffle", false);
MuteBackgroundMusic = element.GetAttributeBool("MuteBackgroundMusic", false);
if (!Stream && Sound.DurationSeconds > 60.0f)
{
DebugConsole.AddWarning(
$"Potential issue in content package: a large audio clip \"{System.IO.Path.GetFileName(Filename)}\" is set to be loaded into memory instead of streaming it from the disk. "+
"This can lead to excessive memory usage. Large clips should generally be streamed, while small and frequently played sounds should be loaded to memory to avoid the IO overhead of streaming. "+
"Consider adding stream=\"true\" to the sound's XML element.",
contentPackage: element.ContentPackage);
}
FrequencyMultiplierRange = new Vector2(1.0f);
string freqMultAttr = element.GetAttributeString("frequencymultiplier", element.GetAttributeString("frequency", "1.0"));
@@ -61,10 +70,11 @@ namespace Barotrauma
private static readonly List<RoundSound> roundSounds = new List<RoundSound>();
private static readonly Dictionary<string, RoundSound> roundSoundByPath = new Dictionary<string, RoundSound>();
public static RoundSound? Load(ContentXElement element, bool stream = false)
public static RoundSound? Load(ContentXElement element)
{
if (GameMain.SoundManager?.Disabled ?? true) { return null; }
bool stream = element.GetAttributeBool(nameof(Stream), false);
var filename = element.GetAttributeContentPath("file") ?? element.GetAttributeContentPath("sound");
if (filename is null)
{