NHSE/NHSE.WinForms/Subforms/SysBot/SimpleHexEditor.cs
Kurt b88c518d5c
Update FieldItemEditor for 3.0.0 (#716)
Updates the Field Item Editor to render layers based on the entire map, and the per-patch positioning of each layer.
Import/export will gracefully handle upgrade/downgrade, and viewport import/export will gracefully update tiles rather than a per-acre basis.

Performance has also been slightly improved; no allocation is done anymore when updating the image.
2026-01-25 16:55:38 -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();
}
}