From ebf7273cbe7b92be3e98fede5cc3bb7c0970f7f4 Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 19 Jan 2015 01:39:47 +0000 Subject: [PATCH] Hex Editor - open poke dialog in a logical location, update the hex editor when Poke is clicked on the Poke pop up dialog --- BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs | 3 ++- BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs index 4f1ef677c9..bf2f8d55a2 100644 --- a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs +++ b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs @@ -1458,7 +1458,8 @@ namespace BizHawk.Client.EmuHawk { var poke = new RamPoke { - InitialLocation = GetAddressCoordinates(addresses[0]) + InitialLocation = PointToScreen(GetAddressCoordinates(addresses[0])), + ParentTool = this }; var watches = addresses.Select( diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs index c1427f8dcd..6d3f942cdb 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs @@ -20,6 +20,8 @@ namespace BizHawk.Client.EmuHawk InitializeComponent(); } + public IToolForm ParentTool { get; set; } + public void SetWatch(IEnumerable watches) { _watchList = watches.ToList(); @@ -86,6 +88,11 @@ namespace BizHawk.Client.EmuHawk private void Ok_Click(object sender, EventArgs e) { var success = _watchList.All(watch => watch.Poke(ValueBox.Text)); + if (ParentTool != null) + { + ParentTool.UpdateValues(); + } + OutputLabel.Text = success ? "Value successfully written." : "An error occured when writing Value."; }