Client LuaCsForBarotrauma
BarotraumaShared/SharedSource/Items/Components/ItemLabel.cs
2 using Microsoft.Xna.Framework;
3 
5 {
7  {
8  public Vector2 DrawSize
9  {
10  //use the extents of the item as the draw size
11  get { return Vector2.Zero; }
12  }
13 
14  partial void OnStateChanged();
15 
16  private string prevColorSignal;
17 
18  public override void ReceiveSignal(Signal signal, Connection connection)
19  {
20  switch (connection.Name)
21  {
22  case "set_text":
23  if (Text == signal.value) { return; }
24  Text = signal.value;
25  OnStateChanged();
26  break;
27  case "set_text_color":
28  if (signal.value != prevColorSignal)
29  {
30  TextColor = XMLExtensions.ParseColor(signal.value, false);
31  prevColorSignal = signal.value;
32  }
33  break;
34  }
35  }
36  }
37 }
The base class for components holding the different functionalities of the item
override void ReceiveSignal(Signal signal, Connection connection)
Interface for entities that the server can send events to the clients