Skip to content

Commit 8468a62

Browse files
committed
Added Encoding property.
1 parent 652e149 commit 8468a62

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

ReClass.NET/Nodes/BaseTextNode.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Diagnostics.Contracts;
33
using System.Drawing;
4+
using System.Text;
45
using ReClassNET.UI;
56
using ReClassNET.Util;
67

@@ -17,6 +18,8 @@ public abstract class BaseTextNode : BaseNode
1718
/// <summary>Size of one character in bytes.</summary>
1819
public abstract int CharacterSize { get; }
1920

21+
public abstract Encoding Encoding { get; }
22+
2023
public override void CopyFromNode(BaseNode node)
2124
{
2225
Length = node.MemorySize / CharacterSize;
@@ -50,7 +53,7 @@ protected Size DrawText(ViewInfo view, int x, int y, string type, int length, st
5053
x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "]") + view.Font.Width;
5154

5255
x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "= '");
53-
x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, text.LimitLength(150));
56+
x = AddText(view, x, y, view.Settings.TextColor, 1, text.LimitLength(150));
5457
x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, "'") + view.Font.Width;
5558

5659
x = AddComment(view, x, y);

ReClass.NET/Nodes/UTF16TextNode.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Drawing;
2+
using System.Text;
23
using ReClassNET.Memory;
34
using ReClassNET.UI;
45

@@ -8,6 +9,8 @@ public class Utf16TextNode : BaseTextNode
89
{
910
public override int CharacterSize => 2;
1011

12+
public override Encoding Encoding => Encoding.Unicode;
13+
1114
/// <summary>Draws this node.</summary>
1215
/// <param name="view">The view information.</param>
1316
/// <param name="x">The x coordinate.</param>

ReClass.NET/Nodes/UTF32TextNode.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Drawing;
2+
using System.Text;
23
using ReClassNET.Memory;
34
using ReClassNET.UI;
45

@@ -8,6 +9,8 @@ public class Utf32TextNode : BaseTextNode
89
{
910
public override int CharacterSize => 4;
1011

12+
public override Encoding Encoding => Encoding.UTF32;
13+
1114
/// <summary>Draws this node.</summary>
1215
/// <param name="view">The view information.</param>
1316
/// <param name="x">The x coordinate.</param>

ReClass.NET/Nodes/UTF8TextNode.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Drawing;
2+
using System.Text;
23
using ReClassNET.Memory;
34
using ReClassNET.UI;
45

@@ -8,6 +9,8 @@ public class Utf8TextNode : BaseTextNode
89
{
910
public override int CharacterSize => 1;
1011

12+
public override Encoding Encoding => Encoding.UTF8;
13+
1114
/// <summary>Draws this node.</summary>
1215
/// <param name="view">The view information.</param>
1316
/// <param name="x">The x coordinate.</param>

0 commit comments

Comments
 (0)