NHSE/NHSE.WinForms/Subforms/SysBot/SimpleHexEditor.cs
Kurt 0ce31ca895 Stash
Code now compiles, but will need to test and bugfix extensively.
Need to pre-fill the pixel buffers with sea first unless the acre fill actually works (maybe?)
Items need to be relative'd to apply 1 row lower, and skip the bottom row.
Need to check that terrain is the same as well.

Note to self:
For Map - probably better to get a starting x,y,width and iterate off that, fetching tile from relative, converting to absolute... idk.
For View - need to check if tile is in layer.
2026-01-19 23:12:59 -06:00

27 lines
702 B
C#

using System;
using System.Linq;
using System.Windows.Forms;
using NHSE.Core;
namespace NHSE.WinForms;
public partial class SimpleHexEditor : Form
{
public byte[] Bytes;
public SimpleHexEditor(byte[] originalBytes)
{
InitializeComponent();
this.TranslateInterface(GameInfo.CurrentLanguage);
RTB_RAM.Text = string.Join(" ", originalBytes.Select(z => $"{z:X2}"));
Bytes = originalBytes;
}
private void Update_Click(object sender, EventArgs e)
{
var bytestring = RTB_RAM.Text.Replace("\t", "").Replace(" ", "").Trim();
Bytes = Convert.FromHexString(bytestring);
DialogResult = DialogResult.OK;
Close();
}
}