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.
47 lines
895 B
C#
47 lines
895 B
C#
using System;
|
|
using NHSE.Injection;
|
|
|
|
namespace NHSE.WinForms;
|
|
|
|
public sealed class USBBotController
|
|
{
|
|
public readonly USBBot Bot = new();
|
|
|
|
public bool Connect()
|
|
{
|
|
try
|
|
{
|
|
return Bot.Connect();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
WinFormsUtil.Error(ex.Message);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public void Disconnect() => Bot.Disconnect();
|
|
|
|
//todo: this
|
|
//public uint GetDefaultOffset()
|
|
//{
|
|
// return Settings.Default.SysBotPouchOffset;
|
|
//}
|
|
|
|
//public void PopPrompt()
|
|
//{
|
|
//}
|
|
|
|
public void WriteBytes(byte[] data, uint offset)
|
|
{
|
|
Bot.WriteBytes(data, offset);
|
|
//SetOffset(offset);
|
|
}
|
|
|
|
public byte[] ReadBytes(uint offset, int length)
|
|
{
|
|
var result = Bot.ReadBytes(offset, length);
|
|
//SetOffset(offset);
|
|
return result;
|
|
}
|
|
} |