(f0d812055) v0.9.9.0

This commit is contained in:
Joonas Rikkonen
2020-04-23 19:19:37 +03:00
parent b647059b93
commit ac37a3b0e4
391 changed files with 15054 additions and 5420 deletions
@@ -10,9 +10,17 @@ namespace Barotrauma.Items.Components
public void ServerRead(ClientNetObject type, IReadMessage msg, Client c)
{
bool[] elementStates = new bool[customInterfaceElementList.Count];
string[] elementValues = new string[customInterfaceElementList.Count];
for (int i = 0; i < customInterfaceElementList.Count; i++)
{
elementStates[i] = msg.ReadBoolean();
if (!string.IsNullOrEmpty(customInterfaceElementList[i].PropertyName))
{
elementValues[i] = msg.ReadString();
}
else
{
elementStates[i] = msg.ReadBoolean();
}
}
CustomInterfaceElement clickedButton = null;
@@ -20,7 +28,11 @@ namespace Barotrauma.Items.Components
{
for (int i = 0; i < customInterfaceElementList.Count; i++)
{
if (customInterfaceElementList[i].ContinuousSignal)
if (!string.IsNullOrEmpty(customInterfaceElementList[i].PropertyName))
{
TextChanged(customInterfaceElementList[i], elementValues[i]);
}
else if (customInterfaceElementList[i].ContinuousSignal)
{
TickBoxToggled(customInterfaceElementList[i], elementStates[i]);
}
@@ -48,7 +60,11 @@ namespace Barotrauma.Items.Components
//extradata contains an array of buttons clicked by a client (or nothing if nothing was clicked)
for (int i = 0; i < customInterfaceElementList.Count; i++)
{
if (customInterfaceElementList[i].ContinuousSignal)
if (!string.IsNullOrEmpty(customInterfaceElementList[i].PropertyName))
{
msg.Write(customInterfaceElementList[i].Signal);
}
else if(customInterfaceElementList[i].ContinuousSignal)
{
msg.Write(customInterfaceElementList[i].State);
}