Skip to content

Commit 9c4a25a

Browse files
committed
Extended NodeClickEventArgs.
1 parent c9d44f9 commit 9c4a25a

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

ReClass.NET/UI/MemoryViewControl.cs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -368,24 +368,13 @@ protected override void OnMouseClick(MouseEventArgs e)
368368

369369
break;
370370
}
371-
else if (hotSpot.Type == HotSpotType.ChangeClassType)
371+
else if (hotSpot.Type == HotSpotType.ChangeClassType || hotSpot.Type == HotSpotType.ChangeWrappedType || hotSpot.Type == HotSpotType.ChangeEnumType)
372372
{
373-
var handler = ChangeClassTypeClick;
374-
handler?.Invoke(this, new NodeClickEventArgs(hitObject, e.Button, e.Location));
373+
var handler = hotSpot.Type == HotSpotType.ChangeClassType
374+
? ChangeClassTypeClick : hotSpot.Type == HotSpotType.ChangeWrappedType
375+
? ChangeWrappedTypeClick : ChangeEnumTypeClick;
375376

376-
break;
377-
}
378-
else if (hotSpot.Type == HotSpotType.ChangeWrappedType)
379-
{
380-
var handler = ChangeWrappedTypeClick;
381-
handler?.Invoke(this, new NodeClickEventArgs(hitObject, e.Button, e.Location));
382-
383-
break;
384-
}
385-
else if (hotSpot.Type == HotSpotType.ChangeEnumType)
386-
{
387-
var handler = ChangeEnumTypeClick;
388-
handler?.Invoke(this, new NodeClickEventArgs(hitObject, e.Button, e.Location));
377+
handler?.Invoke(this, new NodeClickEventArgs(hitObject, hotSpot.Address, hotSpot.Memory, e.Button, e.Location));
389378

390379
break;
391380
}

ReClass.NET/UI/NodeClickEventArgs.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Diagnostics.Contracts;
33
using System.Drawing;
44
using System.Windows.Forms;
5+
using ReClassNET.Memory;
56
using ReClassNET.Nodes;
67

78
namespace ReClassNET.UI
@@ -10,15 +11,22 @@ public class NodeClickEventArgs : EventArgs
1011
{
1112
public BaseNode Node { get; }
1213

14+
public IntPtr Address { get; }
15+
16+
public MemoryBuffer Memory { get; }
17+
1318
public MouseButtons Button { get; }
1419

1520
public Point Location { get; }
1621

17-
public NodeClickEventArgs(BaseNode node, MouseButtons button, Point location)
22+
public NodeClickEventArgs(BaseNode node, IntPtr address, MemoryBuffer memory, MouseButtons button, Point location)
1823
{
1924
Contract.Requires(node != null);
25+
Contract.Requires(memory != null);
2026

2127
Node = node;
28+
Address = address;
29+
Memory = memory;
2230
Button = button;
2331
Location = location;
2432
}

0 commit comments

Comments
 (0)