v1.4.4.1 (Blood in the Water Update)
This commit is contained in:
@@ -131,6 +131,13 @@ namespace Barotrauma
|
||||
[Serialize("", IsPropertySaveable.Yes, description: "Identifier of the outpost generation parameters that should be used if this outpost has become critically irradiated."), Editable]
|
||||
public string ReplaceInRadiation { get; set; }
|
||||
|
||||
[Serialize(false, IsPropertySaveable.Yes, description: "By default, sonar only shows the outline of the sub/outpost from the outside. Enable this if you want to see each structure individually."), Editable]
|
||||
public bool AlwaysShowStructuresOnSonar
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public ContentPath OutpostFilePath { get; set; }
|
||||
|
||||
public class ModuleCount
|
||||
|
||||
@@ -238,8 +238,7 @@ namespace Barotrauma
|
||||
foreach (Hull hull in Hull.HullList)
|
||||
{
|
||||
if (hull.Submarine != sub) { continue; }
|
||||
if (string.IsNullOrEmpty(hull.RoomName) ||
|
||||
hull.RoomName.Contains("RoomName.", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.IsNullOrEmpty(hull.RoomName))
|
||||
{
|
||||
hull.RoomName = hull.CreateRoomName();
|
||||
}
|
||||
@@ -877,16 +876,16 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
if (availableModules.Count() == 0) { return null; }
|
||||
if (!availableModules.Any()) { return null; }
|
||||
|
||||
//try to search for modules made specifically for this location type first
|
||||
var modulesSuitableForLocationType =
|
||||
availableModules.Where(m => m.OutpostModuleInfo.AllowedLocationTypes.Contains(locationType.Identifier));
|
||||
availableModules.Where(m => m.OutpostModuleInfo.IsAllowedInLocationType(locationType));
|
||||
|
||||
//if not found, search for modules suitable for any location type
|
||||
if (!modulesSuitableForLocationType.Any())
|
||||
{
|
||||
modulesSuitableForLocationType = availableModules.Where(m => !m.OutpostModuleInfo.AllowedLocationTypes.Any());
|
||||
modulesSuitableForLocationType = availableModules.Where(m => m.OutpostModuleInfo.IsAllowedInAnyLocationType());
|
||||
}
|
||||
|
||||
if (!modulesSuitableForLocationType.Any())
|
||||
@@ -956,11 +955,12 @@ namespace Barotrauma
|
||||
{
|
||||
if (disallowNonLocationTypeSpecific)
|
||||
{
|
||||
//don't use OutpostModuleInfo.IsLocationTypeAllowed here - we're trying to choose a module specifically for this location type, not modules suitable for any location type
|
||||
suitable = modules.Where(m => m.OutpostModuleInfo.AllowedLocationTypes.Contains(locationType.Identifier));
|
||||
}
|
||||
else
|
||||
{
|
||||
suitable = modules.Where(m => m.OutpostModuleInfo.AllowedLocationTypes.Contains(locationType.Identifier) || !m.OutpostModuleInfo.AllowedLocationTypes.Any());
|
||||
suitable = modules.Where(m => m.OutpostModuleInfo.IsAllowedInLocationType(locationType));
|
||||
}
|
||||
}
|
||||
if (requireAllowAttachToPrevious && prevModule != null)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Barotrauma.Items.Components;
|
||||
using Barotrauma.Extensions;
|
||||
using Barotrauma.Items.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -132,6 +133,16 @@ namespace Barotrauma
|
||||
this.allowedLocationTypes.Add(locationType);
|
||||
}
|
||||
}
|
||||
public bool IsAllowedInAnyLocationType()
|
||||
{
|
||||
return allowedLocationTypes.None() || allowedLocationTypes.Contains("Any".ToIdentifier());
|
||||
}
|
||||
|
||||
public bool IsAllowedInLocationType(LocationType locationType)
|
||||
{
|
||||
if (locationType == null || IsAllowedInAnyLocationType()) { return true; }
|
||||
return allowedLocationTypes.Contains(locationType.Identifier);
|
||||
}
|
||||
|
||||
public void DetermineGapPositions(Submarine sub)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user