v1.2.6.0 (Winter Update)

This commit is contained in:
Regalis11
2023-12-14 16:11:27 +02:00
parent af8cc89fce
commit b91e85559d
375 changed files with 7771 additions and 2874 deletions
@@ -260,6 +260,12 @@ namespace Barotrauma.Items.Components
if (!hasSoundsOfType[(int)type]) { return; }
if (GameMain.Client?.MidRoundSyncing ?? false) { return; }
//above the top boundary of the level (in an inactive respawn shuttle?)
if (item.Submarine != null && Level.Loaded != null && item.Submarine.WorldPosition.Y > Level.Loaded.Size.Y)
{
return;
}
if (loopingSound != null)
{
if (Vector3.DistanceSquared(GameMain.SoundManager.ListenerPosition, new Vector3(item.WorldPosition, 0.0f)) > loopingSound.Range * loopingSound.Range ||
@@ -388,12 +394,9 @@ namespace Barotrauma.Items.Components
}
}
public void StopSounds(ActionType type)
public void StopLoopingSound()
{
if (loopingSound == null) { return; }
if (loopingSound.Type != type) { return; }
if (loopingSoundChannel != null)
{
loopingSoundChannel.FadeOutAndDispose();
@@ -402,6 +405,12 @@ namespace Barotrauma.Items.Components
}
}
public void StopSounds(ActionType type)
{
if (loopingSound == null || loopingSound.Type != type) { return; }
StopLoopingSound();
}
private float GetSoundVolume(ItemSound sound)
{
if (sound == null) { return 0.0f; }
@@ -497,7 +506,8 @@ namespace Barotrauma.Items.Components
case "guiframe":
if (subElement.GetAttribute("rect") != null)
{
DebugConsole.ThrowError($"Error in item config \"{item.ConfigFilePath}\" - GUIFrame defined as rect, use RectTransform instead.");
DebugConsole.ThrowError($"Error in item config \"{item.ConfigFilePath}\" - GUIFrame defined as rect, use RectTransform instead.",
contentPackage: subElement.ContentPackage);
break;
}
GuiFrameSource = subElement;
@@ -516,7 +526,8 @@ namespace Barotrauma.Items.Components
if (filePath.IsNullOrEmpty())
{
DebugConsole.ThrowError(
$"Error when instantiating item \"{item.Name}\" - sound with no file path set");
$"Error when instantiating item \"{item.Name}\" - sound with no file path set",
contentPackage: subElement.ContentPackage);
break;
}
@@ -528,7 +539,8 @@ namespace Barotrauma.Items.Components
}
catch (Exception e)
{
DebugConsole.ThrowError($"Invalid sound type \"{typeStr}\" in item \"{item.Prefab.Identifier}\"!", e);
DebugConsole.ThrowError($"Invalid sound type \"{typeStr}\" in item \"{item.Prefab.Identifier}\"!", e,
contentPackage: subElement.ContentPackage);
break;
}
@@ -758,6 +770,8 @@ namespace Barotrauma.Items.Components
}
}
public virtual void OnPlayerSkillsChanged() { }
public virtual void AddTooltipInfo(ref LocalizedString name, ref LocalizedString description) { }
}
}