forked from ReClassNET/ReClass.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHex16Node.cs
More file actions
37 lines (32 loc) · 1.16 KB
/
Hex16Node.cs
File metadata and controls
37 lines (32 loc) · 1.16 KB
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
using ReClassNET.Memory;
using ReClassNET.UI;
namespace ReClassNET.Nodes
{
public class Hex16Node : BaseHexNode
{
/// <summary>Size of the node in bytes.</summary>
public override int MemorySize => 2;
/// <summary>Gets informations about this node to show in a tool tip.</summary>
/// <param name="spot">The spot.</param>
/// <param name="memory">The process memory.</param>
/// <returns>The information to show in a tool tip.</returns>
public override string GetToolTipText(HotSpot spot, MemoryBuffer memory)
{
var value = memory.ReadObject<UInt16Data>(Offset);
return $"Int16: {value.ShortValue}\nUInt16: 0x{value.UShortValue:X04}";
}
/// <summary>Draws this node.</summary>
/// <param name="view">The view information.</param>
/// <param name="x">The x coordinate.</param>
/// <param name="y">The y coordinate.</param>
/// <returns>The height the node occupies.</returns>
public override int Draw(ViewInfo view, int x, int y)
{
return Draw(view, x, y, Program.Settings.ShowNodeText ? view.Memory.ReadPrintableASCIIString(Offset, 2) + " " : null, 2);
}
public override void Update(HotSpot spot)
{
Update(spot, 2);
}
}
}