Client LuaCsForBarotrauma
BarotraumaClient/ClientSource/Items/Components/Signal/WifiComponent.cs
2 using Microsoft.Xna.Framework;
3 using Microsoft.Xna.Framework.Graphics;
4 
6 {
7  partial class WifiComponent : IDrawableComponent
8  {
9  public Vector2 DrawSize
10  {
11  get { return new Vector2(range * 2); }
12  }
13 
14  public void Draw(SpriteBatch spriteBatch, bool editing, float itemDepth = -1, Color? overrideColor = null)
15  {
16  if (!editing || !MapEntity.SelectedList.Contains(item)) { return; }
17 
18  Vector2 pos = new Vector2(item.DrawPosition.X, -item.DrawPosition.Y);
19  ShapeExtensions.DrawLine(spriteBatch, pos + Vector2.UnitY * range, pos - Vector2.UnitY * range, Color.Cyan * 0.5f, 2);
20  ShapeExtensions.DrawLine(spriteBatch, pos + Vector2.UnitX * range, pos - Vector2.UnitX * range, Color.Cyan * 0.5f, 2);
21  ShapeExtensions.DrawCircle(spriteBatch, pos, range, 32, Color.Cyan * 0.5f, 3);
22  }
23 
24  public void ClientEventRead(IReadMessage msg, float sendingTime)
25  {
26  Channel = msg.ReadRangedInteger(MinChannel, MaxChannel);
27  }
28  }
29 }
virtual Vector2 DrawPosition
Definition: Entity.cs:51
void Draw(SpriteBatch spriteBatch, bool editing, float itemDepth=-1, Color? overrideColor=null)
int ReadRangedInteger(int min, int max)