v0.13.0.11
This commit is contained in:
@@ -321,6 +321,7 @@ namespace Barotrauma
|
||||
float prevSize = chatBox.BarSize;
|
||||
|
||||
string displayedText = message.TranslatedText;
|
||||
|
||||
string senderName = "";
|
||||
Color senderColor = Color.White;
|
||||
if (!string.IsNullOrWhiteSpace(message.SenderName))
|
||||
@@ -377,13 +378,29 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
var msgText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), msgHolder.RectTransform)
|
||||
{ AbsoluteOffset = new Point((int)(10 * GUI.Scale), senderNameTimestamp == null ? 0 : senderNameTimestamp.Rect.Height) },
|
||||
{ AbsoluteOffset = new Point((int)(10 * GUI.Scale), senderNameTimestamp == null ? 0 : senderNameTimestamp.Rect.Height) },
|
||||
displayedText, textColor: message.Color, font: GUI.SmallFont, textAlignment: Alignment.TopLeft, style: null, wrap: true,
|
||||
color: ((chatBox.Content.CountChildren % 2) == 0) ? Color.Transparent : Color.Black * 0.1f)
|
||||
color: ((chatBox.Content.CountChildren % 2) == 0) ? Color.Transparent : Color.Black * 0.1f, parseRichText: true)
|
||||
{
|
||||
UserData = message.SenderName,
|
||||
CanBeFocused = true
|
||||
CanBeFocused = false
|
||||
};
|
||||
msgText.CalculateHeightFromText();
|
||||
if (msgText.RichTextData != null)
|
||||
{
|
||||
foreach (var data in msgText.RichTextData)
|
||||
{
|
||||
var clickableArea = new GUITextBlock.ClickableArea()
|
||||
{
|
||||
Data = data
|
||||
};
|
||||
if (GameMain.NetLobbyScreen != null && GameMain.NetworkMember != null)
|
||||
{
|
||||
clickableArea.OnClick = GameMain.NetLobbyScreen.SelectPlayer;
|
||||
}
|
||||
msgText.ClickableAreas.Add(clickableArea);
|
||||
}
|
||||
}
|
||||
|
||||
if (message is OrderChatMessage orderChatMsg &&
|
||||
Character.Controlled != null &&
|
||||
@@ -444,7 +461,7 @@ namespace Barotrauma
|
||||
senderText.RectTransform.MinSize = new Point(0, senderText.Rect.Height);
|
||||
}
|
||||
var msgPopupText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), content.RectTransform),
|
||||
displayedText, textColor: message.Color, font: GUI.SmallFont, textAlignment: Alignment.BottomLeft, style: null, wrap: true)
|
||||
displayedText, textColor: message.Color, font: GUI.SmallFont, textAlignment: Alignment.BottomLeft, style: null, wrap: true, parseRichText: true)
|
||||
{
|
||||
CanBeFocused = false
|
||||
};
|
||||
@@ -523,6 +540,7 @@ namespace Barotrauma
|
||||
|
||||
if (ToggleButton != null)
|
||||
{
|
||||
ToggleButton.Selected = ToggleOpen;
|
||||
ToggleButton.RectTransform.AbsoluteOffset = new Point(GUIFrame.Rect.Right, GUIFrame.Rect.Y + HUDLayoutSettings.ChatBoxArea.Height - ToggleButton.Rect.Height);
|
||||
}
|
||||
|
||||
@@ -566,6 +584,7 @@ namespace Barotrauma
|
||||
|
||||
if (ToggleOpen)
|
||||
{
|
||||
GUIFrame.CanBeFocused = true;
|
||||
openState += deltaTime * 5.0f;
|
||||
//delete all popup messages when the chatbox is open
|
||||
foreach (var popupMsg in popupMessages)
|
||||
@@ -576,6 +595,7 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
GUIFrame.CanBeFocused = false;
|
||||
openState -= deltaTime * 5.0f;
|
||||
|
||||
int yOffset = 0;
|
||||
|
||||
Reference in New Issue
Block a user