v1.4.4.1 (Blood in the Water Update)

This commit is contained in:
Regalis11
2024-04-24 18:09:05 +03:00
parent 89b91d1c3e
commit ff1b8951a7
397 changed files with 15250 additions and 6479 deletions
@@ -14,6 +14,7 @@ namespace Barotrauma
public override void LoadFile()
{
ClearCaches();
XDocument doc = XMLExtensions.TryLoadXml(Path);
if (doc == null)
{
@@ -36,6 +37,15 @@ namespace Barotrauma
public override void UnloadFile()
{
CharacterPrefab.Prefabs.RemoveByFile(this);
ClearCaches();
}
private static void ClearCaches()
{
// Clear the caches to get rid of any overrides.
// Variants should have their own params instances, but let's keep it simple and play safe.
RagdollParams.ClearCache();
AnimationParams.ClearCache();
}
public override void Sort()
@@ -60,11 +70,11 @@ namespace Barotrauma
{
if (humanoid)
{
ragdollParams = RagdollParams.GetRagdollParams<HumanRagdollParams>(speciesName);
ragdollParams = RagdollParams.GetDefaultRagdollParams<HumanRagdollParams>(speciesName, mainElement, ContentPackage);
}
else
{
ragdollParams = RagdollParams.GetRagdollParams<FishRagdollParams>(speciesName);
ragdollParams = RagdollParams.GetDefaultRagdollParams<FishRagdollParams>(speciesName, mainElement, ContentPackage);
}
}
catch (Exception e)
@@ -0,0 +1,16 @@
#nullable enable
namespace Barotrauma
{
internal sealed class ContainerTagFile : GenericPrefabFile<ContainerTagPrefab>
{
public ContainerTagFile(ContentPackage contentPackage, ContentPath path) : base(contentPackage, path) { }
protected override bool MatchesSingular(Identifier identifier) => identifier == "containertag";
protected override bool MatchesPlural(Identifier identifier) => identifier == "containertags";
protected override PrefabCollection<ContainerTagPrefab> Prefabs => ContainerTagPrefab.Prefabs;
protected override ContainerTagPrefab CreatePrefab(ContentXElement element)
=> new(element, this);
}
}
@@ -1,4 +1,4 @@
using System.Collections.Immutable;
using System.Collections.Immutable;
using System.Linq;
using System.Xml.Linq;
@@ -37,7 +37,8 @@ namespace Barotrauma
if (newList.Count != 0) { TextManager.TextPacks.TryAdd(kvp.Key, newList); }
}
TextManager.IncrementLanguageVersion();
if (!TextManager.TextPacks.ContainsKey(GameSettings.CurrentConfig.Language))
if (!TextManager.TextPacks.ContainsKey(GameSettings.CurrentConfig.Language) &&
GameSettings.CurrentConfig.Language != TextManager.DefaultLanguage)
{
DebugConsole.AddWarning($"The language {GameSettings.CurrentConfig.Language} is no longer available. Switching to {TextManager.DefaultLanguage}...");
var config = GameSettings.CurrentConfig;
@@ -65,8 +65,13 @@ namespace Barotrauma
public static void ReloadCore()
{
if (Core == null) { return; }
Core.UnloadContent();
Core.LoadContent();
ReloadPackage(Core);
}
public static void ReloadPackage(ContentPackage p)
{
p.UnloadContent();
p.LoadContent();
SortContent();
}
@@ -22,7 +22,7 @@ namespace Barotrauma
private string? cachedValue;
private string? cachedFullPath;
public string Value
{
get
@@ -107,11 +107,6 @@ namespace Barotrauma
prevCreatedRaw = newRaw;
return newRaw;
}
public static ContentPath FromEvaluated(ContentPackage? contentPackage, string? evaluatedValue)
{
throw new NotImplementedException();
}
private static bool StringEquality(string? a, string? b)
{
@@ -119,8 +114,8 @@ namespace Barotrauma
{
return a.IsNullOrEmpty() == b.IsNullOrEmpty();
}
return string.Equals(Path.GetFullPath(a.CleanUpPathCrossPlatform(false) ?? ""),
Path.GetFullPath(b.CleanUpPathCrossPlatform(false) ?? ""), StringComparison.OrdinalIgnoreCase);
return string.Equals(Path.GetFullPath(a.CleanUpPathCrossPlatform(correctFilenameCase: false) ?? ""),
Path.GetFullPath(b.CleanUpPathCrossPlatform(correctFilenameCase: false) ?? ""), StringComparison.OrdinalIgnoreCase);
}
public static bool operator==(ContentPath a, ContentPath b)
@@ -145,9 +140,9 @@ namespace Barotrauma
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
if (ReferenceEquals(null, obj)) { return false; }
if (ReferenceEquals(this, obj)) { return true; }
if (obj.GetType() != this.GetType()) { return false; }
return Equals((ContentPath)obj);
}