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.
This commit is contained in:
Kurt
2026-01-19 23:12:59 -06:00
parent 50ce05af6f
commit 0ce31ca895
21 changed files with 1738 additions and 1617 deletions

View File

@@ -8,10 +8,10 @@ namespace NHSE.WinForms;
public sealed class SysBotController(InjectionType type)
{
public readonly SysBot Bot = new();
private readonly Settings Settings = Settings.Default;
private readonly Settings _settings = Settings.Default;
public string IP => Settings.SysBotIP;
public string Port => Settings.SysBotPort.ToString();
public string IP => _settings.SysBotIP;
public string Port => _settings.SysBotPort.ToString();
public bool Connect(string ip, string port)
{
@@ -28,35 +28,29 @@ public bool Connect(string ip, string port)
return false;
}
var settings = Settings;
settings.SysBotIP = ip;
settings.SysBotPort = p;
settings.Save();
_settings.SysBotIP = ip;
_settings.SysBotPort = p;
_settings.Save();
return true;
}
public uint GetDefaultOffset()
public uint GetDefaultOffset() => type switch
{
var settings = Settings;
return type switch
{
InjectionType.Generic => settings.SysBotGenericOffset,
InjectionType.Pouch => settings.SysBotPouchOffset,
_ => throw new ArgumentOutOfRangeException()
};
}
InjectionType.Generic => _settings.SysBotGenericOffset,
InjectionType.Pouch => _settings.SysBotPouchOffset,
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null),
};
public void SetOffset(uint value)
{
var settings = Settings;
switch (type)
{
case InjectionType.Generic: settings.SysBotGenericOffset = value; break;
case InjectionType.Pouch: settings.SysBotPouchOffset = value; break;
case InjectionType.Generic: _settings.SysBotGenericOffset = value; break;
case InjectionType.Pouch: _settings.SysBotPouchOffset = value; break;
default: return;
}
settings.Save();
_settings.Save();
}
public void HexEdit(uint offset, int length)
@@ -84,12 +78,12 @@ public void HexEdit(uint offset, int length)
public void PopPrompt()
{
if (Settings.SysBotPrompted)
if (_settings.SysBotPrompted)
return;
WinFormsUtil.Alert(MessageStrings.MsgSysBotInfo, MessageStrings.MsgSysBotRequired);
Settings.SysBotPrompted = true;
Settings.Save();
_settings.SysBotPrompted = true;
_settings.Save();
}
public void WriteBytes(byte[] data, uint offset)