Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Draw()

void Terraria.Map.PingMapLayer.Draw ( ref MapOverlayDrawContext context,
ref string text )
inline

Implements Terraria.Map.IMapLayer.

Definition at line 32 of file PingMapLayer.cs.

33 {
34 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
35 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
36 //IL_0024: Unknown result type (might be due to invalid IL or missing references)
37 //IL_0090: Unknown result type (might be due to invalid IL or missing references)
38 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
39 SpriteFrame frame = new SpriteFrame(1, 5);
42 {
43 Ping value = item.Value;
44 double totalSeconds = (now - value.Time).TotalSeconds;
45 int num = (int)(totalSeconds * 10.0);
46 frame.CurrentRow = (byte)(num % frame.RowCount);
47 context.Draw(TextureAssets.MapPing.Value, value.Position, frame, Alignment.Center);
48 if (totalSeconds > 15.0)
49 {
50 _pings.Remove(item.Id);
51 }
52 }
53 }
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
static Asset< Texture2D > MapPing
readonly SlotVector< Ping > _pings
static DateTime Now
Definition DateTime.cs:103
static readonly Alignment Center
Definition Alignment.cs:15

References Terraria.Map.PingMapLayer._pings, Terraria.UI.Alignment.Center, System.item, Terraria.GameContent.TextureAssets.MapPing, System.DateTime.Now, System.Collections.Generic.Dictionary< TKey, TValue >.Remove(), and System.value.