mirror of
https://github.com/kwsch/NHSE.git
synced 2026-03-22 09:44:49 -05:00
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.
27 lines
702 B
C#
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();
|
|
}
|
|
} |