/
DisplayActorsPlugin.cs
46 lines (40 loc) · 1.45 KB
/
DisplayActorsPlugin.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
36
37
38
39
40
41
42
43
44
45
46
using System.Windows.Forms;
using Turbo.Plugins.Default;
namespace Turbo.Plugins.Jack.DevTool
{
public class DisplayActorsPlugin : BasePlugin, IInGameTopPainter
{
public Keys HotKey { get; set; }
public GroundLabelDecorator Decorator { get; set; }
public DisplayActorsPlugin()
{
Enabled = true;
HotKey = Keys.W;
}
public override void Load(IController hud)
{
base.Load(hud);
Decorator = new GroundLabelDecorator(Hud)
{
TextFont = Hud.Render.CreateFont("consolas", 8, 255, 255, 255, 255, false, false, 255, 0, 0, 0, true),
};
}
public void PaintTopInGame(ClipState clipState)
{
if (clipState != ClipState.AfterClip) return;
if (!Hud.Input.IsKeyDown(HotKey)) return;
foreach (var actor in Hud.Game.Actors)
{
var text = string.Format("{0} : {1} {2}\n{3}, {4}, {5}\n{6}",
actor.SnoActor.Sno,
actor.SnoActor.NameLocalized,
actor.SnoActor.Kind,
actor.IsOperated ? "Operated" : "!Operated",
actor.IsClickable ? "Clickable" : "!Clickable",
actor.IsDisabled ? "Disabled" : "!Disabled",
actor.SnoActor.Code);
Decorator.Paint(actor, actor.FloorCoordinate, text);
}
}
}
}