(a410fd46c) Trying to help the merge script through a jungle of merges

This commit is contained in:
Joonas Rikkonen
2019-06-04 16:19:53 +03:00
parent 5208b922d8
commit bea7b58ff3
84 changed files with 1720 additions and 929 deletions
@@ -20,6 +20,7 @@ namespace Barotrauma
protected Color textColor;
private string wrappedText;
private string censoredText;
public delegate string TextGetterHandler();
public TextGetterHandler TextGetter;
@@ -175,6 +176,17 @@ namespace Barotrauma
SetTextPos();
}
}
public bool Censor
{
get;
set;
}
public string CensoredText
{
get { return censoredText; }
}
/// <summary>
/// This is the new constructor.
@@ -204,6 +216,8 @@ namespace Barotrauma
RectTransform.ScaleChanged += SetTextPos;
RectTransform.SizeChanged += SetTextPos;
Censor = false;
}
public void CalculateHeightFromText()
@@ -225,13 +239,19 @@ namespace Barotrauma
{
if (text == null) return;
censoredText = "";
for (int i=0;i<text.Length;i++)
{
censoredText += "\u2022";
}
var rect = Rect;
overflowClipActive = false;
wrappedText = text;
TextSize = MeasureText(text);
TextSize = MeasureText(text);
if (Wrap && rect.Width > 0)
{
wrappedText = ToolBox.WrapText(text, rect.Width - padding.X - padding.Z, Font, textScale);
@@ -338,7 +358,7 @@ namespace Barotrauma
}
Font.DrawString(spriteBatch,
Wrap ? wrappedText : text,
Censor ? censoredText : (Wrap ? wrappedText : text),
pos,
textColor * (textColor.A / 255.0f),
0.0f, origin, TextScale,