v1.4.4.1 (Blood in the Water Update)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#nullable enable
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
internal readonly struct NetLimitedString
|
||||
{
|
||||
public readonly string Value;
|
||||
public const int MaxLength = 255;
|
||||
|
||||
public static readonly NetLimitedString Empty = new(string.Empty);
|
||||
|
||||
public NetLimitedString(string value)
|
||||
{
|
||||
Value = value.Length > MaxLength
|
||||
? value[..MaxLength]
|
||||
: value;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
=> Value;
|
||||
}
|
||||
}
|
||||
@@ -639,6 +639,9 @@ namespace Barotrauma
|
||||
if (o is null) { throw new ArgumentNullException(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a percentage value in the 0-1 range to a string representation in the format "x %" according to the grammar rules of the selected language
|
||||
/// </summary>
|
||||
public static string GetFormattedPercentage(float v)
|
||||
{
|
||||
return TextManager.GetWithVariable("percentageformat", "[value]", ((int)MathF.Round(v * 100)).ToString()).Value;
|
||||
|
||||
Reference in New Issue
Block a user