-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPingMod.cs
35 lines (29 loc) · 937 Bytes
/
PingMod.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace PingMod
{
public class PingMod : Mod
{
public static event Action OnPostDrawInterface;
public static event Action OnPostDrawFullscreenMap;
private Projectile _ping;
public override void PostUpdateEverything()
{
if (Main.playerLoaded && (_ping == null || !_ping.active))
{
_ping = Projectile.NewProjectileDirect(Main.MouseWorld, Vector2.Zero, ModContent.ProjectileType<Ping>(), 0, 0, Main.myPlayer);
}
}
public override void PostDrawInterface(SpriteBatch spriteBatch)
{
OnPostDrawInterface?.Invoke();
}
public override void PostDrawFullscreenMap(ref string mouseText)
{
OnPostDrawFullscreenMap?.Invoke();
}
}
}