diff --git a/Barotrauma/BarotraumaClient/ClientSource/Screens/SubEditorScreen.cs b/Barotrauma/BarotraumaClient/ClientSource/Screens/SubEditorScreen.cs index 60d3eff907..44a2e3d2cb 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Screens/SubEditorScreen.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Screens/SubEditorScreen.cs @@ -230,7 +230,22 @@ private static string GetSubDescription() private static LocalizedString GetTotalHullVolume() { - return $"{TextManager.Get("TotalHullVolume")}:\n{Hull.HullList.Sum(h => h.Volume)}"; + float totalVolume = 0.0f; + float ballastVolume = 0.0f; + Hull.HullList.ForEach(h => + { + totalVolume += h.Volume; + + if (h.IsBallast()) + { + ballastVolume += h.Volume; + } + }); + + string retVal = $"{TextManager.Get("TotalHullVolume")}:\n{totalVolume}"; + retVal += $" ({(ballastVolume / totalVolume * 100).ToString("0.00")} % {TextManager.Get("roomname.Ballast")})"; + + return retVal; } private static LocalizedString GetSelectedHullVolume() diff --git a/Barotrauma/BarotraumaShared/SharedSource/Map/Hull.cs b/Barotrauma/BarotraumaShared/SharedSource/Map/Hull.cs index 4e87e96d9c..8312bb093a 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Map/Hull.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Map/Hull.cs @@ -1407,6 +1407,11 @@ private void DetermineIsAirlock() IsAirlock = false; } + public bool IsBallast() + { + return roomName != null && roomName.Contains("ballast", StringComparison.OrdinalIgnoreCase); + } + /// /// Does this hull have any doors leading outside? ///