-
Notifications
You must be signed in to change notification settings - Fork 396
Expand file tree
/
Copy pathDoubleNode.cs
More file actions
42 lines (36 loc) · 940 Bytes
/
DoubleNode.cs
File metadata and controls
42 lines (36 loc) · 940 Bytes
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
using System.Drawing;
using ReClassNET.Controls;
using ReClassNET.Extensions;
using ReClassNET.Memory;
using ReClassNET.UI;
namespace ReClassNET.Nodes
{
public class DoubleNode : BaseNumericNode
{
public override int MemorySize => 8;
public override void GetUserInterfaceInfo(out string name, out Image icon)
{
name = "Double";
icon = Properties.Resources.B16x16_Button_Double;
}
public override Size Draw(DrawContext context, int x, int y)
{
return DrawNumeric(context, x, y, context.IconProvider.Double, "Double", ReadValueFromMemory(context.Memory).ToString("0.000"), null);
}
public override void Update(HotSpot spot)
{
base.Update(spot);
if (spot.Id == 0)
{
if (double.TryParse(spot.Text, out var val))
{
spot.Process.WriteRemoteMemory(spot.Address, val);
}
}
}
public double ReadValueFromMemory(MemoryBuffer memory)
{
return memory.ReadDouble(Offset);
}
}
}