- Fixed creature disable list only taking config files in the Content/Characters folder into account (making it impossible to disable spawning of custom monsters outside the folder)
- Removed hard-coded ruin structure, particle & decal config paths and moved them to content package (custom ones can be added now without modifying the original files).
This commit is contained in:
@@ -8,22 +8,25 @@ namespace Barotrauma.Particles
|
||||
{
|
||||
private Dictionary<string, DecalPrefab> prefabs;
|
||||
|
||||
public DecalManager(string configFile)
|
||||
public DecalManager()
|
||||
{
|
||||
XDocument doc = XMLExtensions.TryLoadXml(configFile);
|
||||
if (doc == null || doc.Root == null) return;
|
||||
|
||||
prefabs = new Dictionary<string, DecalPrefab>();
|
||||
|
||||
foreach (XElement element in doc.Root.Elements())
|
||||
foreach (string configFile in GameMain.Config.SelectedContentPackage.GetFilesOfType(ContentType.Decals))
|
||||
{
|
||||
if (prefabs.ContainsKey(element.Name.ToString()))
|
||||
XDocument doc = XMLExtensions.TryLoadXml(configFile);
|
||||
if (doc == null || doc.Root == null) continue;
|
||||
|
||||
foreach (XElement element in doc.Root.Elements())
|
||||
{
|
||||
DebugConsole.ThrowError("Error in " + configFile + "! Each decal prefab must have a unique name.");
|
||||
continue;
|
||||
if (prefabs.ContainsKey(element.Name.ToString()))
|
||||
{
|
||||
DebugConsole.ThrowError("Error in " + configFile + "! Each decal prefab must have a unique name.");
|
||||
continue;
|
||||
}
|
||||
prefabs.Add(element.Name.ToString(), new DecalPrefab(element));
|
||||
}
|
||||
prefabs.Add(element.Name.ToString(), new DecalPrefab(element));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Decal CreateDecal(string decalName, float scale, Vector2 worldPosition, Hull hull)
|
||||
|
||||
Reference in New Issue
Block a user