Unstable 1.1.14.0

This commit is contained in:
Markus Isberg
2023-10-02 16:43:54 +03:00
parent 94f5a93a0c
commit cf8f0de659
606 changed files with 21906 additions and 11456 deletions
@@ -32,17 +32,17 @@ namespace Barotrauma.Items.Components
GameServer.Log(GameServer.CharacterLogName(c.Character) + " entered \"" + newOutputValue + "\" on " + item.Name,
ServerLog.MessageType.ItemInteraction);
OutputValue = newOutputValue;
ShowOnDisplay(newOutputValue, addToHistory: true, TextColor);
ShowOnDisplay(newOutputValue, addToHistory: true, TextColor, isWelcomeMessage: false);
item.SendSignal(newOutputValue, "signal_out");
item.CreateServerEvent(this);
}
}
partial void ShowOnDisplay(string input, bool addToHistory, Color color)
partial void ShowOnDisplay(string input, bool addToHistory, Color color, bool isWelcomeMessage)
{
if (addToHistory)
{
messageHistory.Add(new TerminalMessage(input, color));
messageHistory.Add(new TerminalMessage(input, color, isWelcomeMessage));
while (messageHistory.Count > MaxMessages)
{
messageHistory.RemoveAt(0);
@@ -54,9 +54,11 @@ namespace Barotrauma.Items.Components
{
//split too long messages to multiple parts
int msgIndex = 0;
foreach (var (str, _) in messageHistory)
foreach (var msg in messageHistory)
{
string msgToSend = str;
//the clients create the welcome message themselves, no need to sync it
if (msg.IsWelcomeMessage) { continue; }
string msgToSend = msg.Text;
if (string.IsNullOrEmpty(msgToSend))
{
item.CreateServerEvent(this, new ServerEventData(msgIndex, msgToSend));